ImageDescriptor Class Reference
#include <image.h>
Describe an image, specifically how to interpret pixel data.
This class derives from PixelDescriptor and adds a bounding rectangle and spatial resolution.
Definition at line 1353 of file image.h.
|
| enum | ResUnit { k_PixelsPerInch = 1,
k_PixelsPerCentimeter = 2
} |
| | Resolution units (mainly used so resolution is preserved in PSD & TIFF files) More...
|
| |
| 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...
|
| |
|
| | ImageDescriptor (int x, int y, int nx, int ny, MemoryChannelOrder order=orderRGBA, bool premult=true, char nc=4, ChannelType ct=uChar) |
| | Constructor – make a descriptor... More...
|
| |
| | ImageDescriptor (int nx, int ny, MemoryChannelOrder order=orderRGBA, bool premult=true, char nc=4, ChannelType ct=uChar) |
| | Constructor – make a descriptor... More...
|
| |
| | ImageDescriptor () |
| | default constructor – RGBA, premult, 4 channel uChar, size 0 x 0 pixels. More...
|
| |
| int | numBytes () const |
| | return the number of bytes the raw image pixels will occupy – not necessarily accurate for VirtualImages More...
|
| |
| int | strideBytes () const |
| | return the number of bytes wide that the image is More...
|
| |
| int | xSize () const |
| | return the x Size of the image More...
|
| |
| int | ySize () const |
| | return the y Size of the image More...
|
| |
| int | cSize () const |
| | return the channel count of the image More...
|
| |
| bool | sizeEqual (const ImageDescriptor &o) const |
| | return true if the x and y dimensions are equal More...
|
| |
| void | setSize (int nx, int ny) |
| | Set the size of the image in pixels. More...
|
| |
| const ImgTile & | getBounds () const |
| | return the bounds of the image More...
|
| |
| void | getResolutionInfo (float &xRes, float &yRes, ResUnit &unit) const |
| | return the horizontal and vertical resolution of the image More...
|
| |
| void | setResolutionInfo (float xRes, float yRes, ResUnit unit) |
| | set the horizontal and vertical resolution of the image More...
|
| |
| | PixelDescriptor (char cCount, ChannelType channelType, MemoryChannelOrder channelOrder, bool PreMultiplied) |
| |
| int | channelSize () const |
| | return the size of a pixel channel in bytes More...
|
| |
| int | channelBitSize () const |
| | return the size of a pixel channel in bits More...
|
| |
| int | pixelSize () const |
| | return the size of a pixel in bytes More...
|
| |
| int | pixelBitSize () const |
| | return the size of a pixel in bits More...
|
| |
| ChannelType | channelType () const |
| | Get the channel type of the image/pixel. More...
|
| |
| MemoryChannelOrder | channelOrder () const |
| | Get the channel ordering of the image/pixel. More...
|
| |
| bool | premultiplied () const |
| | returns true if the RGB values are premultiplied by the A values, false otherwise. More...
|
| |
| int | channelCount () const |
| | return the number of channels – 1, 2, 3, or 4 More...
|
| |
| void | setChannelCount (int c) |
| | set the number of channels – 1, 2, 3, or 4 More...
|
| |
| bool | operator== (const PixelDescriptor &pd) const |
| | returns true if the pixel descriptors are equal More...
|
| |
Resolution units (mainly used so resolution is preserved in PSD & TIFF files)
| Enumerator |
|---|
| k_PixelsPerInch |
pixels per inch
|
| k_PixelsPerCentimeter |
pixels per centimeter
|
Definition at line 1357 of file image.h.
Constructor – make a descriptor...
- Parameters
-
| x | x origin of the image |
| y | y origin of the image |
| nx | xSize of the image |
| ny | ySize of the image |
| order | channel ordering of the image |
| premult | Are the RGB channels premultiplied by the A? |
| nc | number of channels – currently only 4 is supported |
| ct | data type of the channels – currently only uChar is supported. |
Definition at line 1382 of file image.h.
PixelDescriptor(char cCount, ChannelType channelType, MemoryChannelOrder channelOrder, bool PreMultiplied)
GLfloat GLfloat GLfloat GLfloat nx
ResUnit m_ResolutionUnits
units – 1 == inch, 2 == centimeter (same as in PSD files)
float m_xResolution
horizontal resolution in pixels per unit
float m_yResolution
vertical resolution in pixels per unit
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
Constructor – make a descriptor...
- Parameters
-
| nx | xSize of the image |
| ny | ySize of the image |
| order | channel ordering of the image |
| premult | Are the RGB channels premultiplied by the A? |
| nc | number of channels – currently only 4 is supported |
| ct | data type of the channels – currently only uChar is supported. |
Definition at line 1401 of file image.h.
PixelDescriptor(char cCount, ChannelType channelType, MemoryChannelOrder channelOrder, bool PreMultiplied)
GLfloat GLfloat GLfloat GLfloat nx
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
default constructor – RGBA, premult, 4 channel uChar, size 0 x 0 pixels.
Definition at line 1409 of file image.h.
PixelDescriptor(char cCount, ChannelType channelType, MemoryChannelOrder channelOrder, bool PreMultiplied)
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
return the number of bytes the raw image pixels will occupy – not necessarily accurate for VirtualImages
Definition at line 1415 of file image.h.
int nx
x size of the tile (width)
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
int ny
y size of the tile (height)
int pixelSize() const
return the size of a pixel in bytes
| int strideBytes |
( |
| ) |
const |
|
inline |
return the number of bytes wide that the image is
Definition at line 1418 of file image.h.
int nx
x size of the tile (width)
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
int pixelSize() const
return the size of a pixel in bytes
return the x Size of the image
Definition at line 1421 of file image.h.
int nx
x size of the tile (width)
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
return the y Size of the image
Definition at line 1424 of file image.h.
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
int ny
y size of the tile (height)
return the channel count of the image
Definition at line 1427 of file image.h.
char m_cCount
number of channels in the image – 1, 3, or 4
return true if the x and y dimensions are equal
- Parameters
-
| o | the other descriptor to compare against. |
Definition at line 1432 of file image.h.
1433 {
return ((
xSize() == o.xSize()) && (
ySize() == o.ySize())); }
int ySize() const
return the y Size of the image
int xSize() const
return the x Size of the image
Set the size of the image in pixels.
Definition at line 1436 of file image.h.
int nx
x size of the tile (width)
GLfloat GLfloat GLfloat GLfloat nx
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
int ny
y size of the tile (height)
return the bounds of the image
Definition at line 1439 of file image.h.
ImgTile m_Bounds
Bounds of the image – some images may not have a 0,0 origin.
| void getResolutionInfo |
( |
float & |
xRes, |
|
|
float & |
yRes, |
|
|
ResUnit & |
unit |
|
) |
| const |
|
inline |
return the horizontal and vertical resolution of the image
- Parameters
-
| xRes | returned X Resolution in Pixels per unit |
| yRes | returned y Resolution in Pixels per unit |
| unit | returned resolution unit |
Definition at line 1447 of file image.h.
ResUnit m_ResolutionUnits
units – 1 == inch, 2 == centimeter (same as in PSD files)
float m_xResolution
horizontal resolution in pixels per unit
float m_yResolution
vertical resolution in pixels per unit
| void setResolutionInfo |
( |
float |
xRes, |
|
|
float |
yRes, |
|
|
ResUnit |
unit |
|
) |
| |
|
inline |
set the horizontal and vertical resolution of the image
- Parameters
-
| xRes | new X Resolution in Pixels per unit |
| yRes | new y Resolution in Pixels per unit |
| unit | new resolution unit |
Definition at line 1458 of file image.h.
ResUnit m_ResolutionUnits
units – 1 == inch, 2 == centimeter (same as in PSD files)
float m_xResolution
horizontal resolution in pixels per unit
float m_yResolution
vertical resolution in pixels per unit
Bounds of the image – some images may not have a 0,0 origin.
Definition at line 1362 of file image.h.
horizontal resolution in pixels per unit
Definition at line 1364 of file image.h.
vertical resolution in pixels per unit
Definition at line 1365 of file image.h.
units – 1 == inch, 2 == centimeter (same as in PSD files)
Definition at line 1366 of file image.h.
The documentation for this class was generated from the following file: