qt-correction-tool/imageprocess/ImageApplyResize.h

70 lines
1.3 KiB
C++
Raw 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_RESIZE_H
#define IMAGE_APPLY_RESIZE_H
#include "ImageApply.h"
class CImageApplyResize : public CImageApply
{
public:
enum class ResizeType
{
RATIO, //比例缩放
DSIZE //尺寸缩放
};
public:
CImageApplyResize();
/*
* type [in]:缩放类型
* size [in]:目标尺寸当type为DSIZE时生效
* fx [in]:横向目标比例当type为RATIO时生效
* fy [in]:纵向目标比例当type为RATIO时生效
*/
CImageApplyResize(ResizeType type, const cv::Size& size, double fx, double fy);
virtual ~CImageApplyResize(void);
virtual void apply(cv::Mat& pDib,int side);
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
double getFX() { return m_fx; }
double getFY() { return m_fy; }
cv::Size getDSize() { return m_dSize; }
ResizeType getType() { return m_type; }
void setFX(double value) { m_fx = value; }
void setFY(double value) { m_fy = value; }
void setDSize(const cv::Size& size) { m_dSize = size; }
void setType(ResizeType type) { m_type = type; }
private:
double m_fx;
double m_fy;
cv::Size m_dSize;
ResizeType m_type;
};
#endif // !IMAGE_APPLY_RESIZE_H