Gazebo Rendering

API Reference

6.6.3

Provides supporting functions for PixelFormat enum. More...

#include <ignition/rendering/PixelFormat.hh>

Static Public Member Functions

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...
 

Detailed Description

Provides supporting functions for PixelFormat enum.

Member Function Documentation

◆ 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]_formatImage 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]_formatImage pixel format
Returns
The channel count

◆ Enum()

static PixelFormat Enum ( const std::string _name)
static

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]_nameName of the pixel format to be retrieved
Returns
The specified PixelFormat enum value

◆ IsValid()

static bool IsValid ( PixelFormat  _format)
static

Determine if given format is valid PixelFormat enum.

Parameters
[in]_formatEnum 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]_formatImage pixel format
[in]_widthImage width in pixels
[in]_heightImage height in pixels
Returns
The number of bytes per pixel

Referenced by BaseCamera< OgreSensor >::ImageMemorySize().

◆ Name()

static std::string Name ( PixelFormat  _format)
static

Get human-readable name for pixel format value.

Parameters
[in]_formatImage pixel format
Returns
The format name

◆ Sanitize()

static PixelFormat Sanitize ( PixelFormat  _format)
static

Sanitize given format. If the given value is invalid, PF_UNKNOWN will be returned, otherwise input will be returned unchanged.

Parameters
[in]_formatImage 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: