- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Attributes

# PixelDescriptor Class Reference

This reference page is linked to from the following overview topics: Images.

Search for all occurrences

## Detailed Description

Describe an image pixel; how to interpret a piece of pixel data.

Note:
  The internal format preferred by MudBox is always PreMultiplied.

When you provide image data to these Image classes, it will be converted to the preferred internal representation as specified above. When image data is queried, it will almost always be returned in the preferred internal channel ordering, and will always be returned PreMultiplied.

Definition at line 1255 of file image.h.

`#include <image.h>`

Inheritance diagram for PixelDescriptor:
[legend]

List of all members.

## Public Types
enum | ChannelType { uChar = 0, uShort = 1, sHalf = 2, sFloat = 3, sChar = 4, sShort = 5, uInt = 6, sInt = 7, sDouble = 8 }
| Describe the data type of a single channel of a pixel. More...
enum | MemoryChannelOrder { orderNONE = 0, orderRGBA = 1, orderABGR = 2, orderBGRA = 3, orderARGB = 4, orderRGB = 5, orderBGR = 6 }
| Describe channel ordering for 4 channel images -- these are the order of the channels in memory, not in registers or uInts. More...
## Public Member Functions
| PixelDescriptor (char cCount, ChannelType channelType, MemoryChannelOrder channelOrder, bool PreMultiplied)
int | channelSize () const
| return the size of a pixel channel in bytes
int | channelBitSize () const
| return the size of a pixel channel in bits
int | pixelSize () const
| return the size of a pixel in bytes
int | pixelBitSize () const
| return the size of a pixel in bits
ChannelType | channelType () const
| Get the channel type of the image/pixel.
MemoryChannelOrder | channelOrder () const
| Get the channel ordering of the image/pixel.
bool | premultiplied () const
| returns true if the RGB values are premultiplied by the A values, false otherwise.
int | channelCount () const
| return the number of channels -- 1, 2, 3, or 4
void | setChannelCount (int c)
| set the number of channels -- 1, 2, 3, or 4
bool | operator== (const PixelDescriptor &pd) const
| returns true if the pixel descriptors are equal
## Protected Attributes
char | m_cCount
| number of channels in the image -- 1, 3, or 4
ChannelType | m_channelType
| Channel type.
MemoryChannelOrder | m_channelOrder
| channel ordering
bool | m_PreMultiplied
| true if RGB is premultiplied by A

## Member Enumeration Documentation

enum ChannelType

Search for all occurrences

Describe the data type of a single channel of a pixel.

Enumerator:

  uChar | unsigned 8 bit char Search for all occurrences
  uShort | unsigned 16 bit short. Search for all occurrences
  sHalf | S10E5 half precision floating point. Search for all occurrences
  sFloat | IEEE754 single precision. Search for all occurrences
  sChar | signed 8 bit char (not currently supported) Search for all occurrences
  sShort | signed 16 bit short (not currently supported) Search for all occurrences
  uInt | unsigned 32 bit int (not currently supported) Search for all occurrences
  sInt | signed 32 bit int (not currently supported) Search for all occurrences
  sDouble | IEEE754 double precision (not currently supported) Search for all occurrences

Definition at line 1258 of file image.h.

                     {
            uChar   = 0,
            uShort  = 1,
            sHalf   = 2,
            sFloat  = 3,
            sChar   = 4,
            sShort  = 5,
            uInt    = 6,
            sInt    = 7,
            sDouble = 8
        } ChannelType;

enum MemoryChannelOrder

Search for all occurrences

Describe channel ordering for 4 channel images -- these are the order of the channels in memory, not in registers or uInts.

Enumerator:

  orderNONE | This is invalid for 4 channel images -- used for 1 channel. Search for all occurrences
  orderRGBA | standard RGBA Search for all occurrences
  orderABGR | reverse of RGBA Search for all occurrences
  orderBGRA | Optimal ordering on windows & Mac. Search for all occurrences
  orderARGB | Reverse of BGRA. Search for all occurrences
  orderRGB | RGB -- for 3 channel images. Search for all occurrences
  orderBGR | Reverse of RGB for 3 channel images. Search for all occurrences

Definition at line 1273 of file image.h.

                     {
            orderNONE = 0,
            orderRGBA = 1,
            orderABGR = 2,
            orderBGRA = 3,
            orderARGB = 4,
            orderRGB  = 5,
            orderBGR  = 6
        } MemoryChannelOrder;

## Constructor & Destructor Documentation

PixelDescriptor | ( | char | cCount,
|  | ChannelType | channelType,
|  | MemoryChannelOrder | channelOrder,
|  | bool | PreMultiplied
| ) |  | `[inline]`

Definition at line 1292 of file image.h.

            : m_cCount       (cCount)
            , m_channelType  (channelType)
            , m_channelOrder (channelOrder)
            , m_PreMultiplied(PreMultiplied) {}

## Member Function Documentation

int channelSize | ( |  | ) | const `[inline]`

Search for all occurrences

return the size of a pixel channel in bytes

Definition at line 1302 of file image.h.

                                {
            static const unsigned char s_channelByteCount[] = {1, 2, 2, 4, 1, 2, 4, 4, 8};
            return s_channelByteCount[m_channelType];
        }

int channelBitSize | ( |  | ) | const `[inline]`

Search for all occurrences

return the size of a pixel channel in bits

Definition at line 1308 of file image.h.

                                   {
            return channelSize() * 8;
        }

int pixelSize | ( |  | ) | const `[inline]`

Search for all occurrences

return the size of a pixel in bytes

Definition at line 1313 of file image.h.

                              {
            return channelSize() * m_cCount;
        }

int pixelBitSize | ( |  | ) | const `[inline]`

Search for all occurrences

return the size of a pixel in bits

Definition at line 1318 of file image.h.

                                 {
            return pixelSize() * 8;
        }

ChannelType channelType | ( |  | ) | const `[inline]`

Search for all occurrences

Get the channel type of the image/pixel.

Definition at line 1323 of file image.h.

    { return m_channelType; }

MemoryChannelOrder channelOrder | ( |  | ) | const `[inline]`

Search for all occurrences

Get the channel ordering of the image/pixel.

Definition at line 1326 of file image.h.

    { return m_channelOrder; }

bool premultiplied | ( |  | ) | const `[inline]`

Search for all occurrences

returns true if the RGB values are premultiplied by the A values, false otherwise.

Default is true...

Definition at line 1330 of file image.h.

    { return m_PreMultiplied; }

int channelCount | ( |  | ) | const `[inline]`

Search for all occurrences

return the number of channels -- 1, 2, 3, or 4

Definition at line 1333 of file image.h.

    { return m_cCount; }

void setChannelCount | ( | int | c | ) | `[inline]`

Search for all occurrences

set the number of channels -- 1, 2, 3, or 4

Definition at line 1336 of file image.h.

    { m_cCount = c; }

bool operator== | ( | const PixelDescriptor & | pd | ) | const `[inline]`

returns true if the pixel descriptors are equal

Definition at line 1339 of file image.h.

        { return (m_cCount         == pd.m_cCount        &&
                  m_channelType    == pd.m_channelType   &&
                  m_channelOrder   == pd.m_channelOrder  &&
                  m_PreMultiplied  == pd.m_PreMultiplied);
        }

## Member Data Documentation

char m_cCount `[protected]`

Search for all occurrences

number of channels in the image -- 1, 3, or 4

Definition at line 1284 of file image.h.

ChannelType m_channelType `[protected]`

Search for all occurrences

Channel type.

Definition at line 1285 of file image.h.

MemoryChannelOrder m_channelOrder `[protected]`

Search for all occurrences

channel ordering

Definition at line 1286 of file image.h.

bool m_PreMultiplied `[protected]`

Search for all occurrences

true if RGB is premultiplied by A

Definition at line 1287 of file image.h.

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

- Mudbox/image.h

PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor
PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor PixelDescriptor