root/lang/cpluspluscli/OpenCvSharp/trunk/OpenCvSharp/CvFont.h @ 30907

Revision 30907, 3.7 kB (checked in by schima, 4 years ago)

DisposableObjectによりリソース解放処理を統一化

Line 
1/**
2 * (C) 2008 Schima
3 * This code is licenced under the LGPL.
4 */
5
6#pragma once
7
8#include "LineType.h"
9#include "FontFace.h"
10
11using namespace System;
12using namespace System::Runtime::InteropServices;
13
14// 名前衝突回避
15typedef CvFont __CvFont;
16
17namespace KwsmLab {
18namespace OpenCvSharp
19{
20        namespace N = KwsmLab::OpenCvSharp;
21        /// <summary>
22        /// フォント
23        /// </summary>
24        public ref class CvFont : public DisposableObject, public ICvObject
25        {
26        protected:
27                virtual void Release( void ) override;
28
29        internal:
30                /// <summary>
31                /// IPL 画像ヘッダ
32                /// </summary>
33                property __CvFont* Ptr;
34                CvFont(__CvFont* ptr);
35
36        public:
37                CvFont( );
38                CvFont( FontFace font_face, Double hscale, Double vscale, Double shear, Int32 thickness, LineType line_type );
39                CvFont( FontFace font_face, Double hscale, Double vscale, Double shear, Int32 thickness );
40                CvFont( FontFace font_face, Double hscale, Double vscale, Double shear );
41                CvFont( FontFace font_face, Double hscale, Double vscale );
42                CvFont( Double scale, Int32 thickness );
43                CvFont( Double scale );
44
45                /// <summary>
46                /// OpenCVのネイティブデータポインタを取得する
47                /// </summary>
48                virtual property IntPtr CvPtr{
49                        IntPtr get(void){ return (IntPtr)Ptr; }
50                }
51                /// <summary>
52                /// 元データポインタのバイトサイズ、
53                /// すなわち sizeof(CvFont) を取得する.
54                /// </summary>
55                virtual property Int32 SizeOf{
56                        Int32 get(void){ return sizeof(*Ptr); }
57                }
58                /// <summary>
59                /// フォント名の識別子
60                /// </summary>
61                property N::FontFace FontFace{
62                        N::FontFace get() { return N::FontFace(Ptr->font_face); }
63                        void            set(N::FontFace value) { Ptr->font_face = int(value); }
64                }
65                /// <summary>
66                /// font data and metrics
67                /// </summary>
68                property IntPtr Ascii{
69                        IntPtr get(){ return (IntPtr)const_cast<int*>(Ptr->ascii); }
70                }
71                /// <summary>
72                ///
73                /// </summary>
74                property IntPtr Greek{
75                        IntPtr get(){ return (IntPtr)const_cast<int*>(Ptr->greek); }
76                }
77                /// <summary>
78                ///
79                /// </summary>
80                property IntPtr Cyrillic{
81                        IntPtr get(){ return (IntPtr)const_cast<int*>(Ptr->cyrillic); }
82                }
83                /// <summary>
84                /// 幅の比率.1.0fにした場合,文字はそれぞれのフォントに依存する元々の幅で表示される. 0.5fにした場合, 文字は元々の半分の幅で表示される.
85                /// </summary>
86                property Single HScale{
87                        Single  get() { return Ptr->hscale; }
88                        void    set(Single value) { Ptr->hscale = value; }
89                }
90                /// <summary>
91                /// 高さの比率.1.0fにした場合,文字はそれぞれのフォントに依存する元々の高さで表示される. 0.5fにした場合, 文字は元々の半分の高さで表示される.
92                /// </summary>
93                property Single VScale{
94                        Single  get() { return Ptr->vscale; }
95                        void    set(Single value) { Ptr->vscale = value; }
96                }
97                /// <summary>
98                /// 垂直線からの文字の相対的な角度.ゼロの場合は非イタリックフォントで,例えば,1.0fは≈45°を意味する.
99                /// </summary>
100                property Single Shear{
101                        Single  get() { return Ptr->shear; }
102                        void    set(Single value) { Ptr->shear = value; }
103                }
104                /// <summary>
105                /// 文字の太さ.
106                /// </summary>
107                property Int32 Thickness{
108                        Int32   get() { return Ptr->thickness; }
109                        void    set(Int32 value) { Ptr->thickness = value; }
110                }
111                /// <summary>
112                /// horizontal interval between letters
113                /// </summary>
114                property Single Dx{
115                        Single  get() { return Ptr->dx; }
116                }               
117                /// <summary>
118                /// 線の種類
119                /// </summary>
120                property N::LineType LineType{
121                        N::LineType get() { return N::LineType(Ptr->line_type); }
122                        void            set(N::LineType value) { Ptr->line_type = int(value); }
123                }
124
125        };
126
127}
128}
Note: See TracBrowser for help on using the browser.