FineKernelToolKit  3.1.0
Image_CLI.h
[詳解]
1 // Image_CLI.h
2 
3 #pragma once
4 
5 #include <FK/Image.h>
6 #include "Base_CLI.h"
7 #include "Material_CLI.h"
8 
9 namespace FK_CLI
10 {
12  public enum class fk_ImageType {
13  BMP,
14  PNG,
15  JPG
16  };
17 
19 
24  public ref class fk_Dimension {
25  internal:
26  ::fk_Dimension *pDim;
27 
28  ::fk_Dimension * GetP(void);
29 
30  public:
32 
35  fk_Dimension();
36 
38 
42  fk_Dimension(int W, int H);
43 
45  ~fk_Dimension();
46 
48  !fk_Dimension();
49 
51  property int w {
52  int get();
53  void set(int value);
54  }
55 
57  property int h {
58  int get();
59  void set(int value);
60  }
61 
63 
66  property int x {
67  int get();
68  void set(int value);
69  }
70 
72 
75  property int y {
76  int get();
77  void set(int value);
78  }
79 
81 
86  String^ ToString() override;
87 
89 
93  void Set(int W, int H);
94  };
95 
97 
104  public ref class fk_Rect {
105  internal:
106  ::fk_Rect *pRect;
107 
108  ::fk_Rect * GetP(void);
109 
110  public:
111 
113 
116  fk_Rect();
117 
119 
125  fk_Rect(int X, int Y, int W, int H);
126 
128  ~fk_Rect();
129 
131  !fk_Rect();
132 
134  property int x {
135  int get();
136  void set(int value);
137  }
138 
140  property int y {
141  int get();
142  void set(int value);
143  }
144 
146  property int w {
147  int get();
148  void set(int value);
149  }
150 
152  property int h {
153  int get();
154  void set(int value);
155  }
156 
158 
163  String^ ToString() override;
164 
166 
172  void Set(int X, int Y, int W, int H);
173 
175 
179  void SetPos(int X, int Y);
180 
182 
186  void SetSize(int W, int H);
187 
189 
192  fk_Dimension^ GetSize(void);
193  };
194 
196 
210  public ref class fk_Image : fk_BaseObject {
211  internal:
212  ::fk_Image * GetP(void);
213 
214  public:
215 
216 #ifndef FK_DOXYGEN_USER_PROCESS
217  fk_Image(bool argNewFlg);
218 #endif
219 
221 
224  fk_Image();
225 
227 
231  fk_Image(int W, int H);
232 
234  ~fk_Image();
235 
237  !fk_Image();
238 
240 
245  property fk_Color^ default[int, int] {
246  fk_Color^ get(int, int);
247  void set(int, int, fk_Color^);
248  }
249 
251 
254  property fk_Dimension^ Size {
255  fk_Dimension^ get();
256  }
257 
259 
280  fk_Dimension^ get();
281  }
282 
283 #ifndef FK_DOXYGEN_USER_PROCESS
284  property void* Buffer {
285  void* get();
286  }
287 #endif
288 
290 
294  void Init(void);
295 
296 
298 
310  void NewImage(int w, int h, bool initFlg);
311 
313 
320  void NewImage(int w, int h);
321 
323 
329  void CopyImage(fk_Image^ image);
330 
332 
343  void CopyImage(fk_Image^ image, int x, int y);
344 
346 
357  bool SubImage(fk_Image^ image, int x, int y, int w, int h);
358 
360 
371  int GetR(int x, int y);
372 
374 
385  int GetG(int x, int y);
386 
388 
399  int GetB(int x, int y);
400 
402 
413  int GetA(int x, int y);
414 
416 
434  bool SetRGBA(int x, int y, int r, int g, int b, int a);
435 
437 
454  bool SetRGB(int x, int y, int r, int g, int b);
455 
457 
472  bool SetR(int x, int y, int r);
473 
475 
490  bool SetG(int x, int y, int g);
491 
493 
508  bool SetB(int x, int y, int b);
509 
511 
526  bool SetA(int x, int y, int a);
527 
529 
536  void FillColor(fk_Color^ color);
537 
539 
549  void FillColor(int r, int g, int b, int a);
550 
552 
562  void FillColor(int r, int g, int b);
563 
565 
572  bool ReadBMP(String^ fileName);
573 
575 
582  bool ReadPNG(String^ fileName);
583 
585 
592  bool ReadJPG(String^ fileName);
593 
595 
609  bool WriteBMP(String^ fileName, bool transFlg);
610 
612 
619  bool WriteBMP(String^ fileName);
620 
622 
632  bool WritePNG(String^ fileName, bool transFlg);
633 
635 
642  bool WritePNG(String^ fileName);
643 
645 
659  bool WriteJPG(String^ fileName, int quality);
660 
662 
673  bool WriteJPG(String^ fileName);
674  };
675 }
676 
677 /****************************************************************************
678  *
679  * Copyright (c) 1999-2016, Fine Kernel Project, All rights reserved.
680  *
681  * Redistribution and use in source and binary forms,
682  * with or without modification, are permitted provided that the
683  * following conditions are met:
684  *
685  * - Redistributions of source code must retain the above
686  * copyright notice, this list of conditions and the
687  * following disclaimer.
688  *
689  * - Redistributions in binary form must reproduce the above
690  * copyright notice, this list of conditions and the
691  * following disclaimer in the documentation and/or
692  * other materials provided with the distribution.
693  *
694  * - Neither the name of the copyright holders nor the names
695  * of its contributors may be used to endorse or promote
696  * products derived from this software without specific
697  * prior written permission.
698  *
699  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
700  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
701  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
702  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
703  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
704  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
705  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
706  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
707  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
708  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
709  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
710  * POSSIBILITY OF SUCH DAMAGE.
711  *
712  ****************************************************************************/
713 /****************************************************************************
714  *
715  * Copyright (c) 1999-2016, Fine Kernel Project, All rights reserved.
716  *
717  * 本ソフトウェアおよびソースコードのライセンスは、基本的に
718  * 「修正 BSD ライセンス」に従います。以下にその詳細を記します。
719  *
720  * ソースコード形式かバイナリ形式か、変更するかしないかを問わず、
721  * 以下の条件を満たす場合に限り、再頒布および使用が許可されます。
722  *
723  * - ソースコードを再頒布する場合、上記の著作権表示、本条件一覧、
724  * および下記免責条項を含めること。
725  *
726  * - バイナリ形式で再頒布する場合、頒布物に付属のドキュメント等の
727  * 資料に、上記の著作権表示、本条件一覧、および下記免責条項を
728  * 含めること。
729  *
730  * - 書面による特別の許可なしに、本ソフトウェアから派生した製品の
731  * 宣伝または販売促進に、本ソフトウェアの著作権者の名前または
732  * コントリビューターの名前を使用してはならない。
733  *
734  * 本ソフトウェアは、著作権者およびコントリビューターによって「現
735  * 状のまま」提供されており、明示黙示を問わず、商業的な使用可能性、
736  * および特定の目的に対する適合性に関す暗黙の保証も含め、またそれ
737  * に限定されない、いかなる保証もないものとします。著作権者もコン
738  * トリビューターも、事由のいかんを問わず、損害発生の原因いかんを
739  * 問わず、かつ責任の根拠が契約であるか厳格責任であるか(過失その
740  * 他の)不法行為であるかを問わず、仮にそのような損害が発生する可
741  * 能性を知らされていたとしても、本ソフトウェアの使用によって発生
742  * した(代替品または代用サービスの調達、使用の喪失、データの喪失、
743  * 利益の喪失、業務の中断も含め、またそれに限定されない)直接損害、
744  * 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害に
745  * ついて、一切責任を負わないものとします。
746  *
747  ****************************************************************************/
bool SetG(int x, int y, int g)
ピクセル G 値設定メソッド
~fk_Image()
デストラクタ
int x
領域左上 x 座標プロパティ
Definition: Image_CLI.h:134
fk_Dimension()
コンストラクタ1
画像サイズを表すクラス
Definition: Image_CLI.h:24
int h
領域縦幅プロパティ
Definition: Image_CLI.h:152
void Set(int W, int H)
画像サイズ設定メソッド
fk_Dimension^ Size
画像サイズプロパティ
Definition: Image_CLI.h:254
~fk_Dimension()
デストラクタ
FK の各クラスの基盤となる基本クラス
Definition: Base_CLI.h:105
fk_ImageType
画像フォーマットを表す列挙型
Definition: Image_CLI.h:12
bool WriteJPG(String^ fileName, int quality)
JPEG ファイル出力メソッド1.
bool SubImage(fk_Image^ image, int x, int y, int w, int h)
画像データ部分抽出メソッド
bool SetR(int x, int y, int r)
ピクセル R 値設定メソッド
fk_Dimension^ GetSize(void)
領域サイズ参照メソッド
fk_Dimension^ BufferSize
画像バッファサイズプロパティ
Definition: Image_CLI.h:279
fk_Rect()
コンストラクタ1
Windows Bitmap (BMP) 形式
int GetG(int x, int y)
ピクセルG要素取得メソッド
int w
領域横幅プロパティ
Definition: Image_CLI.h:146
void Init(void)
初期化メソッド
int GetR(int x, int y)
ピクセルR要素取得メソッド
bool SetRGBA(int x, int y, int r, int g, int b, int a)
ピクセル RGBA 値設定メソッド
void SetSize(int W, int H)
領域サイズ設定メソッド
bool SetA(int x, int y, int a)
ピクセル A 値設定メソッド
画像中の矩形領域を表すクラス
Definition: Image_CLI.h:104
void FillColor(fk_Color^ color)
バッファ全体初期化メソッド1
bool SetRGB(int x, int y, int r, int g, int b)
ピクセル RGB 値設定メソッド
bool SetB(int x, int y, int b)
ピクセル B 値設定メソッド
bool ReadJPG(String^ fileName)
JPEG ファイル入力メソッド
int GetA(int x, int y)
ピクセルA要素取得メソッド
bool ReadPNG(String^ fileName)
PNG ファイル入力メソッド
bool WritePNG(String^ fileName, bool transFlg)
PNG ファイル出力メソッド1.
RGB色を管理するクラス
Definition: Material_CLI.h:24
void SetPos(int X, int Y)
領域位置設定メソッド
int w
横幅プロパティ
Definition: Image_CLI.h:51
void CopyImage(fk_Image^ image)
画像データコピーメソッド1
int x
横方向プロパティ
Definition: Image_CLI.h:66
void Set(int X, int Y, int W, int H)
領域設定メソッド
int h
縦幅プロパティ
Definition: Image_CLI.h:57
int GetB(int x, int y)
ピクセルB要素取得メソッド
画像を生成、管理するクラス
Definition: Image_CLI.h:210
~fk_Rect()
デストラクタ
fk_Image()
コンストラクタ1
String^ ToString() override
文字列変換メソッド
bool ReadBMP(String^ fileName)
BMP ファイル入力メソッド
bool WriteBMP(String^ fileName, bool transFlg)
BMP ファイル出力メソッド1.
int y
縦方向プロパティ
Definition: Image_CLI.h:75
int y
領域左上 y 座標プロパティ
Definition: Image_CLI.h:140
String^ ToString() override
文字列変換メソッド
void NewImage(int w, int h, bool initFlg)
画像領域生成メソッド1
Definition: AppWindow_CLI.h:11