WIL説明書(C++)  3.0.0
FvGdiImage.h
[詳解]
1 // $Revision: 1.4 $
2 /*
3  @file FvGdiImage.h
4  @brief Grafics device interface figure class (image)
5  @author FAST Corporation
6 */
7 
8 #ifndef _FVGDIIMAGE_H_INCLUDED_
9 #define _FVGDIIMAGE_H_INCLUDED_
10 
11 #include "FvGdiFigure.h"
12 #include "Data/FvRegion.h"
13 
14 #pragma pack(push,_FVCL_PACKING)
15 
16 namespace FVCL
17 {
18 namespace GDI
19 {
20 
22 {
23 private:
24  void _Constructor();
25 
26 public:
27  CFvGdiImage();
28  CFvGdiImage( UINT horz, UINT vert, UINT bpp );
29  CFvGdiImage( const CFvGdiImage& src );
30  CFvGdiImage( const FVCL::Data::CFvImage& src );
31  CFvGdiImage( const FVCL::Data::CFvRegion& src, FVCL::tagRGB32 density );
32  CFvGdiImage( LPCTSTR szFileName );
33  virtual ~CFvGdiImage();
34 
35  enum { DataID = FVCL::Data::CFvImage::DataID };
36 
37  virtual INT GetDataID() const;
38  virtual INT Play( HDC dc, DOUBLE magnification ) const;
39  virtual bool GetDataObject( CFvDataObject* object ) const;
40  virtual CFvGdiFigure* Clone() const;
41  virtual FVCL::Data::CFvRectangle GetClipRect() const;
42  virtual INT CheckFocusMarkPosition( const FVCL::Data::CFvPoint& mouse, DOUBLE margin = 2.0 ) const;
43 
44  virtual bool Load( LPCTSTR szFileName );
45  virtual bool Save( LPCTSTR szFileName ) const;
46 
47  bool Attach( const FVCL::Data::CFvImage& image );
48  bool Detach();
49  bool IsAttach() const;
50  bool IsValid() const;
51 
52  bool GetAttachedImage( FVCL::Data::CFvImage* image ) const;
53 
54  virtual void Free();
55  virtual bool SetSize( UINT horz, UINT vert, UINT bpp );
56  bool GetSize( UINT* horz, UINT* vert, UINT* bpp ) const;
57  SIZE GetSize() const;
58 
59  bool SetStretchHorzSize( UINT horz );
60  UINT GetStretchHorzSize() const;
61 
62  bool SetStretchVertSize( UINT vert );
63  UINT GetStretchVertSize() const;
64 
65  HDC GetHdc() const;
66  void ReleaseHdc() const;
67 
68  void* GetHandle() const;
69  void* GetImageAdrs( UINT x=0, UINT y=0 ) const;
70 
71  bool SetPixelI32(UINT x, UINT y, INT value);
72  INT GetPixelI32(UINT x, UINT y) const;
73 
74  bool SetPixelI64(UINT x, UINT y, INT64 value);
75  INT64 GetPixelI64(UINT x, UINT y) const;
76 
77  bool SetPixelRGB(UINT x, UINT y, FVCL::tagRGB32 value);
78  FVCL::tagRGB32 GetPixelRGB(UINT x, UINT y) const;
79 
80  bool SetPixelAlpha(UINT x, UINT y, UCHAR value);
81  UCHAR GetPixelAlpha(UINT x, UINT y) const;
82 
83  void ClearAlpha();
84  void ClearAlpha(UCHAR red, UCHAR green, UCHAR blue, UCHAR alpha, bool condition);
85  void ClearAlpha(FVCL::tagRGB32 rgb, UCHAR alpha, bool condition);
86  void ClearAlpha(FVCL::tagRGB24 rgb, UCHAR alpha, bool condition);
87 
88  void Clear( DOUBLE value );
89  void Clear( FVCL::tagRGB32 value );
90  void Clear( FVCL::tagRGB24 value );
91 
92  UINT GetHorzSize() const;
93  UINT GetVertSize() const;
94  UINT GetBpp() const;
95  UINT GetHorzByte() const;
96  UINT GetMemSize() const;
97 
98  virtual bool SetPosition( const FVCL::Data::CFvPoint& position );
99  virtual const FVCL::Data::CFvPoint& GetPosition() const;
100 
101  bool SetRasterOperation( UINT rasterope );
102  UINT GetRasterOperation() const;
103 
104  bool SetAlpha( UCHAR alpha );
105  UCHAR GetAlpha() const;
106 
107  bool SetAlphaFormat( UCHAR alpha_format );
108  UCHAR GetAlphaFormat() const;
109 
110  bool SetHalftoneMode( bool halftone );
111  bool GetHalftoneMode() const;
112 
113  bool SetScaling( bool scaling );
114  bool GetScaling() const;
115 
116  static bool CheckValidity( const FVCL::Data::CFvImage& image );
117  static bool CheckCopyable( const FVCL::Data::CFvImage& image );
118 
119  static UINT CalcWidthByte( UINT horz, UINT bpp );
120  static UINT CalcAllocBpp( UINT bpp );
121  static UINT CalcValidBpp( UINT type, UINT channel );
122 
123  bool CopyFrom( const FVCL::Data::CFvRegion& src, FVCL::tagRGB32 density );
124  bool Copy( const FVCL::Data::CFvImage& src, UINT option=0 );
125 
126  virtual CFvGdiImage& operator = ( const FVCL::Data::CFvImage& src );
127  virtual CFvGdiImage& operator = ( const CFvGdiImage& src );
128  virtual bool operator == ( const CFvGdiFigure& src ) const;
129  virtual bool operator != ( const CFvGdiFigure& src ) const;
130 
131 protected:
132  bool _Allocate( UINT horz, UINT vert, UINT bpp );
133  void _Free();
134  bool _CreateDIB( UINT horz, UINT vert, UINT bpp, void** handle, void** image );
135 
136  bool _Copy( const FVCL::Data::CFvImage& src, const FVCL::Data::CFvRectangle* area, UINT option=0 );
137  bool _CopyFromBIN( const void* adrs, const RECT& region, UINT depth, UINT wbytes );
138  bool _CopyFromUC8( const void* adrs, const RECT& region, UINT depth, UINT wbytes );
139  bool _CopyFromUC8x3( const void** adrs, const RECT& region, UINT depth, UINT wbytes );
140  bool _CopyFromUS16( const void* adrs, const RECT& region, UINT depth, UINT wbytes );
141  bool _CopyFromUS16x3( const void** adrs, const RECT& region, UINT depth, UINT wbytes );
142  bool _CopyFromUI32( const void* adrs, const RECT& region, UINT depth, UINT wbytes );
143  bool _CopyFromUI32x3( const void** adrs, const RECT& region, UINT depth, UINT wbytes );
144  bool _CopyFromRGB24( const void* adrs, const RECT& region, UINT depth, UINT wbytes );
145  bool _CopyFromRGB32( const void* adrs, const RECT& region, UINT depth, UINT wbytes );
146  bool _CopyFromARGB( const void* adrs, const RECT& region, UINT wbytes );
147 
148 public:
150 
151 protected:
156  void* m_Handle;
157  void* m_ImageAdrs;
165  bool m_Scaling;
166  mutable HDC m_hdc;
167 };
168 
169 } // GDI
170 
171 } // FVCL
172 
173 #pragma pack(pop)
174 
175 #endif // _FVGDIIMAGE_H_INCLUDED_
#define FVCL_API
DLLエクスポートマクロ
Definition: FvMacros.h:61
UCHAR m_Alpha
アルファブレンド処理の透明度
Definition: FvGdiImage.h:153
リージョンオブジェクトのインターフェース
24bitカラー画素構造体
Definition: FvDefs.h:80
unsigned char UCHAR
整数型(8ビット)[符号なし]
Definition: FvDefs.h:33
点構造クラス
Definition: FvPoint.h:38
画像オブジェクトのデータID
Definition: FvImage.h:80
UINT m_RasterOperation
ラスターオペレーションコード
Definition: FvGdiImage.h:152
LPCSTR LPCTSTR
汎用文字列型(const付き)
Definition: FvDefs.h:57
FVCLのネームスペース
Definition: EVCbasicDeclare.txt:9
UINT m_StretchVertSize
伸縮後の高さ(pixel)
Definition: FvGdiImage.h:164
32bitカラー画素構造体
Definition: FvDefs.h:81
UINT m_HorzSize
画像の幅(pixel)
Definition: FvGdiImage.h:158
int INT
整数型(32ビット)
Definition: FvDefs.h:36
UINT m_HorzByte
画像の水平サイズ(byte)
Definition: FvGdiImage.h:161
データオブジェクトの基本クラス
Definition: FvDataObject.h:20
矩形構造クラス
Definition: FvRectangle.h:37
GDI図形構造基本クラスのインターフェース
double DOUBLE
倍精度浮動小数点型(64ビット)
Definition: FvDefs.h:62
UINT m_StretchHorzSize
伸縮後の幅(pixel)
Definition: FvGdiImage.h:163
int64_t INT64
整数型(64ビット)
Definition: FvDefs.h:41
const INT Free
フリー形状
Definition: FvConversionDefs.h:25
FVCL_API INT Copy(const CFvStructureElement &src, FVCL::Data::CFvImage *dst)
コピー
UINT m_Bpp
画像1画素辺りのビット数
Definition: FvGdiImage.h:160
矩形構造体
Definition: _structure.h:145
UINT m_VertSize
画像の高さ(pixel)
Definition: FvGdiImage.h:159
GDI図形構造基本クラス
Definition: FvGdiFigure.h:33
unsigned int UINT
整数型(32ビット)[符号なし]
Definition: FvDefs.h:37
HDC m_hdc
関連付けられたデバイスコンテキスト
Definition: FvGdiImage.h:166
bool m_HalftoneMode
ハーフトーンモード
Definition: FvGdiImage.h:155
FVCL::Data::CFvPoint m_position
基準位置
Definition: FvGdiImage.h:149
UCHAR m_AlphaFormat
アルファブレンド処理のフォーマット
Definition: FvGdiImage.h:154
void * m_ImageAdrs
画像領域の先頭アドレス
Definition: FvGdiImage.h:157
void * m_Handle
ビットマップハンドル
Definition: FvGdiImage.h:156
画像オブジェクト
Definition: FvImage.h:64
bool m_Scaling
伸縮属性
Definition: FvGdiImage.h:165
class FVCL_API CFvGdiImage
前方宣言
Definition: FvGdiArc.h:20
GDI画像オブジェクト
Definition: FvGdiImage.h:21
リージョンオブジェクト
Definition: FvRegion.h:28
bool m_IsAttach
アタッチの有無
Definition: FvGdiImage.h:162

Documentation copyright © 2007 FAST Corporation. [B-001864]
Generated on 2023年11月02日(木) 10時12分53秒 for WIL説明書(C++) by doxygen 1.8.11