1#if !defined(__FK_IMAGE_HEADER__)
2#define __FK_IMAGE_HEADER__
10#if !defined(FK_DOXYGEN_USER_PROCESS)
11#if defined(NO_GL_LIBRARY)
12using fk_ImType =
unsigned char;
13using fk_TexID =
unsigned int;
15#include <FK/OpenGL.hh>
16using fk_ImType = GLubyte;
17using fk_TexID = GLuint;
23#if !defined(FK_DOXYGEN_USER_PROCESS)
24 enum class fk_ImageStatus {
31 enum class fk_ImageFix {
264#if !defined(FK_DOXYGEN_USER_PROCESS)
268 std::vector<fk_ImType> imageBuf;
269 fk_ImType *bufPointer;
368 bool writeBMP(
const std::string fileName,
const bool transFlg =
false);
381 bool writePNG(
const std::string fileName,
const bool transFlg =
true);
398 bool writeJPG(
const std::string fileName,
int quality = 80);
583 bool setRGBA(
int x,
int y,
int r,
int g,
int b,
int a);
603 bool setRGB(
int x,
int y,
int r,
int g,
int b);
620 bool setR(
int x,
int y,
int r);
637 bool setG(
int x,
int y,
int g);
654 bool setB(
int x,
int y,
int b);
671 bool setA(
int x,
int y,
int a);
726#if !defined(FK_DOXYGEN_USER_PROCESS)
727 fk_TexID GetTexID(
void);
728 bool GetUpdate(
void);
729 void SetUpdate(
bool);
733 std::unique_ptr<Member> _m;
735 unsigned int ChgUInt(
unsigned char *,
int)
const;
736 unsigned int ChgUShort(fk_ImType *,
int)
const;
738 int GetOffset(
int,
int)
const;
739 fk_ImType RoundVal(
int)
const;
740 fk_ImageStatus CreateImg(
const std::string);
741 fk_ImageStatus CreateImg(fk_ImType *);
742 void CreateBuffer(
bool =
true);
743 void CreateBuffer(
int,
int,
bool =
true);
745 bool IsPixelStatus(
int,
int)
const;
746 int GetOneBufferSize(
int,
int);
747 int GetFixVal(fk_ImageFix,
int)
const;
749 void SetLong2Byte(
long, fk_ImType *,
int);
750 void SetInt2Byte(
int, fk_ImType *,
int);
752 void SetTexID(
const fk_TexID);
754 bool IsBmpFile(
const std::string)
const;
755 bool IsBmpData(fk_ImType *)
const;
756 fk_ImageStatus LoadBmpFile(
const std::string);
757 fk_ImageStatus LoadBmpData(fk_ImType *);
758 void SetRGBA4Bmp(
int,
int, fk_ImType *,
759 int, std::vector<fk_ImType> &);
761 bool GetBmpFileHeader(std::ifstream &, fk_ImType *);
762 bool GetBmpInfoHeader(std::ifstream &, fk_ImType *);
765 fk_ImageStatus SaveBmpFile(std::string,
bool);
766 void MakeBmpFileHeader(
int,
int,
int,
767 std::vector<fk_ImType> &);
768 void MakeBmpInfoHeader(
int,
int,
int,
769 std::vector<fk_ImType> &);
770 void MakeBmpBuffer(
int,
int,
bool, fk_ImType *);
772 bool IsPngFile(
const std::string)
const;
773 fk_ImageStatus LoadPngFile(
const std::string);
774 fk_ImageStatus LoadPngData(fk_ImType *);
775 void ReleaseTexture(
void);
FK の各クラスの基盤となる基本クラス
Definition Base.h:113
RGB色を管理するクラス
Definition Color.h:21
画像サイズを表すクラス
Definition Image.h:67
fk_Dimension & operator*=(int)
実数積代入演算子
void set(int w, int h)
画像サイズ設定関数
friend fk_Dimension operator/(const fk_Dimension &, int)
整数値ベクトル商演算二項演算子
friend fk_Dimension operator+(const fk_Dimension &, const fk_Dimension &)
整数値ベクトル和二項演算子
fk_Dimension & operator=(const fk_Dimension &)
単純代入演算子
fk_Dimension(int w=0, int h=0)
コンストラクタ
int w
画像の横幅
Definition Image.h:69
bool operator>=(const fk_Dimension &) const
等価右不等号演算子
bool operator<=(const fk_Dimension &) const
等価左不等号演算子
int h
画像の縦幅
Definition Image.h:70
friend fk_Dimension operator*(const fk_Dimension &, int)
整数値ベクトル倍演算二項演算子1
bool operator==(const fk_Dimension &) const
同値比較演算子
bool operator>(const fk_Dimension &) const
右不等号演算子
fk_Dimension(const fk_Dimension &)
コピーコンストラクタ
bool operator!=(const fk_Dimension &) const
異値比較演算子
fk_Dimension & operator-(void) const
単項マイナス演算子
fk_Dimension & operator-=(const fk_Dimension &)
単項差代入演算子
fk_Dimension & operator/=(int)
実数商代入演算子
bool operator<(const fk_Dimension &) const
左不等号演算子
fk_Dimension & operator+=(const fk_Dimension &)
単項和代入演算子
画像を生成、管理するクラス
Definition Image.h:260
void copyImage(const fk_Image *image)
画像データコピー関数1
int getA(int x, int y) const
ピクセルA要素取得関数
bool writeJPG(const std::string fileName, int quality=80)
JPEG ファイル出力関数
bool setG(int x, int y, int g)
ピクセル G 値設定関数
const fk_ImType * getBufPointer(void) const
画像データ配列先頭アドレス取得関数
bool writeBMP(const std::string fileName, const bool transFlg=false)
BMP ファイル出力関数
bool subImage(const fk_Image *image, int x, int y, int w, int h)
画像データ部分抽出関数
bool setRGB(int x, int y, int r, int g, int b)
ピクセル RGB 値設定関数
void newImage(int w, int h, bool initFlg=true)
画像領域生成関数
fk_Image(const fk_Image &)
コピーコンストラクタ
void fillColor(const fk_Color &col)
バッファ全体初期化関数1
bool readPNGData(fk_ImType *buf)
PNG データ入力用関数
bool readBMPData(fk_ImType *buf)
BMP バッファ入力関数
bool setR(int x, int y, int r)
ピクセル R 値設定関数
int getR(int x, int y) const
ピクセルR要素取得関数
fk_Image(int w=0, int h=0)
コンストラクタ
bool setB(int x, int y, int b)
ピクセル B 値設定関数
void fillColor(int r, int g, int b, int a=0)
バッファ全体初期化関数2
bool readPNG(const std::string fileName)
PNG ファイル入力関数
bool setA(int x, int y, int a)
ピクセル A 値設定関数
bool setColor(int x, int y, const fk_Color &col)
ピクセル色値設定関数
fk_Color getColor(int x, int y) const
ピクセル色要素取得関数
const fk_Dimension * getBufferSize(void)
画像バッファサイズ取得関数
int getWidth(void) const
画像横幅取得関数
const fk_Dimension * getImageSize(void)
画像サイズ取得関数
int getG(int x, int y) const
ピクセルG要素取得関数
void copyImage(const fk_Image *image, int x, int y)
画像データコピー関数2
bool readJPG(const std::string fileName)
JPEG ファイル入力関数
bool writePNG(const std::string fileName, const bool transFlg=true)
PNG ファイル出力関数
int getB(int x, int y) const
ピクセルB要素取得関数
int getHeight(void) const
画像縦幅取得関数
bool setRGBA(int x, int y, int r, int g, int b, int a)
ピクセル RGBA 値設定関数
bool readBMP(const std::string fileName)
BMP ファイル入力関数
virtual ~fk_Image()
デストラクタ
画像中の矩形領域を表すクラス
Definition Image.h:196
fk_Rect(const fk_Rect &)
コピーコンストラクタ
void set(int x, int y, int w, int h)
領域設定関数
int y
領域左上の y 座標
Definition Image.h:199
int h
領域の縦幅
Definition Image.h:201
int w
領域の横幅
Definition Image.h:200
fk_Dimension getSize(void)
領域サイズ参照関数
void setSize(int w, int h)
領域サイズ設定関数
fk_Rect(int x=0, int y=0, int w=0, int h=0)
コンストラクタ
void setPos(int x, int y)
領域位置設定関数
int x
領域左上の x 座標
Definition Image.h:198
テクスチャ用基底クラス
Definition Texture.h:45
Fine Kernel Toolkit 名前空間
Definition Angle.h:6
fk_Color operator+(const fk_Color &, const fk_Color &)
色要素和二項演算子
fk_Color operator/(const fk_Color &, double)
実数商二項演算子
fk_SnapProcMode
画像取り込み方法を表す列挙型
Definition Image.h:56
@ WIN32_GDI
Win32 GDI (Windows プラットフォームのみ対応)
fk_ImageType
画像フォーマットを表す列挙型
Definition Image.h:49
@ BMP
Windows Bitmap (BMP) 形式
fk_Color operator-(const fk_Color &, const fk_Color &)
色要素差二項演算子
fk_Color operator*(const fk_Color &, double)
実数倍二項演算子1