MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

Typedefs | Functions
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"`
Include dependency graph for ltic_api.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

  image | image 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

  image | image to decode
  xUpperLeft | upperleft x position of scene
  yUpperLeft | upperleft y position of scene
  width | width of scene
  height | height of scene
  magnification | manification of scene
  buffers | array 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image 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

  image | image to query
  recordNum | index of record to retrieve
  tag | address to hold name of metadata tag
  datatype | address to hold datatype of record
  numDims | address to hold number of dimension in record data
  dims | address to record's dimesnion arrays
  data | address 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

  image | image 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

  fileName | the file to get the version of
  generation | the MrSID generation
  raster | is 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

  image | image 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

  image | image 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

  major | address to hold major version number
  minor | address to hold minor version number
  revision | address to hold revision number
  build | address to hold build number
  branch | address 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

  image | image 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

  image | MrSID 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

  image | address to hold image handle
  fileName | name 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

  image | address to hold image handle
  stream | C 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

  image | address to hold image handle
  fileName | name 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

  image | address to hold image handle
  stream | C 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

  image | address to hold image handle
  fileName | name 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

  image | MrSID image to unlock
  passwd | password string for image

Returns
  success or failure status code

LizardTech