53 lines
1.1 KiB
C++
53 lines
1.1 KiB
C++
/*
|
||
* ====================================================
|
||
|
||
* 功能:色彩变换
|
||
* 作者:刘丁维
|
||
* 生成时间:2020/6/19
|
||
* 最近修改时间:v1.0 2020/6/19
|
||
v1.1 2020/6/20 添加BGR转HSV,添加BGR_MAX,添加BGR_MIN
|
||
* 版本号:v1.1
|
||
|
||
* ====================================================
|
||
*/
|
||
|
||
#ifndef IMAGE_APPLY_CONVERT_COLOR_H
|
||
#define IMAGE_APPLY_CONVERT_COLOR_H
|
||
|
||
#include "ImageApply.h"
|
||
|
||
class GIMGPROC_LIBRARY_API CImageApplyCvtColor : public CImageApply
|
||
{
|
||
public:
|
||
|
||
//转换模式
|
||
enum ConversionCodes
|
||
{
|
||
BGR_MAX = 1, //BGR取大值,转GRAY
|
||
BGR_MIN = 2, //BGR取小值,转GRAY
|
||
BGR2GRAY = 6, //BGR转GRAY
|
||
BGR2HSV = 40 //BGR转HSV
|
||
};
|
||
|
||
/*
|
||
* type [in]:色彩转换模式,默认BGR转Gray
|
||
* */
|
||
CImageApplyCvtColor(ConversionCodes type = BGR2GRAY);
|
||
|
||
virtual ~CImageApplyCvtColor();
|
||
|
||
virtual void apply(cv::Mat& pDib, int side);
|
||
|
||
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
|
||
|
||
inline ConversionCodes getConversionCode() { return m_code; }
|
||
|
||
inline void setConversionCode(ConversionCodes code) { m_code = code; }
|
||
|
||
private:
|
||
ConversionCodes m_code;
|
||
|
||
};
|
||
|
||
#endif // !IMAGE_APPLY_CUSTOM_CAMMA_H
|