MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
Loading...
Searching...
No Matches
TSLDirectImportRasterSettings Class Reference

Detailed Description

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 TSLRGBmaskGenerationColour () 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)
 

Member Enumeration Documentation

◆ MaskGenerationMode

Mask generation modes.

Enumerator
MaskGenerationNone 

No mask generation.

MaskGenerationReplaceAll 

Replace all matching pixels.

MaskGenerationReplaceAtEdges 

Replace all matching pixels near the edge of the image.

MaskGenerationLoadFromFile 

Load a mask from a file.

◆ NormalisationMode

Normalisation modes

By default normalisation will be set to NormalisationProductDefined.

Enumerator
NormalisationDisabled 

Disable normalisation.

NormalisationProductDefined 

Enable normalisation for the following formats/products:

  • NITF/NSIF
NormalisationEnabled 

Enable normalisation.

Member Function Documentation

◆ brightness() [1/2]

int TSLDirectImportRasterSettings::brightness ( ) const

Query the brightness adjustment of the dataset.

Note
Per-Data Set Brightness adjustments are a future enhancement.
Returns
The brightness adjustment of the dataset

◆ brightness() [2/2]

void TSLDirectImportRasterSettings::brightness ( int value)

Set the brightness adjustment of the dataset.

Note
Per-Data Set Brightness adjustments are a future enhancement.

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.

Parameters
valueThe brightness adjustment to set.

◆ calculateChannelStatistics()

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.

Parameters
channelIndexThe index of the channel
statisticsStorage for the calculated values
Returns
true if statistics were calculate, false otherwise

◆ channelDefinition()

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.

Parameters
channelIndexThe index of the channel to query
Returns
How the channels data will be interpreted or TSLDirectImportRaster::RasterChannelDefinitionUnknown on failure

◆ channelFormat()

TSLDirectImportRaster::RasterChannelFormat TSLDirectImportRasterSettings::channelFormat ( ) const

Query the format of channels in the raster data

Returns
The data format of the channels in the raster data

◆ contrast() [1/2]

int TSLDirectImportRasterSettings::contrast ( ) const

Returns the current contrast adjustment of the dataset.

◆ contrast() [2/2]

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.

Parameters
valueThe contrast adjustment to set.

◆ gamma() [1/2]

int TSLDirectImportRasterSettings::gamma ( ) const

Returns the current gamma correction of the dataset

◆ gamma() [2/2]

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.

Parameters
valueThe gamma correction to set

◆ getChannelMinMax()

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.

Parameters
channelIndexThe index of the channel to query
minimumStorage for the minimum value
maximumStorage for the maximum value
Returns
true if the minimum and maximum values were read, false otherwise.

◆ height()

unsigned int TSLDirectImportRasterSettings::height ( ) const

Query the height of the data set in pixels.

◆ maskGenerationColour() [1/2]

const TSLRGB & TSLDirectImportRasterSettings::maskGenerationColour ( ) const

Query the mask generation pixel colour

This value is only used for pixel replacement modes

Returns
The mask generation colour

◆ maskGenerationColour() [2/2]

void TSLDirectImportRasterSettings::maskGenerationColour ( const TSLRGB & colour)

Set the mask generation pixel colour

This value is only used for pixel replacement modes

Parameters
colourThe colour to replace during mask generation

◆ maskGenerationFileName() [1/2]

const char * TSLDirectImportRasterSettings::maskGenerationFileName ( ) const

Query the file name of the mask

Returns
The file name of the mask, or NULL if not set

◆ maskGenerationFileName() [2/2]

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.

Parameters
fileNameThe path to the mask file.

◆ maskGenerationMode() [1/2]

MaskGenerationMode TSLDirectImportRasterSettings::maskGenerationMode ( ) const

Query the mask generation mode

Returns
The mask generation mode

◆ maskGenerationMode() [2/2]

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

Parameters
modeThe mode to set

◆ maxTileSize() [1/2]

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

Returns
The maximum raster tile size

◆ maxTileSize() [2/2]

void TSLDirectImportRasterSettings::maxTileSize ( unsigned int size)

Set the maximum raster tile size

Parameters
sizeThe maximum raster tile size

◆ normalisationMode() [1/2]

TSLDirectImportRasterSettings::NormalisationMode TSLDirectImportRasterSettings::normalisationMode ( ) const

Query the normalisation mode

By default this is TSLDirectImportRasterSettings::NormalisationProductDefined.

Returns
The normalisation mode

◆ normalisationMode() [2/2]

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.

Parameters
modeThe normalisation mode

◆ numChannels()

unsigned int TSLDirectImportRasterSettings::numChannels ( ) const

Query the number of channels in the raster data

Greyscale and paletted images will always have 1 channel

Returns
The number of channels in the raster data

◆ pyramidGeneration() [1/2]

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.

Returns
true if pyramid generation is enabled, false otherwise

◆ pyramidGeneration() [2/2]

void TSLDirectImportRasterSettings::pyramidGeneration ( bool enable)

Enable/disable raster pyramid generation

Parameters
enabletrue to enable pyramid generation, false otherwise

◆ pyramidGenerationMaxLevels() [1/2]

unsigned int TSLDirectImportRasterSettings::pyramidGenerationMaxLevels ( ) const

Query the maximum number of pyramid levels

A value of zero means there is no limit.

Returns
The maximum number of pyramid levels to create.

◆ pyramidGenerationMaxLevels() [2/2]

void TSLDirectImportRasterSettings::pyramidGenerationMaxLevels ( unsigned int maxLevels)

Set the maximum number of pyramid levels

The default value is zero, meaning no limit.

Parameters
maxLevelsThe maximum number of pyramid levels to create.

◆ pyramidInterpolation() [1/2]

TSLRasterInterpolation TSLDirectImportRasterSettings::pyramidInterpolation ( ) const

Query the type of interpolation used for raster pyramid generation

The default value is TSLRasterInterpolationBilinear

Returns
The type of interpolation used for pyramid generation

◆ pyramidInterpolation() [2/2]

void TSLDirectImportRasterSettings::pyramidInterpolation ( TSLRasterInterpolation interpolation)

Set the type of interpolation used for raster pyramid generation

Parameters
interpolationThe interpolation type

◆ rasterType()

TSLDirectImportRaster::RasterType TSLDirectImportRasterSettings::rasterType ( ) const

Query the overall type of the raster data

Returns
The type of the raster data

◆ setChannelMinMax()

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

Parameters
channelIndexThe index of the channel
minimumThe minimum value of the channel
maximumThe maximum value of the channel
Returns
true if the minimum and maximum values were set, false otherwise

◆ width()

unsigned int TSLDirectImportRasterSettings::width ( ) const

Query the width of the data set in pixels.