Class wrapping all pixel related information together. More...
#include <PixelData.hpp>
Public Member Functions | |
PixelData () | |
Default constructor. More... | |
PixelData (ValueType format, ColorSpace colorSpace, cmsHPROFILE profile=0) | |
A constructor. More... | |
PixelData (ValueType format, unsigned int usedBits, int numOfBands, ColorSpace colorSpace, cmsHPROFILE profile=0) | |
void | colorSpace (ColorSpace cspace) |
Set the color space. More... | |
const ColorSpace & | colorSpace () const |
Color space of an image. More... | |
void | format (ValueType format) |
Set data type used for storing pixel data. More... | |
ValueType | format () const |
Data type used for storing pixel data. More... | |
void | usedBits (unsigned int usedBits) |
Set the number of used bits. More... | |
unsigned int | usedBits () const |
The number of bits really used. More... | |
void | numOfBands (int numOfBands) |
Set the number of bands (channels). More... | |
int | numOfBands () const |
The number of bands present in image. More... | |
cmsUInt32Number | cmsFormatter () const |
LittleCMS 2 formatter. More... | |
void | cmsProfile (cmsHPROFILE profile) |
Set the LittleCMS 2 profile. More... | |
cmsHPROFILE | cmsProfile () const |
Return the LittleCMS 2 profile. More... | |
xmlNodePtr | serialize () const |
Static Public Member Functions | |
static PixelData | deserialize (const xmlNodePtr value) |
Class wrapping all pixel related information together.
PixelData class stores all necessary information about pixels in the image at one place.
It is also used to determine supported buffer formats for an operation.
FotoSHOCKcore::PixelData::PixelData | ( | ) |
Default constructor.
Creates a PixelData object with the following properties:
FotoSHOCKcore::PixelData::PixelData | ( | ValueType | format, |
ColorSpace | colorSpace, | ||
cmsHPROFILE | profile = 0 |
||
) |
A constructor.
Creates a PixelData object with the specified properties. The properties that are not set by this constructor are set to the default value derived from the passed options.
format | the underlying data type which is used to store pixel values (see ValueTypeEnum for supported formats) |
colorSpace | color space |
profile | LittleCMS 2 profile. Default value constructs sRGB profile. This is usefull especially when the colorSpace is "RGB", as it's exact behaviour depends on the profile. |
cmsUInt32Number FotoSHOCKcore::PixelData::cmsFormatter | ( | ) | const |
LittleCMS 2 formatter.
void FotoSHOCKcore::PixelData::cmsProfile | ( | cmsHPROFILE | profile) |
Set the LittleCMS 2 profile.
Set the LittleCMS 2 profile. This is usefull especially when RGB is used, because the RGB specifics depends on the profile.
Profiles are closed automatically when they are not needed anymore.
profile | profile to use. If profile is 0, sRGB profile is used |
cmsHPROFILE FotoSHOCKcore::PixelData::cmsProfile | ( | ) | const |
Return the LittleCMS 2 profile.
void FotoSHOCKcore::PixelData::colorSpace | ( | ColorSpace | cspace) |
Set the color space.
cspace | colorspace. "ANY" and "SAME" can be used only to determine the allowed input/output formats in an ImageOperationDescriptor. The meaning is simillar to the PixelFormat::pixel_ANY and PixelFormat::pixel_SAME |
const ColorSpace & FotoSHOCKcore::PixelData::colorSpace | ( | ) | const |
Color space of an image.
If the pixel has more bands that the colorspace channels, only the first bands are considered. If the pixel doesn't have enough bands, the behavior is undefined.
"ANY" and "SAME" can be used only to determine the allowed input/output formats in an ImageOperationDescriptor. The meaning is simillar to the PixelFormat::pixel_ANY and PixelFormat::pixel_SAME
void FotoSHOCKcore::PixelData::format | ( | ValueType | format) |
Set data type used for storing pixel data.
The type is the same for all bands.
format | format defining the underlying data type for storing pixel values in an image. |
ValueType FotoSHOCKcore::PixelData::format | ( | ) | const |
Data type used for storing pixel data.
void FotoSHOCKcore::PixelData::numOfBands | ( | int | numOfBands) |
Set the number of bands (channels).
numOfBands | number of channels. Values 0 and -1 have special meaning. They are used when specifying the supported formats in an ImageOperationDescriptor. The meaning is following:
|
int FotoSHOCKcore::PixelData::numOfBands | ( | ) | const |
The number of bands present in image.
Specifies how many channels (bands) the image has.
Values 0 and -1 have special meaning. They are used when specifying the supported formats in an image operation. The meaning is following:
void FotoSHOCKcore::PixelData::usedBits | ( | unsigned int | usedBits) |
Set the number of used bits.
This function can be used to specify that only a part of the possible precision for a given PixelFormat is used. Eg. you can use it to tell the application that the data uses only 10 bits of precision, even though they are stored using 16 bits. This is usefull when creating lookup tables (because while 10bit lookup table is viable, but 16bit LUT may be too to be used effectively)
usedBits | number of bits, that are really used |
unsigned int FotoSHOCKcore::PixelData::usedBits | ( | ) | const |
The number of bits really used.
Specifies how precise the numbers are. Eg. you can define that you use 10bit data even when format is 16bit. With this knowledge it's possible to construct Lookup tables etc.