- gazebo
- common
- Image
Encapsulates an image. More...
#include <Image.hh>
Public Member Functions | |
| Image () | |
| Constructor. | |
| virtual | ~Image () |
| Destructor. | |
| int | Load (const std::string &filename) |
| Load an image. Return 0 on success. | |
| void | SetFromData (const unsigned char *data, unsigned int width, unsigned int height, int scanline_bytes, unsigned int bpp) |
| Set the image from raw data (R8G8B8) | |
| void | GetData (unsigned char **data, unsigned int &count) |
| Get the image as a data array. | |
| unsigned int | GetWidth () const |
| Get the width. | |
| unsigned int | GetHeight () const |
| Get the height. | |
| unsigned int | GetBPP () const |
| Get the size of one pixel in bits. | |
| Color | GetPixel (unsigned int x, unsigned int y) |
| Get a pixel color value. | |
| Color | GetAvgColor () |
| Get the average color. | |
| Color | GetMaxColor () |
| Get the max color. | |
| void | Rescale (int width, int height) |
| Rescale the image. | |
| bool | Valid () const |
| Render this image using opengl. | |
| std::string | GetFilename () const |
| Get the full filename of the image. | |
Encapsulates an image.
| void GetData | ( | unsigned char ** | data, |
| unsigned int & | count | ||
| ) |
Get the image as a data array.
| data | Pointer to a NULL array of char. |
| count | The resulting data array size |
| void SetFromData | ( | const unsigned char * | data, |
| unsigned int | width, | ||
| unsigned int | height, | ||
| int | scanline_bytes, | ||
| unsigned int | bpp | ||
| ) |
Set the image from raw data (R8G8B8)
| data | Pointer to the raw image data |
| width | Width in pixels |
| height | Height in pixels |
| scanline_bytes | Size of a image row in bytes |
| bpp | Bits per pixels, aka depth |
| bool Valid | ( | ) | const |
Render this image using opengl.
Returns whether this is a valid image
1.7.5.1