twain3.0/huagao/ImageProcess/ImageApplyResize.h

57 lines
1.1 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.

#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