|
GDAL
|
Class to manage reclassification of pixel values. More...
#include <vrtreclassifier.h>
Classes | |
| struct | Interval |
| Internal struct to hold an interval of values to be reclassified. More... | |
Public Member Functions | |
| CPLErr | Init (const char *pszText, std::optional< double > noDataValue, GDALDataType eBufType) |
| Initialize a Reclassifier from text. | |
| void | AddMapping (const Interval &interval, std::optional< double > dfDstVal) |
| Set a mapping between an interval and (optionally) a destination value. | |
| double | Reclassify (double srcVal, bool &bFoundInterval) const |
| Reclassify a value. | |
| void | SetDefaultPassThrough (bool value) |
| If true, values not matched by any interval will be returned unmodified. | |
| void | SetDefaultValue (double value) |
| Sets a default value for any value not matched by any interval. | |
| void | SetNaNValue (double value) |
| Sets a value for an input NaN value. | |
| CPLErr | Finalize () |
| Prepare reclassifier for use. | |
Class to manage reclassification of pixel values.
| void gdal::Reclassifier::AddMapping | ( | const Interval & | interval, |
| std::optional< double > | dfDstVal ) |
Set a mapping between an interval and (optionally) a destination value.
If no destination value is provided, values matching the interval will be passed through unmodified. It will not be verified that these values fit within the destination data type.
| CPLErr gdal::Reclassifier::Finalize | ( | ) |
Prepare reclassifier for use.
No more mappings may be added.
| CPLErr gdal::Reclassifier::Init | ( | const char * | pszText, |
| std::optional< double > | noDataValue, | ||
| GDALDataType | eBufType ) |
Initialize a Reclassifier from text.
The text consists of a series of SOURCE=DEST mappings, separated by a semicolon.
Each SOURCE element much be one of:
Each DEST element must be one of:
An error will be returned if:
| pszText | text to parse |
| noDataValue | NoData value |
| eBufType | Destination data type |
| double gdal::Reclassifier::Reclassify | ( | double | srcVal, |
| bool & | bFoundInterval ) const |
Reclassify a value.
| srcVal | the value to reclassify |
| bFoundInterval | set to True if the value could be reclassified |
|
inline |
If true, values not matched by any interval will be returned unmodified.
It will not be verified that these values fit within the destination data type.