MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
ltic_api.h File Reference

This file contains a simple C API to the Decode SDK. More...

#include "lti_types.h"
#include "lti_metadataTypes.h"
#include "lt_ioCStream.h"

Go to the source code of this file.

Macros

#define LT_STS_CAPI_BASE   ((LT_STATUS)52000)
 C API status codes. More...
 
#define LT_STS_CAPI_BadParam   ((LT_STATUS)52001)
 C API status codes. More...
 
#define LT_STS_CAPI_MAX   ((LT_STATUS)52099)
 C API status codes. More...
 

Typedefs

typedef void * LTICImageH
 opaque pointer (handle) to an LTIImage More...
 

Functions

LT_STATUS ltic_getVersion (lt_uint32 *major, lt_uint32 *minor, lt_uint32 *revision, lt_uint32 *build, const char **branch)
 get SDK version (C API) More...
 
LT_STATUS ltic_getMrSIDGeneration (const char *fileName, int *generation, int *raster)
 get MrSID generation (C API) More...
 
LT_STATUS ltic_openMrSIDImageFile (LTICImageH *image, const char *fileName)
 open MrSID image via filename (C API) More...
 
LT_STATUS ltic_openMrSIDImageStream (LTICImageH *image, LTIOStreamH stream)
 open MrSID image via stream (C API) More...
 
LT_STATUS ltic_openJP2ImageFile (LTICImageH *image, const char *fileName)
 open JPEG 2000 image via filename (C API) More...
 
LT_STATUS ltic_openJP2ImageStream (LTICImageH *image, LTIOStreamH stream)
 open JPEG 2000 image via stream (C API) More...
 
LT_STATUS ltic_openNITFImageFile (LTICImageH *image, const char *fileName)
 open NITF image via filename (C API) More...
 
LT_STATUS ltic_closeImage (LTICImageH image)
 close an image (C API) More...
 
lt_uint32 ltic_getWidth (const LTICImageH image)
 get image width (C API) More...
 
lt_uint32 ltic_getHeight (const LTICImageH image)
 get image height (C API) More...
 
LT_STATUS ltic_getDimsAtMag (LTICImageH image, double magnification, lt_uint32 *width, lt_uint32 *height)
 get dimensions of an image at a given magnification (C API) More...
 
LTIColorSpace ltic_getColorSpace (const LTICImageH image)
 get image colorspace (C API) More...
 
lt_uint16 ltic_getNumBands (const LTICImageH image)
 get number of bands in trhe image (C API) More...
 
LTIDataType ltic_getDataType (const LTICImageH image)
 get image datatype (C API) More...
 
double ltic_getMinMagnification (const LTICImageH image)
 get image minimum magnifaction (C API) More...
 
double ltic_getMaxMagnification (const LTICImageH image)
 get image maximum magnifacation (C API) More...
 
lt_uint8 ltic_isMrSIDLocked (const LTICImageH image)
 query if MrSID image is locked (C API) More...
 
LT_STATUS ltic_setMrSIDPassword (LTICImageH image, const lt_utf8 *passwd)
 set password for decoding MrSID image (C API) More...
 
double ltic_getGeoXOrigin (const LTICImageH image)
 get geo X position of image (C API) More...
 
double ltic_getGeoYOrigin (const LTICImageH image)
 get geo Y position of image (C API) More...
 
double ltic_getGeoXResolution (const LTICImageH image)
 get geo X resolution of image (C API) More...
 
double ltic_getGeoYResolution (const LTICImageH image)
 get geo Y resolution of image (C API) More...
 
double ltic_getGeoXRotation (const LTICImageH image)
 get geo X rotation term of image (C API) More...
 
double ltic_getGeoYRotation (const LTICImageH image)
 get geo Y rotation term of image (C API) More...
 
LT_STATUS ltic_decode (LTICImageH image, double xUpperLeft, double yUpperLeft, double width, double height, double magnification, void **buffers)
 decode a scene from the image (C API) More...
 
lt_uint32 ltic_getNumMetadataRecords (LTICImageH image)
 get number of metadata records (C API) More...
 
LT_STATUS ltic_getMetadataRecord (LTICImageH image, lt_uint32 recordNum, const char **tag, LTIMetadataDataType *datatype, lt_uint32 *numDims, const lt_uint32 **dims, const void **data)
 get a metadata record from an image (C API) More...
 

Detailed Description

It is essentially just a wrapper around the LTIImage class and its member functions.

Definition in file ltic_api.h.

Macro Definition Documentation

#define LT_STS_CAPI_BadParam   ((LT_STATUS)52001)

Definition at line 42 of file ltic_api.h.

#define LT_STS_CAPI_BASE   ((LT_STATUS)52000)

Definition at line 41 of file ltic_api.h.

#define LT_STS_CAPI_MAX   ((LT_STATUS)52099)

Definition at line 43 of file ltic_api.h.

Typedef Documentation

typedef void* LTICImageH

Definition at line 50 of file ltic_api.h.

Function Documentation

LT_STATUS ltic_closeImage ( LTICImageH  image)

This function will close the given image.

This method is part of the C API. It is equivalent to calling the LTIImage destructor.

Parameters
imageimage to be closed
Returns
status code indicating success or failure
Examples:
UsingCInterface.c.
LT_STATUS ltic_decode ( LTICImageH  image,
double  xUpperLeft,
double  yUpperLeft,
double  width,
double  height,
double  magnification,
void **  buffers 
)

This function decodes a scene from the image. The output is written to the given band buffers in packed form.

This method is part of the C API. It is equivalent to calling LTIImageStage::read(). The xUpperLeft, yUpperLeft, width, height, and magnification parameters correspond to the LTIScene used in the read() call.

Parameters
imageimage to decode
xUpperLeftupperleft x position of scene
yUpperLeftupperleft y position of scene
widthwidth of scene
heightheight of scene
magnificationmanification of scene
buffersarray of buffers to write to, one per band
Returns
status code indicating success or failure
Examples:
UsingCInterface.c.
LTIColorSpace ltic_getColorSpace ( const LTICImageH  image)

This function will return the colorspace of the given image.

This method is part of the C API. It is equivalent to calling LTIImage::getColorSpace().

Parameters
imageimage to query
Returns
colorspace of image
Examples:
UsingCInterface.c.
LTIDataType ltic_getDataType ( const LTICImageH  image)

This function will return the datatype of the pixels of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getDataType().

Parameters
imageimage to query
Returns
datatype of the image
Examples:
UsingCInterface.c.
LT_STATUS ltic_getDimsAtMag ( LTICImageH  image,
double  magnification,
lt_uint32 width,
lt_uint32 height 
)

This function returns the projected dimensions of an image at a given magnification level.

This method is part of the C API. It is equivalent to calling LTIImage::getDimsAtMag()

double ltic_getGeoXOrigin ( const LTICImageH  image)

This function will return the upper-left X position of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getGeoCoord().getX().

Parameters
imageimage to query
Returns
upperleft X geo position
double ltic_getGeoXResolution ( const LTICImageH  image)

This function will return the X resolution of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getGeoCoord().getXRes().

Parameters
imageimage to query
Returns
X resolution
double ltic_getGeoXRotation ( const LTICImageH  image)

This function will return the X rotation term of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getGeoCoord().getXRot().

Parameters
imageimage to query
Returns
X rotation
double ltic_getGeoYOrigin ( const LTICImageH  image)

This function will return the upper-left Y position of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getGeoCoord().getY().

Parameters
imageimage to query
Returns
upperleft Y geo position
double ltic_getGeoYResolution ( const LTICImageH  image)

This function will return the Y resolution of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getGeoCoord().getYRes().

Parameters
imageimage to query
Returns
Y resolution
double ltic_getGeoYRotation ( const LTICImageH  image)

This function will return the Y rotation term of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getGeoCoord().getYRot().

Parameters
imageimage to query
Returns
Y rotation
lt_uint32 ltic_getHeight ( const LTICImageH  image)

This function will return the height of the given image.

This method is part of the C API. It is equivalent to calling LTIImage::getHeight().

Parameters
imageimage to query
Returns
height of image
Examples:
UsingCInterface.c.
double ltic_getMaxMagnification ( const LTICImageH  image)

This function will return the maximum magnification of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getMaxMagnification().

Parameters
imageimage to query
Returns
maximum magnification of image
LT_STATUS ltic_getMetadataRecord ( LTICImageH  image,
lt_uint32  recordNum,
const char **  tag,
LTIMetadataDataType datatype,
lt_uint32 numDims,
const lt_uint32 **  dims,
const void **  data 
)

This function returns the data contained in a given metadata record.

This method is part of the C API. It is equivalent to calling LTIImage::getMetadata().getDataByIndex().

Parameters
imageimage to query
recordNumindex of record to retrieve
tagaddress to hold name of metadata tag
datatypeaddress to hold datatype of record
numDimsaddress to hold number of dimension in record data
dimsaddress to record's dimesnion arrays
dataaddress to record's data
Returns
status code indicating success or failure
double ltic_getMinMagnification ( const LTICImageH  image)

This function will return the minimum magnification of the image.

This method is part of the C API. It is equivalent to calling LTIImage::getMinMagnification().

Parameters
imageimage to query
Returns
minimum magnification of image
LT_STATUS ltic_getMrSIDGeneration ( const char *  fileName,
int *  generation,
int *  raster 
)

Returns the MrSID generation number for a specific MrSID image.

The generation value returned will be 2 (for MrSID/MG2), 3 (for MrSID/MG3), 4 (for MrSID/MG4) or 0 (if error).

Parameters
fileNamethe file to get the version of
generationthe MrSID generation
rasteris the file raster or point cloud?
Returns
status code indicating success or failure
lt_uint16 ltic_getNumBands ( const LTICImageH  image)

This function will return the numbe rof bands in the given image.

This method is part of the C API. It is equivalent to calling LTIImage::getNumBands().

Parameters
imageimage to query
Returns
number of bands in the image
Examples:
UsingCInterface.c.
lt_uint32 ltic_getNumMetadataRecords ( LTICImageH  image)

This function returns the number of metadata records in the image. This number defines the range of values used with ltic_metadataRecord().

This method is part of the C API. It is equivalent to calling LTIImage::getMetadata().getIndexCount().

Parameters
imageimage to query
Returns
number of records in image
LT_STATUS ltic_getVersion ( lt_uint32 major,
lt_uint32 minor,
lt_uint32 revision,
lt_uint32 build,
const char **  branch 
)

Returns the full version number of the SDK, e.g. "4.0.8.673".

This method is part of the C API. It is equivalent to the LTIUtils::getVersionInfo() function.

Parameters
majoraddress to hold major version number
minoraddress to hold minor version number
revisionaddress to hold revision number
buildaddress to hold build number
branchaddress to hold string giving the branch name
Returns
status code indicating success or failure
lt_uint32 ltic_getWidth ( const LTICImageH  image)

This function will return the width of the given image.

This method is part of the C API. It is equivalent to calling LTIImage::getWidth().

Parameters
imageimage to query
Returns
width in pixels
Examples:
UsingCInterface.c.
lt_uint8 ltic_isMrSIDLocked ( const LTICImageH  image)

This function will return whether or not the given image is locked, i.e. password protected. The image handle must be a MrSID image.

This method is part of the C API. It is equivalent to calling MrSIDImageReader::isLocked().

Parameters
imageMrSID image to query
Returns
1 if locked, otherwise 0
LT_STATUS ltic_openJP2ImageFile ( LTICImageH image,
const char *  fileName 
)

Given the filename of a JPEG 2000 image, this function will open the image and return a handle which can be used to access image information and perform decodes.

This method is part of the C API. It is equivalent to constructing a J2KImageReader object.

Parameters
imageaddress to hold image handle
fileNamename of file to open
Returns
status code indicating success or failure
LT_STATUS ltic_openJP2ImageStream ( LTICImageH image,
LTIOStreamH  stream 
)

Given a C stream containing a JPEG 2000 image, this function will open the image and return a handle which can be used to access image information and perform decodes.

This method is part of the C API. It is equivalent to constructing a J2KImageReader object.

Parameters
imageaddress to hold image handle
streamC stream handle
Returns
status code indicating success or failure
LT_STATUS ltic_openMrSIDImageFile ( LTICImageH image,
const char *  fileName 
)

Given the filename of a MrSID image, this function will open the image and return a handle which can be used to access image information and perform decodes.

This method is part of the C API. It is equivalent to constructing a MrSIDImageReader object.

Parameters
imageaddress to hold image handle
fileNamename of file to open
Returns
status code indicating success or failure
Examples:
UsingCInterface.c.
LT_STATUS ltic_openMrSIDImageStream ( LTICImageH image,
LTIOStreamH  stream 
)

Given a C stream containing a MrSID image, this function will open the image and return a handle which can be used to access image information and perform decodes.

This method is part of the C API. It is equivalent to constructing a MrSIDImageReader object.

Parameters
imageaddress to hold image handle
streamC stream handle
Returns
status code indicating success or failure
LT_STATUS ltic_openNITFImageFile ( LTICImageH image,
const char *  fileName 
)

Given the filename of a NITF image, this function will open the image and return a handle which can be used to access image information and perform decodes.

This method is part of the C API. It is equivalent to constructing a NITFImageReader (and NITFImageManager) object.

Parameters
imageaddress to hold image handle
fileNamename of file to open
Returns
status code indicating success or failure
LT_STATUS ltic_setMrSIDPassword ( LTICImageH  image,
const lt_utf8 passwd 
)

This function will set the passward used to decode a locked MrSID image.

This method is part of the C API. It is equivalent to calling MrSIDImageReader::setPassword().

Parameters
imageMrSID image to unlock
passwdpassword string for image
Returns
success or failure status code

LizardTech