code_device/hgdriver/ImageProcess/ImageApplyRotation.h

57 lines
1.2 KiB
C++

#ifndef IMAGE_APPLY_ROTATION_H
#define IMAGE_APPLY_ROTATION_H
#include "ImageApply.h"
class CImageApplyRotation : public CImageApply
{
public:
enum class RotationType
{
Invalid,
Rotate_90_clockwise,
Rotate_180,
Rotate_90_anti_clockwise,
AutoTextOrientation
};
public:
CImageApplyRotation(RotationType rotation, bool isBackTransposed = false, int dpi = 200, const char* tessdataPath = nullptr);
virtual ~CImageApplyRotation();
virtual void apply(cv::Mat& pDib, int side) override;
virtual void apply(std::vector<cv::Mat>& mats, bool isTwoSide);
bool isBackTransposed() { return m_backTranspose; }
int getDPI() { return m_dpi; }
int angleResult() { return m_angleResult; }
const std::vector<int>& angleResults() { return m_angleResults; }
RotationType getRotationType() { return m_rotation; }
void setBackTransposed(bool enabled) { m_backTranspose = enabled; }
void setDPI(int dpi) { m_dpi = dpi; }
void setRotationType(RotationType type) { m_rotation = type; }
private:
RotationType m_rotation;
bool m_backTranspose;
int m_dpi;
void* osd;
int m_angleResult;
std::vector<int> m_angleResults;
};
#endif // !IMAGE_APPLY_ROTATION_H