An image class to be used with video IO. More...
#include <Radiant/VideoImage.hpp>
Classes | |
| class | Plane |
| Holds the data for one image plane. More... | |
Public Member Functions | |
| bool | allocateMemory (ImageFormat fmt, int w, int h) |
| Allocates memory and sets the image format. More... | |
| bool | allocateMemory (const VideoImage &that) |
| Allocates memory and sets the image format, based on another image. More... | |
| bool | copyData (const VideoImage &that) |
| Copies the image data. More... | |
| void | freeMemory () |
| Free memory on all the planes. | |
| Nimble::Vector2i | geometry () const |
| Returns the pixel dimensions of the image. More... | |
| int | height () const |
| The height of the image. More... | |
| int | pixels () const |
| The number of pixels in the image. More... | |
| void | reset () |
| Resets the image. | |
| void | setFormatBGR () |
| Sets the image format to interleaved BGR. | |
| void | setFormatBGRA () |
| Sets the image format to interleaved BGRA. | |
| void | setFormatRGB () |
| Sets the image format to interleaved RGB. | |
| void | setFormatRGB24 () |
| Sets the image format to planar RGB24. | |
| void | setFormatRGBA () |
| Sets the image format to interleaved RGB. | |
| void | setFormatYUV420 () |
| Sets the image format to interleaved YUV 420. | |
| void | setFormatYUV420P () |
| Sets the image format to planar YUV 420. | |
| void | setFormatYUV422P () |
| Sets the image format to planar YUV 422. | |
| unsigned | size () const |
| Returns the size of the image data in bytes. More... | |
| VideoImage (ImageFormat fmt=IMAGE_UNKNOWN, int w=0, int h=0) | |
| Constructs a new video image. More... | |
| int | width () const |
| The width of the image. More... | |
| void | zero () |
| Fill the image with 0. | |
| ~VideoImage () | |
| Destructor. | |
Static Public Member Functions | |
| static const char * | formatName (ImageFormat fmt) |
| Returns a readable name of a given image format. More... | |
| static Nimble::Vector2i | planeSize (ImageFormat fmt, int w, int h, int plane) |
| Returns the size of an image plane in bytes. More... | |
Public Attributes | |
| ImageFormat | m_format |
| Image format. | |
| int | m_height |
| Height of the image. | |
| Plane | m_planes [4] |
| Plane information. | |
| int | m_width |
| Width of the image. | |
An image class to be used with video IO.
This image class is used to package planar and interleaved RGB, YUV and grayscale, with or without alpha channel. A typical use case for this class is the transfer of video frames between video codec and the application.
An image is composed of planes that contain the actual image data.
|
inline |
Constructs a new video image.
| fmt | Format of the image |
| w | Width of the image |
| h | Height of the image |
| bool Radiant::VideoImage::allocateMemory | ( | ImageFormat | fmt, |
| int | w, | ||
| int | h | ||
| ) |
Allocates memory and sets the image format.
| fmt | Image format |
| w | image width |
| h | image height |
|
inline |
Allocates memory and sets the image format, based on another image.
This function can be used when preparing to copy contents from
from another image.
| that | VideoImage used as template for the new width, height and format settings |
| bool Radiant::VideoImage::copyData | ( | const VideoImage & | that | ) |
Copies the image data.
The image format, image size and data
buffers should be set correctly before calling this method.
| that | VideoImage to copy data from |
|
static |
Returns a readable name of a given image format.
| fmt | Format of the image |
|
inline |
Returns the pixel dimensions of the image.
|
inline |
The height of the image.
|
inline |
The number of pixels in the image.
|
static |
Returns the size of an image plane in bytes.
| fmt | Format of the image |
| w | Width of the plane |
| h | Height of the plane |
|
inline |
Returns the size of the image data in bytes.
|
inline |
The width of the image.