Container and properties for an image pixel. More...
#include <spatmod/imagepixel.h>
Public Types | |
| enum | TYPE { TYPE_Invalid = 0x0000, TYPE_Single = 0x0101, TYPE_Multiple = 0x0200, TYPE_Grayscale = 0x0301, TYPE_GrayscaleAlpha = 0x8302, TYPE_Indexed = 0x0401, TYPE_RGB = 0x0503, TYPE_RGBA = 0x8504, TYPE_CMY = 0x0603, TYPE_CMYA = 0x8604, TYPE_CMYK = 0x0704, TYPE_CMYKA = 0x8705, TYPE_ComplexMP = 0x0802, TYPE_ComplexRI = 0x0902, TYPE_IHS = 0x0A03, TYPE_IHSA = 0x8A04, TYPE_BHS = 0x0B03, TYPE_BHSA = 0x8B04, TYPE_HSV = 0x0C03, TYPE_HSVA = 0x8C04, TYPE_Opacity = 0x8001, TYPE_MASK_NumSamples = 0x00FF, TYPE_MASK_Alpha = 0x8000 } |
Public Member Functions | |
| PIXEL (const PIXEL &rhs) | |
| PIXEL (UINT16 NumSamples, const SAMPLE *samples, TYPE PixelType=TYPE_Invalid) | |
| PIXEL (TYPE PixelType, DATATYPE DataType, UINT16 NumSamples=0) | |
| PIXEL () | |
| ~PIXEL () | |
| void | Exchange (PIXEL &other) |
| DATATYPE | GetDataType () const |
| UINT32 | GetNumBytes () const |
| UINT16 | GetNumSamples () const |
| TYPE | GetPixelType () const |
| SAMPLE & | GetSample (UINT16 index) |
| const SAMPLE & | GetSample (UINT16 index) const |
| SAMPLE * | GetSamples () |
| const SAMPLE * | GetSamples () const |
| bool | HasAlpha () const |
| bool | IsEqual (const PIXEL &rhs) const |
| bool | IsSameType (const PIXEL &rhs) const |
| PIXEL & | operator= (const PIXEL &rhs) |
| void | SetSample (UINT16 index, const SAMPLE &Sample) |
| ERRVALUE | SetType (TYPE PixelType) |
| void | SetValueMaximum () |
| void | SetValueMinimum () |
Container and properties for an image pixel.
A pixel is represented by a PIXEL::TYPE and a set of SAMPLEs.
| TYPE_Invalid | |
| TYPE_Single |
Single sample, any type not listed below. |
| TYPE_Multiple |
Multiple samples of combination not listed below. |
| TYPE_Grayscale |
Single sample of SAMPLE::TYPE_Gray. |
| TYPE_GrayscaleAlpha |
2 samples: TYPE_Grayscale, Type_Opacity |
| TYPE_Indexed |
Single sample of SAMPLE::TYPE_Index. |
| TYPE_RGB |
3 samples: TYPE_Red, TYPE_Green, TYPE_Blue |
| TYPE_RGBA |
4 samples: TYPE_Red, TYPE_Green, TYPE_Blue, TYPE_Opacity |
| TYPE_CMY |
3 samples: TYPE_Cyan, TYPE_Magenta, TYPE_Yellow |
| TYPE_CMYA |
4 samples: TYPE_Cyan, TYPE_Magenta, TYPE_Yellow, TYPE_Opacity |
| TYPE_CMYK |
4 samples: TYPE_Cyan, TYPE_Magenta, TYPE_Yellow, TYPE_Black |
| TYPE_CMYKA |
5 samples: TYPE_Cyan, TYPE_Magenta, TYPE_Yellow, TYPE_Black, TYPE_Opacity |
| TYPE_ComplexMP |
2 samples: TYPE_ComplexMagnitude, TYPE_ComplexPhase |
| TYPE_ComplexRI |
2 samples: TYPE_ComplexReal, TYPE_ComplexImaginary |
| TYPE_IHS |
3 samples: TYPE_Gray (intensity), TYPE_Hue, TYPE_Saturation |
| TYPE_IHSA |
4 samples: TYPE_Gray (intensity), TYPE_Hue, TYPE_Saturation, TYPE_Opacity |
| TYPE_BHS |
3 samples: TYPE_Gray (brightness), TYPE_Hue, TYPE_Saturation |
| TYPE_BHSA |
4 samples: TYPE_Gray (brightness), TYPE_Hue, TYPE_Saturation, TYPE_Opacity |
| TYPE_HSV |
3 samples: TYPE_Hue, TYPE_Saturation, TYPE_Gray (value) |
| TYPE_HSVA |
4 samples: TYPE_Hue, TYPE_Saturation, TYPE_Gray (value), TYPE_Opacity |
| TYPE_Opacity |
Single sample of SAMPLE::TYPE_Opacity. |
| TYPE_MASK_NumSamples | |
| TYPE_MASK_Alpha |
Alpha (opacity) included as last sample in pixel. |
| SPATMOD::IMAGE::PIXEL::PIXEL | ( | ) |
Default constructor, create pixel with TYPE_Invalid and no samples.
Construct pixel of specified type with all samples same DATATYPE.
| PixelType | Pixel type | |
| DataType | Sample data type | |
| NumSamples | Number of samples, only used if cannot determine from PixelType |
| SPATMOD::IMAGE::PIXEL::PIXEL | ( | UINT16 | NumSamples, | |
| const SAMPLE * | samples, | |||
| TYPE | PixelType = TYPE_Invalid | |||
| ) |
Construct pixel from specified samples.
If PixelType not specified will be determined from sample types.
| NumSamples | Number of samples | |
| samples | Sample array | |
| PixelType | Pixel type |
| SPATMOD::IMAGE::PIXEL::PIXEL | ( | const PIXEL & | rhs | ) |
Copy constructor.
| SPATMOD::IMAGE::PIXEL::~PIXEL | ( | ) |
Destructor.
| void SPATMOD::IMAGE::PIXEL::Exchange | ( | PIXEL & | other | ) |
Exchange with another pixel.
| other | Pixel to exchange with |
| DATATYPE SPATMOD::IMAGE::PIXEL::GetDataType | ( | ) | const |
Get data type of samples.
| UINT32 SPATMOD::IMAGE::PIXEL::GetNumBytes | ( | ) | const |
Get size of single pixel in bytes.
| UINT16 SPATMOD::IMAGE::PIXEL::GetNumSamples | ( | ) | const [inline] |
Get number of samples.
| TYPE SPATMOD::IMAGE::PIXEL::GetPixelType | ( | ) | const [inline] |
Get pixel type.
Get reference to specified sample.
| index | Sample index |
Get reference to specified sample (const).
| index | Sample index |
| SAMPLE* SPATMOD::IMAGE::PIXEL::GetSamples | ( | ) | [inline] |
Get array of SAMPLEs.
| const SAMPLE* SPATMOD::IMAGE::PIXEL::GetSamples | ( | ) | const [inline] |
Get array of SAMPLEs (const).
| bool SPATMOD::IMAGE::PIXEL::HasAlpha | ( | ) | const [inline] |
Determine if alpha band is present based on pixel type.
| bool SPATMOD::IMAGE::PIXEL::IsEqual | ( | const PIXEL & | rhs | ) | const |
Compare pixels for equality of pixel type and all samples.
| bool SPATMOD::IMAGE::PIXEL::IsSameType | ( | const PIXEL & | rhs | ) | const |
Compare pixels for equality of pixel type and all samples (type, datatype, precision).
Does not compare sample values.
Set sample.
| Sample | Sample index Sample value |
Set pixel type.
Specified type must be appropriate for number of samples. Sample types will be changed if required.
| PixelType | New pixel type |
| void SPATMOD::IMAGE::PIXEL::SetValueMaximum | ( | ) |
Set all sample values to maximum.
| void SPATMOD::IMAGE::PIXEL::SetValueMinimum | ( | ) |
Set all sample values to minimum.
1.6.1