Provides supporting functions for PixelFormat enum.
More...
#include <ignition/rendering/PixelFormat.hh>
|
static unsigned int | BytesPerChannel (PixelFormat _format) |
| Get number of bytes per channel for given format. If an invalid format is given, 0 will be returned. More...
|
|
static unsigned int | BytesPerPixel (PixelFormat _format) |
| Get number of bytes per pixel for given format. If an invalid format is given, 0 will be returned. This is simply the product of GetChannelCount and GetBytesPerChannel. More...
|
|
static unsigned int | ChannelCount (PixelFormat _format) |
| Get number of channels for given format. If an invalid format is given, 0 will be returned. More...
|
|
static PixelFormat | Enum (const std::string &_name) |
| Get enum value by human-readable name. The given string should match watch is returned by GetName. If an invalid name is given, PF_UNKNOWN will be returned. More...
|
|
static bool | IsValid (PixelFormat _format) |
| Determine if given format is valid PixelFormat enum. More...
|
|
static unsigned int | MemorySize (PixelFormat _format, unsigned int _width, unsigned int _height) |
| Get total memory size in bytes for an image with the given format and dimensions. If an invalid format is given, 0 will be returned. This is simply the product of GetBytesPerPixel, _width, and, _height. More...
|
|
static std::string | Name (PixelFormat _format) |
| Get human-readable name for pixel format value. More...
|
|
static PixelFormat | Sanitize (PixelFormat _format) |
| Sanitize given format. If the given value is invalid, PF_UNKNOWN will be returned, otherwise input will be returned unchanged. More...
|
|
Provides supporting functions for PixelFormat enum.
◆ BytesPerChannel()
static unsigned int BytesPerChannel |
( |
PixelFormat |
_format | ) |
|
|
static |
Get number of bytes per channel for given format. If an invalid format is given, 0 will be returned.
- Parameters
-
[in] | _format | Image pixel format |
- Returns
- The number of bytes per channel
◆ BytesPerPixel()
static unsigned int BytesPerPixel |
( |
PixelFormat |
_format | ) |
|
|
static |
Get number of bytes per pixel for given format. If an invalid format is given, 0 will be returned. This is simply the product of GetChannelCount and GetBytesPerChannel.
- Returns
- The number of bytes per pixel
◆ ChannelCount()
static unsigned int ChannelCount |
( |
PixelFormat |
_format | ) |
|
|
static |
Get number of channels for given format. If an invalid format is given, 0 will be returned.
- Parameters
-
[in] | _format | Image pixel format |
- Returns
- The channel count
◆ Enum()
Get enum value by human-readable name. The given string should match watch is returned by GetName. If an invalid name is given, PF_UNKNOWN will be returned.
- Parameters
-
[in] | _name | Name of the pixel format to be retrieved |
- Returns
- The specified PixelFormat enum value
◆ IsValid()
Determine if given format is valid PixelFormat enum.
- Parameters
-
[in] | _format | Enum value to be evaluated |
◆ MemorySize()
static unsigned int MemorySize |
( |
PixelFormat |
_format, |
|
|
unsigned int |
_width, |
|
|
unsigned int |
_height |
|
) |
| |
|
static |
Get total memory size in bytes for an image with the given format and dimensions. If an invalid format is given, 0 will be returned. This is simply the product of GetBytesPerPixel, _width, and, _height.
- Parameters
-
[in] | _format | Image pixel format |
[in] | _width | Image width in pixels |
[in] | _height | Image height in pixels |
- Returns
- The number of bytes per pixel
Referenced by BaseCamera< OgreSensor >::ImageMemorySize().
◆ Name()
Get human-readable name for pixel format value.
- Parameters
-
[in] | _format | Image pixel format |
- Returns
- The format name
◆ Sanitize()
Sanitize given format. If the given value is invalid, PF_UNKNOWN will be returned, otherwise input will be returned unchanged.
- Parameters
-
[in] | _format | Image pixel format to be sanitized |
- Returns
- The sanitized pixel format
Referenced by BaseRenderTarget< OgreObject >::SetFormat().
The documentation for this class was generated from the following file: