34 #include <FreeImage.h> 51 "UNKNOWN_PIXEL_FORMAT",
79 UNKNOWN_PIXEL_FORMAT = 0,
106 const std::string &_format);
110 public:
explicit Image(
const std::string &_filename=
"");
113 public:
virtual ~
Image();
118 public:
int Load(
const std::string &_filename);
122 public:
void SavePNG(
const std::string &_filename);
129 public:
void SetFromData(
const unsigned char *_data,
131 unsigned int _height,
137 public:
void GetData(
unsigned char **_data,
138 unsigned int &_count)
const;
144 public:
void GetRGBData(
unsigned char **_data,
145 unsigned int &_count)
const;
149 public:
unsigned int GetWidth()
const;
153 public:
unsigned int GetHeight()
const;
157 public:
unsigned int GetBPP()
const;
161 public:
int GetPitch()
const;
165 public: std::string GetFilename()
const;
175 public:
Color GetPixel(
unsigned int _x,
unsigned int _y)
const;
179 public:
Color GetAvgColor();
183 public:
Color GetMaxColor()
const;
188 public:
void Rescale(
int _width,
int _height);
192 public:
bool Valid()
const;
195 private:
void GetDataImpl(
unsigned char **_data,
unsigned int &_count,
196 FIBITMAP *_img)
const;
200 private:
static int count;
203 private: FIBITMAP *bitmap;
206 private: std::string fullName;
Forward declarations for the common classes.
Definition: Animation.hh:33
PixelFormat
Pixel formats enumeration.
Definition: Image.hh:77
Defines a color.
Definition: Color.hh:36
static std::string PixelFormatNames[]
String names for the pixel formats.
Definition: Image.hh:49
Encapsulates an image.
Definition: Image.hh:74