-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCvxText.h
64 lines (39 loc) · 1.55 KB
/
CvxText.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma once
// CvxText.h
#pragma once
#ifndef OPENCV_CVX_TEXT_2007_08_31_H
#define OPENCV_CVX_TEXT_2007_08_31_H
#include <ft2build.h>
#include FT_FREETYPE_H
#include<opencv.hpp>
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 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(IplImage *img, const wchar_t *text, CvPoint pos);
int putText(IplImage *img, const char *text, CvPoint pos, CvScalar color);
int putText(IplImage *img, const wchar_t *text, CvPoint pos, CvScalar color);
private:
void putWChar(IplImage *img, wchar_t wc, CvPoint &pos, CvScalar color);
private:
FT_Library m_library; // 字Á?库a
FT_Face m_face; // 字Á?体¬?
int m_fontType;
CvScalar m_fontSize;
bool m_fontUnderline;
float m_fontDiaphaneity;
//================================================================
//================================================================
};
#endif // OPENCV_CVX_TEXT_2007_08_31_H