34 #include <FreeImage.h> 36 #include <ignition/math/Color.hh> 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: ignition::math::Color Pixel(
const unsigned int _x,
176 const unsigned int _y)
const;
180 public: ignition::math::Color AvgColor();
184 public: ignition::math::Color MaxColor()
const;
189 public:
void Rescale(
int _width,
int _height);
193 public:
bool Valid()
const;
196 private:
void GetDataImpl(
unsigned char **_data,
unsigned int &_count,
197 FIBITMAP *_img)
const;
201 private:
static int count;
204 private: FIBITMAP *bitmap;
207 private: std::string fullName;
Forward declarations for the common classes.
Definition: Animation.hh:26
PixelFormat
Pixel formats enumeration.
Definition: Image.hh:77
static std::string PixelFormatNames[]
String names for the pixel formats.
Definition: Image.hh:49
Encapsulates an image.
Definition: Image.hh:74