Define properties of a single sample. More...
#include <spatmod/imagesample.h>
Define properties of a single sample.
Properties include sample type, data type, value and optional precision. A sample may be attached to an external data buffer for accessing values. A set of one or more SAMPLE instances is used to represent a PIXEL.
Enumeration of what a sample represents.
| SPATMOD::IMAGE::SAMPLE::SAMPLE | ( | ) |
Default constructor.
| SPATMOD::IMAGE::SAMPLE::SAMPLE | ( | const SAMPLE & | rhs | ) |
Copy constructor.
Construct sample with specified properties.
| SampleType | Sample type | |
| DataType | Data type | |
| pValue | Optional pointer to initial sample value |
| SPATMOD::IMAGE::SAMPLE::~SAMPLE | ( | ) |
Destructor.
| int SPATMOD::IMAGE::SAMPLE::CompareValues | ( | const SAMPLE & | rhs | ) | const |
Compare sample values.
Handles all appropriate data type conversions.
| rhs | Sample to compare to |
| void SPATMOD::IMAGE::SAMPLE::Exchange | ( | SAMPLE & | other | ) |
Exchange data with another SAMPLE.
| other | Sample to exchange with |
| DATATYPE SPATMOD::IMAGE::SAMPLE::GetDataType | ( | ) | const [inline] |
Get DATATYPE of sample.
| UINT32 SPATMOD::IMAGE::SAMPLE::GetNumBytes | ( | ) | const [inline] |
Get number of bytes in sample.
| UINT16 SPATMOD::IMAGE::SAMPLE::GetPrecision | ( | ) | const [inline] |
Get precision of sample.
| TYPE SPATMOD::IMAGE::SAMPLE::GetType | ( | ) | const [inline] |
Get SAMPLE::TYPE of sample.
| double SPATMOD::IMAGE::SAMPLE::GetValueDouble | ( | ) | const |
Get value as double.
Conversion is done by casting, may lose precision for 64-bit integer values.
| INT32 SPATMOD::IMAGE::SAMPLE::GetValueINT32 | ( | ) | const |
Get value as INT32.
Conversion is done by casting, may overflow for out of range values.
| const void* SPATMOD::IMAGE::SAMPLE::GetValuePtr | ( | ) | const [inline] |
Get pointer to sample's value.
Caller must cast returned pointer to appropriate type before using.
| bool SPATMOD::IMAGE::SAMPLE::IsEqual | ( | const SAMPLE & | rhs | ) | const |
Compare samples for equality of sample type, data type and value.
| void SPATMOD::IMAGE::SAMPLE::SetDataType | ( | DATATYPE | DataType | ) |
Set data type of sample.
Value will be reset to 0 and precision will be reset to default.
| void SPATMOD::IMAGE::SAMPLE::SetPrecision | ( | int | precision | ) |
Set precision of sample.
By default the precision is equal to the number of bits in the sample's DATATYPE. Precision may not exceed number of bits in sample's DATATYPE. Supported for integer data types up to 32 bits only. Data value is assumed to occupy the least significant bit(s).
| void SPATMOD::IMAGE::SAMPLE::SetType | ( | TYPE | SampleType | ) | [inline] |
Set sample type.
| void SPATMOD::IMAGE::SAMPLE::SetValue | ( | double | value | ) |
Set sample value from double.
No range checking is performed.
| value | Value to set |
| void SPATMOD::IMAGE::SAMPLE::SetValueFromPtr | ( | const void * | pValue | ) |
Set sample value using pointer to source value.
The source pointer must point to a value of the sample's datatype, with proper memory alignment if required by processor.
| pValue | Pointer to value |
| void SPATMOD::IMAGE::SAMPLE::SetValueMaximum | ( | ) |
Set sample value to maximum for DATATYPE and current precision.
| void SPATMOD::IMAGE::SAMPLE::SetValueMinimum | ( | ) |
Set sample value to minimum for DATATYPE and current precision.
| void SPATMOD::IMAGE::SAMPLE::SetValueNAN | ( | ) |
Set sample value to "not a number" for float data types.
Has no effect for integer data types.
| void SPATMOD::IMAGE::SAMPLE::SetValueZero | ( | ) |
Set sample value to 0.
1.6.1