This reference page is linked to from the following overview topics: Images.
Describe an image, specifically how to interpret pixel data.
This class derives from PixelDescriptor and adds a bounding rectangle and spatial resolution.
#include <image.h>
Public Types |
|
enum | ResUnit { k_PixelsPerInch = 1, k_PixelsPerCentimeter = 2 } |
Resolution units (mainly used so resolution is preserved in PSD & TIFF files) More... |
|
Public Member Functions |
|
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... |
|
ImageDescriptor (int nx, int ny, MemoryChannelOrder order=orderRGBA, bool premult=true, char nc=4, ChannelType ct=uChar) | |
Constructor -- make a descriptor... |
|
ImageDescriptor () | |
default constructor -- RGBA, premult, 4
channel uChar, size 0 x 0 pixels. |
|
int | numBytes () const |
return the number of bytes the raw image
pixels will occupy -- not necessarily accurate for VirtualImages
|
|
int | strideBytes () const |
return the number of bytes wide that the
image is |
|
int | xSize () const |
return the x Size of the image |
|
int | ySize () const |
return the y Size of the image |
|
int | cSize () const |
return the channel count of the image
|
|
bool | sizeEqual (const ImageDescriptor &o) const |
return true if the x and y dimensions are
equal |
|
void | setSize (int nx, int ny) |
Set the size of the image in pixels.
|
|
const ImgTile & | getBounds () const |
return the bounds of the image |
|
void | getResolutionInfo (float &xRes, float &yRes, ResUnit &unit) const |
return the horizontal and vertical
resolution of the image |
|
void | setResolutionInfo (float xRes, float yRes, ResUnit unit) |
set the horizontal and vertical resolution
of the image |
|
Protected Attributes |
|
ImgTile | m_Bounds |
Bounds of the image -- some images may not
have a 0,0 origin. |
|
float | m_xResolution |
horizontal resolution in pixels per unit
|
|
float | m_yResolution |
vertical resolution in pixels per unit
|
|
ResUnit | m_ResolutionUnits |
units -- 1 == inch, 2 == centimeter (same as
in PSD files) |
|
Friends |
|
class | Image |
enum ResUnit |
Resolution units (mainly used so resolution is preserved in PSD & TIFF files)
Definition at line 1166 of file image.h.
{ k_PixelsPerInch = 1, k_PixelsPerCentimeter = 2 };
ImageDescriptor | ( | int | x, |
int | y, | ||
int | nx, | ||
int | ny, | ||
MemoryChannelOrder | order = orderRGBA , |
||
bool | premult = true , |
||
char | nc = 4 , |
||
ChannelType | ct = uChar |
||
) | [inline] |
Constructor -- make a descriptor...
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 1191 of file image.h.
: PixelDescriptor(nc, ct, order, premult), m_Bounds(x, y, nx, ny), m_xResolution(100.0f), m_yResolution(100.0f), m_ResolutionUnits(k_PixelsPerInch) {}
ImageDescriptor | ( | int | nx, |
int | ny, | ||
MemoryChannelOrder | order = orderRGBA , |
||
bool | premult = true , |
||
char | nc = 4 , |
||
ChannelType | ct = uChar |
||
) | [inline] |
Constructor -- make a descriptor...
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 1210 of file image.h.
: PixelDescriptor(nc, ct, order, premult), m_Bounds(0, 0, nx, ny) {}
ImageDescriptor | ( | ) | [inline] |
int numBytes | ( | ) | const [inline] |
int strideBytes | ( | ) | const [inline] |
return the number of bytes wide that the image is
int xSize | ( | ) | const [inline] |
int ySize | ( | ) | const [inline] |
int cSize | ( | ) | const [inline] |
bool sizeEqual | ( | const ImageDescriptor & | o | ) | const [inline] |
return true if the x and y dimensions are equal
o | the other descriptor to compare against. |
void setSize | ( | int | nx, |
int | ny | ||
) | [inline] |
Set the size of the image in pixels.
const ImgTile& getBounds | ( | ) | const [inline] |
void getResolutionInfo | ( | float & | xRes, |
float & | yRes, | ||
ResUnit & | unit | ||
) | const [inline] |
return the horizontal and vertical resolution of the image
xRes | returned X Resolution in Pixels per unit |
yRes | returned y Resolution in Pixels per unit |
unit | returned resolution unit |
Definition at line 1256 of file image.h.
{ xRes = m_xResolution; yRes = m_yResolution, unit = m_ResolutionUnits; }
void setResolutionInfo | ( | float | xRes, |
float | yRes, | ||
ResUnit | unit | ||
) | [inline] |
set the horizontal and vertical resolution of the image
xRes | new X Resolution in Pixels per unit |
yRes | new y Resolution in Pixels per unit |
unit | new resolution unit |
Definition at line 1267 of file image.h.
{ m_xResolution = xRes; m_yResolution = yRes, m_ResolutionUnits = unit; }
friend class Image [friend] |
Bounds of the image -- some images may not have a 0,0 origin.
float
m_xResolution [protected] |
horizontal resolution in pixels per unit
float
m_yResolution [protected] |
vertical resolution in pixels per unit
ResUnit
m_ResolutionUnits [protected] |
units -- 1 == inch, 2 == centimeter (same as in PSD files)