|
#ifndef OPENCV_CVX_TEXT_2007_08_31_H
|
#define OPENCV_CVX_TEXT_2007_08_31_H
|
|
#include <freetype/freetype.h>
|
#include <opencv/cv.h>
|
#include <opencv/highgui.h>
|
|
class CvxText
|
{
|
|
CvxText& operator=(const CvxText&);
|
|
//================================================================
|
//================================================================
|
|
public:
|
|
|
CvxText(const char *freeType);
|
virtual ~CvxText();
|
|
//================================================================
|
//================================================================
|
|
|
void getFont(int *type,
|
CvScalar *size = NULL, bool *underline = NULL, float *diaphaneity = NULL);
|
|
// void setScale(float scale);
|
//
|
// void getScale(float* scale);
|
|
void setBackColor(CvScalar color)
|
{
|
m_backcolor = color;
|
}
|
|
void getBackColor(CvScalar* color)
|
{
|
*color = m_backcolor;
|
}
|
|
void setBackColorEnable(bool enable)
|
{
|
m_backcolorEnable = enable;
|
}
|
|
void getBackColorEnable(bool* enable)
|
{
|
*enable = m_backcolorEnable;
|
}
|
|
void setFont(int *type,
|
CvScalar *size = NULL, bool *underline = NULL, float *diaphaneity = NULL);
|
|
void restoreFont();
|
|
//================================================================
|
//================================================================
|
|
|
int putText(IplImage *img, const char *text, CvPoint pos);
|
|
int putText(cv::Mat img, const char *text, CvPoint pos);
|
|
int putText(IplImage *img, const wchar_t *text, CvPoint pos);
|
|
int putText(cv::Mat img, const wchar_t *text, CvPoint pos);
|
|
int putText(IplImage *img, const char *text, CvPoint pos, CvScalar color);
|
|
int putText(cv::Mat img, const char *text, CvPoint pos, CvScalar color);
|
|
int putText(IplImage *img, const wchar_t *text, CvPoint pos, CvScalar color);
|
|
int putText(cv::Mat img, const wchar_t *text, CvPoint pos, CvScalar color);
|
|
private:
|
|
void putWChar(IplImage *img, wchar_t wc, CvPoint &pos, CvScalar color);
|
void drawBackGround(IplImage *img, CvPoint pos, int w, int h);
|
|
private:
|
|
FT_Library m_library;
|
FT_Face m_face;
|
CvScalar m_backcolor;
|
|
int m_fontType;
|
CvScalar m_fontSize;
|
bool m_fontUnderline;
|
float m_fontDiaphaneity;
|
bool m_backcolorEnable;
|
float m_scale;
|
};
|
|
#endif // OPENCV_CVX_TEXT_2007_08_31_H
|