Encapsulates a raw image buffer and relevant properties. More...
#include <gz/rendering/Image.hh>
Public Member Functions | |
| Image () | |
| Default constructor. More... | |
| Image (unsigned int _width, unsigned int _height, PixelFormat _format) | |
| Constructor. More... | |
| Image (unsigned int _width, unsigned int _height, PixelFormat _format, void *_data) | |
| Constructor. Creates an image that stores its pixels in a caller owned buffer instead of allocating its own. The buffer must hold at least MemorySize() bytes and outlive the image and any copy of it, since copies share the same buffer. Copying a camera into such an image writes straight into the caller's memory, for example a message payload, and saves one copy per frame. More... | |
| virtual | ~Image () |
| Destructor. More... | |
| void * | Data () |
| Get a pointer to image data. More... | |
| template<typename T > | |
| T * | Data () |
| Get a pointer to image data. The returned image buffer will be statically cast to the given template type T. More... | |
| const void * | Data () const |
| Get a const pointer to image data. More... | |
| template<typename T > | |
| const T * | Data () const |
| Get a const pointer to image data. The returned image buffer will be statically cast to the given template type T. More... | |
| unsigned int | Depth () const |
| Get image channel depth. More... | |
| PixelFormat | Format () const |
| Get image pixel format. More... | |
| unsigned int | Height () const |
| Get image height in pixels. More... | |
| unsigned int | MemorySize () const |
| Get image channel depth. More... | |
| unsigned int | Width () const |
| Get image width in pixels. More... | |
Detailed Description
Encapsulates a raw image buffer and relevant properties.
Constructor & Destructor Documentation
◆ Image() [1/3]
| Image | ( | ) |
Default constructor.
◆ Image() [2/3]
| Image | ( | unsigned int | _width, |
| unsigned int | _height, | ||
| PixelFormat | _format | ||
| ) |
◆ Image() [3/3]
| Image | ( | unsigned int | _width, |
| unsigned int | _height, | ||
| PixelFormat | _format, | ||
| void * | _data | ||
| ) |
Constructor. Creates an image that stores its pixels in a caller owned buffer instead of allocating its own. The buffer must hold at least MemorySize() bytes and outlive the image and any copy of it, since copies share the same buffer. Copying a camera into such an image writes straight into the caller's memory, for example a message payload, and saves one copy per frame.
◆ ~Image()
|
virtual |
Destructor.
Member Function Documentation
◆ Data() [1/4]
| void* Data | ( | ) |
Get a pointer to image data.
- Returns
- The pointer to image data
◆ Data() [2/4]
| T * Data |
Get a pointer to image data. The returned image buffer will be statically cast to the given template type T.
- Returns
- The pointer to image data
References Image::Data().
◆ Data() [3/4]
| const void* Data | ( | ) | const |
Get a const pointer to image data.
- Returns
- The const pointer to image data
Referenced by Image::Data().
◆ Data() [4/4]
| const T * Data |
Get a const pointer to image data. The returned image buffer will be statically cast to the given template type T.
- Returns
- The const pointer to image data
References Image::Data().
◆ Depth()
| unsigned int Depth | ( | ) | const |
Get image channel depth.
- Returns
- The image channel depth
◆ Format()
| PixelFormat Format | ( | ) | const |
Get image pixel format.
- Returns
- The image pixel format
◆ Height()
| unsigned int Height | ( | ) | const |
Get image height in pixels.
- Returns
- The image height in pixels
◆ MemorySize()
| unsigned int MemorySize | ( | ) | const |
Get image channel depth.
- Returns
- The image channel depth
◆ Width()
| unsigned int Width | ( | ) | const |
Get image width in pixels.
- Returns
- The image width in pixels
The documentation for this class was generated from the following file: