twain3/ImageProcess/ImageApplyCustomGamma.h

45 lines
990 B
C++
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ====================================================
* 功能:自定义伽马校正。原理为哈希表查值
* 作者:刘丁维
* 生成时间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