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