![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
This class provides access to raster-specific settings of a TSLDirectImportDataSet
Applications may query this object via TSLDirectImportDataSet::rasterSettings.
Classes | |
struct | ChannelStatistics |
Public Types | |
enum | MaskGenerationMode { MaskGenerationNone , MaskGenerationReplaceAll , MaskGenerationReplaceAtEdges , MaskGenerationLoadFromFile } |
Mask generation modes. More... | |
enum | NormalisationMode { NormalisationDisabled , NormalisationProductDefined , NormalisationEnabled } |
Public Member Functions | |
unsigned int | width () const |
Query the width of the data set in pixels. | |
unsigned int | height () const |
Query the height of the data set in pixels. | |
TSLDirectImportRaster::RasterType | rasterType () const |
unsigned int | numChannels () const |
TSLDirectImportRaster::RasterChannelFormat | channelFormat () const |
TSLDirectImportRaster::RasterChannelDefinition | channelDefinition (unsigned int channelIndex) const |
bool | getChannelMinMax (unsigned int channelIndex, double &minimum, double &maximum) const |
bool | setChannelMinMax (unsigned int channelIndex, double minimum, double maximum) |
bool | calculateChannelStatistics (unsigned int channelIndex, TSLDirectImportRasterSettings::ChannelStatistics &statistics) |
int | brightness () const |
void | brightness (int value) |
void | contrast (int value) |
int | contrast () const |
void | gamma (int value) |
int | gamma () const |
void | maskGenerationMode (MaskGenerationMode mode) |
MaskGenerationMode | maskGenerationMode () const |
void | maskGenerationColour (const TSLRGB &colour) |
const TSLRGB & | maskGenerationColour () const |
void | maskGenerationFileName (const char *fileName) |
const char * | maskGenerationFileName () const |
unsigned int | maxTileSize () const |
void | maxTileSize (unsigned int size) |
TSLDirectImportRasterSettings::NormalisationMode | normalisationMode () const |
void | normalisationMode (TSLDirectImportRasterSettings::NormalisationMode mode) |
bool | pyramidGeneration () const |
void | pyramidGeneration (bool enable) |
unsigned int | pyramidGenerationMaxLevels () const |
void | pyramidGenerationMaxLevels (unsigned int maxLevels) |
TSLRasterInterpolation | pyramidInterpolation () const |
void | pyramidInterpolation (TSLRasterInterpolation interpolation) |
int TSLDirectImportRasterSettings::brightness | ( | ) | const |
Query the brightness adjustment of the dataset.
void TSLDirectImportRasterSettings::brightness | ( | int | value | ) |
Set the brightness adjustment of the dataset.
Valid values are from -1000 (minimum) to +1000 (maximum). A value of 0 means no brightness adjustment. The default value is 0.
The application must call TSLDirectImportDataSet::reprocess if this setting is changed.
value | The brightness adjustment to set. |
bool TSLDirectImportRasterSettings::calculateChannelStatistics | ( | unsigned int | channelIndex, |
TSLDirectImportRasterSettings::ChannelStatistics & | statistics ) |
Calculate statistics of a channel
This is a synchronous operation and will be performed in the current thread. For large rasters this operation may take a considerable amount of time. Applications should perform this analysis as an offline process wherever possible.
The behaviour of this calculation will depend on the underlying TSLDirectImportDriver and the data being analysed.
channelIndex | The index of the channel |
statistics | Storage for the calculated values |
TSLDirectImportRaster::RasterChannelDefinition TSLDirectImportRasterSettings::channelDefinition | ( | unsigned int | channelIndex | ) | const |
Query the definition of a channel
This determines how the channel will be interpreted by the direct import layer. Greyscale and paletted images will contain a single channel Other images will contain RGBA data. The channels may be exposed in any order.
channelIndex | The index of the channel to query |
TSLDirectImportRaster::RasterChannelFormat TSLDirectImportRasterSettings::channelFormat | ( | ) | const |
Query the format of channels in the raster data
int TSLDirectImportRasterSettings::contrast | ( | ) | const |
Returns the current contrast adjustment of the dataset.
void TSLDirectImportRasterSettings::contrast | ( | int | value | ) |
Sets the contrast adjustment of the dataset. Increases or decreases the range between black and white pixels.
Valid values are from -1000 (no contrast) to 1000 (maximum contrast).
A value of 0 means no contrast adjustment.
The default value is 0.
value | The contrast adjustment to set. |
int TSLDirectImportRasterSettings::gamma | ( | ) | const |
Returns the current gamma correction of the dataset
void TSLDirectImportRasterSettings::gamma | ( | int | value | ) |
Sets the gamma correction of the dataset. This applies a nonlinear correction according to the standard gamma equation.
The value is a positive integer which is 100 times the required gamma value, e.g. to achieve a gamma correction of 0.15, set a value of 15.
A value of 100 means no gamma correction.
The default value is 100.
value | The gamma correction to set |
bool TSLDirectImportRasterSettings::getChannelMinMax | ( | unsigned int | channelIndex, |
double & | minimum, | ||
double & | maximum ) const |
Query the minimum and maximum values of a channel
These values will be used to normalise the data, if normalisation is enabled
The initial minimum and maximum values are set by the TSLDirectImportDriver during basic analysis. These values will often be an estimate, the minimum and maximum possible values of the data type, or a sensible initial value based on the data format/product.
The driver will not have performed a detailed analysis of the data, as this is an expensive operation.
If an application requires accurate values for normalisation it must call calculateChannelStatistics to analyse the data.
The application may override these values using setChannelMinMax.
channelIndex | The index of the channel to query |
minimum | Storage for the minimum value |
maximum | Storage for the maximum value |
unsigned int TSLDirectImportRasterSettings::height | ( | ) | const |
Query the height of the data set in pixels.
const TSLRGB & TSLDirectImportRasterSettings::maskGenerationColour | ( | ) | const |
Query the mask generation pixel colour
This value is only used for pixel replacement modes
void TSLDirectImportRasterSettings::maskGenerationColour | ( | const TSLRGB & | colour | ) |
Set the mask generation pixel colour
This value is only used for pixel replacement modes
colour | The colour to replace during mask generation |
const char * TSLDirectImportRasterSettings::maskGenerationFileName | ( | ) | const |
Query the file name of the mask
void TSLDirectImportRasterSettings::maskGenerationFileName | ( | const char * | fileName | ) |
Set the file name of the mask
This method will automatically set the mask generation mode to MaskGenerationLoadFromFile. If an invalid file is provided the raster will be displayed without a mask.
Masks must have the same dimensions as the source raster.
fileName | The path to the mask file. |
MaskGenerationMode TSLDirectImportRasterSettings::maskGenerationMode | ( | ) | const |
Query the mask generation mode
void TSLDirectImportRasterSettings::maskGenerationMode | ( | MaskGenerationMode | mode | ) |
Set the mask generation mode
For pixel replacement modes the colour should be set via maskGenerationColour For MaskGenerationLoadFromFile the filename should be set via maskGenerationFileName
mode | The mode to set |
unsigned int TSLDirectImportRasterSettings::maxTileSize | ( | ) | const |
Query the maximum raster tile size
Any loaded raster above this size will be tiled as part of the processing pipeline. By default this is 2048 x 2048
void TSLDirectImportRasterSettings::maxTileSize | ( | unsigned int | size | ) |
Set the maximum raster tile size
size | The maximum raster tile size |
TSLDirectImportRasterSettings::NormalisationMode TSLDirectImportRasterSettings::normalisationMode | ( | ) | const |
Query the normalisation mode
By default this is TSLDirectImportRasterSettings::NormalisationProductDefined.
void TSLDirectImportRasterSettings::normalisationMode | ( | TSLDirectImportRasterSettings::NormalisationMode | mode | ) |
Set the normalisation mode
If enabled greyscale, RGB and RGBA images will be normalised based on each channel's minimum/maximum value.
The application should ensure the values returned by getChannelMinMax are correct before loading the data set.
If these values are not available normalisation will be based on the full range of the channel format.
By default the normalisation mode is TSLDirectImportRasterSettings::NormalisationProductDefined.
mode | The normalisation mode |
unsigned int TSLDirectImportRasterSettings::numChannels | ( | ) | const |
Query the number of channels in the raster data
Greyscale and paletted images will always have 1 channel
bool TSLDirectImportRasterSettings::pyramidGeneration | ( | ) | const |
Query whether raster pyramid generation is enabled
By default pyramid generation is disabled.
When using a non-OpenGL drawing surface, and sparsely distributed scale bands, pyramid generation should be enabled to improve performance.
void TSLDirectImportRasterSettings::pyramidGeneration | ( | bool | enable | ) |
Enable/disable raster pyramid generation
enable | true to enable pyramid generation, false otherwise |
unsigned int TSLDirectImportRasterSettings::pyramidGenerationMaxLevels | ( | ) | const |
Query the maximum number of pyramid levels
A value of zero means there is no limit.
void TSLDirectImportRasterSettings::pyramidGenerationMaxLevels | ( | unsigned int | maxLevels | ) |
Set the maximum number of pyramid levels
The default value is zero, meaning no limit.
maxLevels | The maximum number of pyramid levels to create. |
TSLRasterInterpolation TSLDirectImportRasterSettings::pyramidInterpolation | ( | ) | const |
Query the type of interpolation used for raster pyramid generation
The default value is TSLRasterInterpolationBilinear
void TSLDirectImportRasterSettings::pyramidInterpolation | ( | TSLRasterInterpolation | interpolation | ) |
Set the type of interpolation used for raster pyramid generation
interpolation | The interpolation type |
TSLDirectImportRaster::RasterType TSLDirectImportRasterSettings::rasterType | ( | ) | const |
Query the overall type of the raster data
bool TSLDirectImportRasterSettings::setChannelMinMax | ( | unsigned int | channelIndex, |
double | minimum, | ||
double | maximum ) |
Set the minimum and maximum values of a channel
These values will be used to normalise the data, if normalisation is enabled
channelIndex | The index of the channel |
minimum | The minimum value of the channel |
maximum | The maximum value of the channel |
unsigned int TSLDirectImportRasterSettings::width | ( | ) | const |
Query the width of the data set in pixels.