gz/rendering/PixelBuffer.hh
Go to the documentation of this file.
Encapsulates a raw image buffer and relevant properties.
Definition: gz/rendering/Image.hh:40
Non owning, writable view of a caller owned pixel buffer.
Definition: gz/rendering/PixelBuffer.hh:49
~PixelBuffer()=default
Destructor. Does not free the buffer.
bool Valid() const
Check that the buffer can hold a frame: the pointer is not null and Size() is at least MemorySize().
PixelBuffer(const PixelBuffer &_other)=default
Copy constructor. Copies of a view share the same buffer.
std::size_t MemorySize() const
Get the number of bytes Width x Height pixels of Format need.
PixelBuffer & operator=(PixelBuffer &&)=delete
Views cannot be rebound.
PixelBuffer(unsigned int _width, unsigned int _height, PixelFormat _format, void *_data, std::size_t _size)
Describe a caller owned buffer.
unsigned char * Data() const
Get a pointer to the first byte of the buffer. The pointer is writable even through a const view: thi...
std::size_t Size() const
Get the size of the buffer in bytes, as given by the caller.
PixelBuffer & operator=(const PixelBuffer &)=delete
Views cannot be rebound.
PixelBuffer(Image &_image)
View the storage of an existing image. The view is only valid while the image, or a copy of it,...
PixelFormat
Image pixel format types.
Definition: gz/rendering/PixelFormat.hh:33