45 lines
1.0 KiB
C++
45 lines
1.0 KiB
C++
/*
|
||
* ====================================================
|
||
|
||
* 功能:自定义伽马校正。原理为哈希表查值
|
||
* 作者:刘丁维
|
||
* 生成时间:2020/4/21
|
||
* 最近修改时间:2020/4/21
|
||
* 版本号:v1.0
|
||
|
||
* ====================================================
|
||
*/
|
||
|
||
#ifndef IMAGE_APPLY_CUSTOM_CAMMA_H
|
||
#define IMAGE_APPLY_CUSTOM_CAMMA_H
|
||
|
||
#include "ImageApply.h"
|
||
|
||
class CImageApplyCustomGamma : public CImageApply
|
||
{
|
||
public:
|
||
/*
|
||
* table [in]:自定义查值表
|
||
* length [in]:表的长度,灰度表256,彩色表768
|
||
* */
|
||
CImageApplyCustomGamma(unsigned char* table,int length);
|
||
|
||
virtual ~CImageApplyCustomGamma();
|
||
|
||
virtual void apply(cv::Mat& pDib, int side);
|
||
|
||
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
|
||
|
||
void setTableData(const unsigned char* data, int length);
|
||
private:
|
||
void init_gamma_table();
|
||
void setLUT(const unsigned char* table, int byteCount);
|
||
bool emptyPtr;
|
||
private:
|
||
unsigned char m_table_bit8[256];
|
||
|
||
unsigned char m_table_bit24[768];
|
||
};
|
||
|
||
#endif // !IMAGE_APPLY_CUSTOM_CAMMA_H
|