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

Detailed Description

This utility class provides as number of operations for the manipulation of raster files.

Static Public Member Functions

static bool loadRasterLibrary (const char *libraryName)
 
static bool pyramidToRaster (const char *input_raster, const char *output_raster, TSLRasterType output_type, const int compressionFactor=2)
 
static bool queryExtendedRasterSize (const char *fullPath, int *width, int *height, int *bitsPerPixel, int *dpiWidth, int *dpiHeight)
 
static bool queryRasterSize (const char *fullPath, int *width, int *height, int *bitsPerPixel)
 
static bool rasterToPyramid (const char *input_raster, const char *input_mask, const char *output_raster, TSLRasterInterpolation interpolation, bool multiPage=false)
 
static bool warpRaster (const char *input_raster, double *ctl_points, int ctl_point_count, TSLRasterInterpolation interpolation, const char *output_raster, const char *output_mask, double *output_x1, double *output_y1, double *output_x2, double *output_y2)
 
static bool queryRasterSize (const unsigned char *image, const size_t imageSize, int *width, int *height, int *bitsPerPixel)
 

Member Function Documentation

◆ loadRasterLibrary()

static bool TSLRasterUtilityFunctions::loadRasterLibrary ( const char * libraryName)
static

Load a new MapLink raster handling library.

This method allows a substitute raster handling library to be loaded.

Parameters
libraryNamethe name of the library to load.
Returns
true if successfully loaded, false otherwise.

◆ pyramidToRaster()

static bool TSLRasterUtilityFunctions::pyramidToRaster ( const char * input_raster,
const char * output_raster,
TSLRasterType output_type,
const int compressionFactor = 2 )
static

Converts a MapLink format TPF file to a standard raster format.

Parameters
input_rastername of TPF file to convert.
output_rastername of the output raster file.
output_typetype of raster to create.
compressionFactorSpecifies the compression factor for JPEG and JPEG 2000 (range 2..255)

Returns True if the output raster was successfully constructed. False otherwise.

◆ queryExtendedRasterSize()

static bool TSLRasterUtilityFunctions::queryExtendedRasterSize ( const char * fullPath,
int * width,
int * height,
int * bitsPerPixel,
int * dpiWidth,
int * dpiHeight )
static

Query the size, colour depth and DPI of a raster file. Note that DPI information cannot be returned for all forms of raster files. In these cases the DPI width and height of the image will be set to 0.

Parameters
fullPaththe path to the raster
widthstorage for the width
heightstorage for the height
bitsPerPixelstorage for the bits per pixel value for the raster
dpiWidthstorage for the DPI of the width
dpiHeightstorage for the DPI of the height
Returns
true if the width, height and bits per pixel returned are valid, false otherwise.

◆ queryRasterSize() [1/2]

static bool TSLRasterUtilityFunctions::queryRasterSize ( const char * fullPath,
int * width,
int * height,
int * bitsPerPixel )
static

Query the size of a raster file.

Parameters
fullPaththe path to the raster
widthstorage for the width
heightstorage for the height
bitsPerPixelstorage for the bits per pixel value for the raster
Returns
true if the values returned are valid, false on error.

◆ queryRasterSize() [2/2]

static bool TSLRasterUtilityFunctions::queryRasterSize ( const unsigned char * image,
const size_t imageSize,
int * width,
int * height,
int * bitsPerPixel )
static

Query the size of a raster image. This function does not work on pyramid data.

Parameters
imagea pointer to the source of the image
imageSizethe size in bytes of the image
widthstorage for the width
heightstorage for the height
bitsPerPixelstorage for the bits per pixel value for the raster
Returns
true if the values returned are valid, false on error.

◆ rasterToPyramid()

static bool TSLRasterUtilityFunctions::rasterToPyramid ( const char * input_raster,
const char * input_mask,
const char * output_raster,
TSLRasterInterpolation interpolation,
bool multiPage = false )
static

Converts a third party raster file, with its associated mask into a MapLink format TPF file.

Parameters
input_rastername of the input raster
input_maskname of the input mask raster.
output_rastername of the output TPF file.
interpolationa interpolation enum to use during conversion
multiPagefile should be in multipage format
Returns
True if successful , False otherwise.

◆ warpRaster()

static bool TSLRasterUtilityFunctions::warpRaster ( const char * input_raster,
double * ctl_points,
int ctl_point_count,
TSLRasterInterpolation interpolation,
const char * output_raster,
const char * output_mask,
double * output_x1,
double * output_y1,
double * output_x2,
double * output_y2 )
static

Warps the given raster to a given set of control points.

This method allows the user to convert a modify a raster such that the pixel locations on the raster can be positioned on the vector locations specified in the control points. ( Note : a minimum of 4 control points must be supplied)

The method will not modify the input raster but will produce a new raster file in the same format as the original, as well as a mask file indicating the actual raster area.

Parameters
input_rastername of the input raster file
ctl_pointspoint to an array of control point quads
ctl_point_countnumber of control point quads
interpolationType of interpolation to use.
output_rastername of the output warped raster.
output_maskname of the output mask.
output_x1pointer to left location of raster
output_y1pointer to bottom location of raster
output_x2pointer to right location of raster
output_y2pointer to top location of raster
Returns
True if it was successful, False otherwise. Reasons for failure may include too few ctrl_points , a linear set of control points , invalid relationships between raster and vector control points e.g. raster twisting .