34 #include <FreeImage.h>
36 #include <ignition/math/Color.hh>
52 "UNKNOWN_PIXEL_FORMAT",
80 UNKNOWN_PIXEL_FORMAT = 0,
107 const std::string &_format);
111 public:
explicit Image(
const std::string &_filename=
"");
114 public:
virtual ~
Image();
119 public:
int Load(
const std::string &_filename);
123 public:
void SavePNG(
const std::string &_filename);
130 public:
void SetFromData(
const unsigned char *_data,
132 unsigned int _height,
138 public:
void GetData(
unsigned char **_data,
139 unsigned int &_count)
const;
145 public:
void GetRGBData(
unsigned char **_data,
146 unsigned int &_count)
const;
150 public:
unsigned int GetWidth()
const;
154 public:
unsigned int GetHeight()
const;
158 public:
unsigned int GetBPP()
const;
162 public:
int GetPitch()
const;
166 public: std::string GetFilename()
const;
170 public: PixelFormat GetPixelFormat()
const;
177 public:
Color GetPixel(
unsigned int _x,
unsigned int _y)
const
184 public: ignition::math::Color Pixel(
const unsigned int _x,
185 const unsigned int _y)
const;
190 public:
Color GetAvgColor() GAZEBO_DEPRECATED(9.0);
194 public: ignition::math::
Color AvgColor();
199 public:
Color GetMaxColor() const GAZEBO_DEPRECATED(9.0);
203 public: ignition::math::
Color MaxColor() const;
208 public:
void Rescale(
int _width,
int _height);
212 public:
bool Valid() const;
215 private:
void GetDataImpl(
unsigned char **_data,
unsigned int &_count,
216 FIBITMAP *_img) const;
220 private: static
int count;
223 private: FIBITMAP *bitmap;
226 private: std::
string fullName;
PixelFormat
Pixel formats enumeration.
Definition: Image.hh:78
Defines a color.
Definition: Color.hh:36
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:328
static std::string PixelFormatNames[]
String names for the pixel formats.
Definition: Image.hh:50
Encapsulates an image.
Definition: Image.hh:75