Files
HPPA/HPPA/MultibandRasterRenderer.h
tangchao0503 55609b7b3b add,计划采集16:
解决切换相机时的图片不切换问题
解决设置高光谱相机帧率和积分时间失效问题
拷贝航线路径文件到数据文件夹
单反弹窗报错:添加描述
图像控制添加2%拉伸
2026-06-18 10:13:50 +08:00

40 lines
1.4 KiB
C++

#pragma once
#include "RasterRendererBase.h"
#include "RasterRenderParams.h"
#include <vector>
#include <memory>
class RasterDataProvider;
class MultibandRasterRenderer : public RasterRendererBase
{
public:
explicit MultibandRasterRenderer(RasterDataProvider* provider);
QImage render() override;
// Parameter access
MultibandRenderParams params() const { return m_params; }
void setParams(const MultibandRenderParams& params) { m_params = params; }
void setStretchRatio(float ratio) { m_stretchRatio = ratio; }
float stretchRatio() const { return m_stretchRatio; }
private:
MultibandRenderParams m_params;
float m_stretchRatio = 0.02f;
// Helper to map float buffer to 8-bit with min/max stretch
static void stretchTo8bit(const std::vector<float>& in, std::vector<unsigned char>& out, float minVal, float maxVal);
// Helper to compute histogram from float buffer
static void computeHistogram(const std::vector<float>& in, std::vector<long>& hist, float& minVal, float& maxVal);
// Helper to find stretch values by cumulative histogram ratio
static void findStretchValuesByRatio(const std::vector<long>& hist, float ratio, float& minVal, float& maxVal);
// Helper to stretch to 8-bit using histogram-based stretch
static void stretchTo8bitByHistogram(const std::vector<float>& in, std::vector<unsigned char>& out, float minVal, float maxVal);
};