This reference page is linked to from the following overview topics: Images.
Describe an image pixel; how to interpret a piece of pixel data.
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.
#include <image.h>
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 |
|
| enum ChannelType |
Describe the data type of a single channel of a pixel.
| enum MemoryChannelOrder |
Describe channel ordering for 4 channel images -- these are the order of the channels in memory, not in registers or uInts.
| 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) {}
| int channelSize | ( | ) | const [inline] |
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] |
return the size of a pixel channel in bits
Definition at line 1308 of file image.h.
{
return channelSize() * 8;
}
| int pixelSize | ( | ) | const [inline] |
return the size of a pixel in bytes
Definition at line 1313 of file image.h.
{
return channelSize() * m_cCount;
}
| int pixelBitSize | ( | ) | const [inline] |
| ChannelType channelType | ( | ) | const [inline] |
Get the channel type of the image/pixel.
Definition at line 1323 of file image.h.
{ return m_channelType; }
| MemoryChannelOrder channelOrder | ( | ) | const [inline] |
Get the channel ordering of the image/pixel.
Definition at line 1326 of file image.h.
{ return m_channelOrder; }
| bool premultiplied | ( | ) | const [inline] |
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] |
| void setChannelCount | ( | int | c | ) | [inline] |
| 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);
}
char
m_cCount [protected] |
number of channels in the image -- 1, 3, or 4
ChannelType
m_channelType [protected] |
MemoryChannelOrder
m_channelOrder [protected] |
bool
m_PreMultiplied [protected] |
true if RGB is premultiplied by A