Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Attributes | List of all members
om::images::base::PixelFormat Class Reference

A class that describes the storage format for an image pixel. More...

#include <omImagePixelFormat.h>

Public Member Functions

 PixelFormat ()
 Create a default pixel format with no channels. More...
 
 PixelFormat (const ColorSpace &newColorSpace)
 Create a pixel format object that corresponds to the default format for the given color space. More...
 
 PixelFormat (const ColorSpace &newColorSpace, const ChannelInfo &channel0)
 Create a 1-channl pixel format object with the given color space and channel information. More...
 
 PixelFormat (const ColorSpace &newColorSpace, const ChannelInfo &channel0, const ChannelInfo &channel1)
 Create a 2-channl pixel format object with the given color space and channel information. More...
 
 PixelFormat (const ColorSpace &newColorSpace, const ChannelInfo &channel0, const ChannelInfo &channel1, const ChannelInfo &channel2)
 Create a 3-channl pixel format object with the given color space and channel information. More...
 
 PixelFormat (const ColorSpace &newColorSpace, const ChannelInfo &channel0, const ChannelInfo &channel1, const ChannelInfo &channel2, const ChannelInfo &channel3)
 Create a 4-channl pixel format object with the given color space and channel information. More...
 
Size getSizeInBits () const
 Get the number of bits required for each pixel of this pixel format. More...
 
Size getSizeInBytes () const
 Get the number of bytes required for each pixel of this pixel format. More...
 
ChannelInfogetChannelInfo (Index channelIndex)
 Return information about the channel at the given index. More...
 
const ChannelInfogetChannelInfo (Index channelIndex) const
 Return information about the channel at the given index. More...
 
void setChannelInfo (Index channelIndex, const ChannelInfo &newChannelInfo)
 Set information about the channel at the given index. More...
 
const ChannelTypegetChannelType (Index channelIndex) const
 Return the semantic type of the channel at the given index. More...
 
void setChannelType (Index channelIndex, const ChannelType &newChannelType)
 Set the semantic type of the channel at the given index. More...
 
const ScalarTypegetChannelStorageType (Index channelIndex) const
 Return the primitive type of the storage for the channel at the given index. More...
 
void setChannelStorageType (Index channelIndex, const ScalarType &newScalarType)
 Set the primitive type of the storage for the channel at the given index. More...
 
Size getChannelSizeInBits (Index channelIndex) const
 Get the size in bits for each channel of this pixel format. More...
 
Size getChannelSizeInBytes (Index channelIndex) const
 Get the size in bytes for each channel of this pixel format. More...
 
Size getChannelCount () const
 Return the number of channels that this pixel format has. More...
 
void addChannel (const ChannelInfo &channelInfo)
 Add a new channel to the end of this image pixel format. More...
 
void clearChannels ()
 Remove all channels from this pixel format. More...
 
const ColorSpacegetColorSpace () const
 Return the color space of this pixel format. More...
 
void setColorSpace (const ColorSpace &newColorSpace)
 Set the color space of this pixel format. More...
 
Bool hasAlpha () const
 Return whether or not this pixel format has an alpha (transparency) channel. More...
 
Bool operator== (const PixelFormat &other) const
 Return whether or not this pixel format is the same as another. More...
 
Bool operator!= (const PixelFormat &other) const
 Return whether or not this pixel format is not the same as another. More...
 
String toString () const
 Return a string representation of the pixel format. More...
 
 operator String () const
 Convert this pixel format into a string representation. More...
 

Static Public Attributes

static const PixelFormat UNDEFINED
 An undefined pixel format. More...
 
static const PixelFormat RGB8
 An RGB pixel format with 8 bits per component. More...
 
static const PixelFormat RGB16
 An RGB pixel format with 16 bits per component. More...
 
static const PixelFormat RGB16F
 An RGB pixel format with 16 floating-point bits per component. More...
 
static const PixelFormat RGB32F
 An RGB pixel format with 32 floating-point bits per component. More...
 
static const PixelFormat RGBA8
 An RGBA pixel format with 8 bits per component. More...
 
static const PixelFormat RGBA16
 An RGBA pixel format with 16 bits per component. More...
 
static const PixelFormat RGBA16F
 An RGBA pixel format with 16 floating-point bits per component. More...
 
static const PixelFormat RGBA32F
 An RGBA pixel format with 32 floating-point bits per component. More...
 
static const PixelFormat GRAY8
 A 1-channel pixel format with 8 bits per component. More...
 
static const PixelFormat GRAY16
 A 1-channel pixel format with 16 bits per component. More...
 
static const PixelFormat GRAY16F
 A 1-channel pixel format with 16 floating-point bits per component. More...
 
static const PixelFormat GRAY32F
 A 1-channel pixel format with 32 floating-point bits per component. More...
 
static const PixelFormat GRAY_ALPHA8
 A 2-channel pixel format with 8 bits per component. More...
 
static const PixelFormat GRAY_ALPHA16
 A 2-channel pixel format with 16 bits per component. More...
 
static const PixelFormat GRAY_ALPHA16F
 A 2-channel pixel format with 16 floating-point bits per component. More...
 
static const PixelFormat GRAY_ALPHA32F
 A 2-channel pixel format with 32 floating-point bits per component. More...
 
static const PixelFormat CMYK8
 An CMYK pixel format with 8 bits per component. More...
 
static const PixelFormat CMYK16
 An CMYK pixel format with 16 bits per component. More...
 
static const PixelFormat CMYK16F
 An CMYK pixel format with 16 floating-point bits per component. More...
 
static const PixelFormat CMYK32F
 An CMYK pixel format with 32 floating-point bits per component. More...
 

Detailed Description

A class that describes the storage format for an image pixel.

Constructor & Destructor Documentation

om::images::base::PixelFormat::PixelFormat ( )
inline

Create a default pixel format with no channels.

om::images::base::PixelFormat::PixelFormat ( const ColorSpace newColorSpace)

Create a pixel format object that corresponds to the default format for the given color space.

om::images::base::PixelFormat::PixelFormat ( const ColorSpace newColorSpace,
const ChannelInfo channel0 
)

Create a 1-channl pixel format object with the given color space and channel information.

om::images::base::PixelFormat::PixelFormat ( const ColorSpace newColorSpace,
const ChannelInfo channel0,
const ChannelInfo channel1 
)

Create a 2-channl pixel format object with the given color space and channel information.

om::images::base::PixelFormat::PixelFormat ( const ColorSpace newColorSpace,
const ChannelInfo channel0,
const ChannelInfo channel1,
const ChannelInfo channel2 
)

Create a 3-channl pixel format object with the given color space and channel information.

om::images::base::PixelFormat::PixelFormat ( const ColorSpace newColorSpace,
const ChannelInfo channel0,
const ChannelInfo channel1,
const ChannelInfo channel2,
const ChannelInfo channel3 
)

Create a 4-channl pixel format object with the given color space and channel information.

Member Function Documentation

Size om::images::base::PixelFormat::getSizeInBits ( ) const
inline

Get the number of bits required for each pixel of this pixel format.

Size om::images::base::PixelFormat::getSizeInBytes ( ) const

Get the number of bytes required for each pixel of this pixel format.

ChannelInfo& om::images::base::PixelFormat::getChannelInfo ( Index  channelIndex)
inline

Return information about the channel at the given index.

const ChannelInfo& om::images::base::PixelFormat::getChannelInfo ( Index  channelIndex) const
inline

Return information about the channel at the given index.

void om::images::base::PixelFormat::setChannelInfo ( Index  channelIndex,
const ChannelInfo newChannelInfo 
)
inline

Set information about the channel at the given index.

const ChannelType& om::images::base::PixelFormat::getChannelType ( Index  channelIndex) const
inline

Return the semantic type of the channel at the given index.

void om::images::base::PixelFormat::setChannelType ( Index  channelIndex,
const ChannelType newChannelType 
)
inline

Set the semantic type of the channel at the given index.

const ScalarType& om::images::base::PixelFormat::getChannelStorageType ( Index  channelIndex) const
inline

Return the primitive type of the storage for the channel at the given index.

void om::images::base::PixelFormat::setChannelStorageType ( Index  channelIndex,
const ScalarType newScalarType 
)
inline

Set the primitive type of the storage for the channel at the given index.

Size om::images::base::PixelFormat::getChannelSizeInBits ( Index  channelIndex) const
inline

Get the size in bits for each channel of this pixel format.

Channel indices start at 0 and go up to N-1 for N channels. If the specified channel index is outside of the valid range, size of 0 will be returned.

Size om::images::base::PixelFormat::getChannelSizeInBytes ( Index  channelIndex) const
inline

Get the size in bytes for each channel of this pixel format.

Channel indices start at 0 and go up to N-1 for N channels. If the specified channel index is outside of the valid range, size of 0 will be returned.

Size om::images::base::PixelFormat::getChannelCount ( ) const
inline

Return the number of channels that this pixel format has.

void om::images::base::PixelFormat::addChannel ( const ChannelInfo channelInfo)

Add a new channel to the end of this image pixel format.

void om::images::base::PixelFormat::clearChannels ( )

Remove all channels from this pixel format.

const ColorSpace& om::images::base::PixelFormat::getColorSpace ( ) const
inline

Return the color space of this pixel format.

void om::images::base::PixelFormat::setColorSpace ( const ColorSpace newColorSpace)
inline

Set the color space of this pixel format.

Bool om::images::base::PixelFormat::hasAlpha ( ) const

Return whether or not this pixel format has an alpha (transparency) channel.

Bool om::images::base::PixelFormat::operator== ( const PixelFormat other) const

Return whether or not this pixel format is the same as another.

Bool om::images::base::PixelFormat::operator!= ( const PixelFormat other) const
inline

Return whether or not this pixel format is not the same as another.

String om::images::base::PixelFormat::toString ( ) const

Return a string representation of the pixel format.

om::images::base::PixelFormat::operator String ( ) const
inline

Convert this pixel format into a string representation.

Member Data Documentation

const PixelFormat om::images::base::PixelFormat::UNDEFINED
static

An undefined pixel format.

const PixelFormat om::images::base::PixelFormat::RGB8
static

An RGB pixel format with 8 bits per component.

const PixelFormat om::images::base::PixelFormat::RGB16
static

An RGB pixel format with 16 bits per component.

const PixelFormat om::images::base::PixelFormat::RGB16F
static

An RGB pixel format with 16 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::RGB32F
static

An RGB pixel format with 32 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::RGBA8
static

An RGBA pixel format with 8 bits per component.

const PixelFormat om::images::base::PixelFormat::RGBA16
static

An RGBA pixel format with 16 bits per component.

const PixelFormat om::images::base::PixelFormat::RGBA16F
static

An RGBA pixel format with 16 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::RGBA32F
static

An RGBA pixel format with 32 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY8
static

A 1-channel pixel format with 8 bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY16
static

A 1-channel pixel format with 16 bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY16F
static

A 1-channel pixel format with 16 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY32F
static

A 1-channel pixel format with 32 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY_ALPHA8
static

A 2-channel pixel format with 8 bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY_ALPHA16
static

A 2-channel pixel format with 16 bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY_ALPHA16F
static

A 2-channel pixel format with 16 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::GRAY_ALPHA32F
static

A 2-channel pixel format with 32 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::CMYK8
static

An CMYK pixel format with 8 bits per component.

const PixelFormat om::images::base::PixelFormat::CMYK16
static

An CMYK pixel format with 16 bits per component.

const PixelFormat om::images::base::PixelFormat::CMYK16F
static

An CMYK pixel format with 16 floating-point bits per component.

const PixelFormat om::images::base::PixelFormat::CMYK32F
static

An CMYK pixel format with 32 floating-point bits per component.


The documentation for this class was generated from the following file: