mirror of http://192.168.1.51:8099/lmh188/twain3
57 lines
1.1 KiB
C++
57 lines
1.1 KiB
C++
#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
|