MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
J2KImageReader Class Reference

image reader for JPEG 2000 images More...

#include <J2KImageReader.h>

Inheritance diagram for J2KImageReader:
Collaboration diagram for J2KImageReader:

Public Member Functions

LT_STATUS initialize (const LTFileSpec &fileSpec, bool isPersistent=true, float maxBpp=-1.0f, bool useWorldFile=true)
 initializer More...
 
LT_STATUS initialize (LTIOStreamInf &stream, bool isPersistent=true, float maxBpp=-1.0f, bool useWorldFile=true)
 initializer More...
 
void getParameter_TileSize (int &width, int &height) const
 get image tile size More...
 
void getParameter_Precincts (const int *&widths, const int *&heights, int &numPrecincts) const
 get image precinct sizes More...
 
J2KProgressionOrder getParameter_ProgressionOrder () const
 get image progression order More...
 
void getParameter_CodeblockSize (int &width, int &height) const
 get image codeblock size More...
 
bool getParameter_Wavelet97 () const
 query if 9-7 wavelet used More...
 
bool getParameter_UsingYCbCr () const
 query if YCC transform is used More...
 
lt_uint8 getNumLevels () const
 get number of resolution levels More...
 
LT_STATUS readMetadataBox (const lt_uint8 *uuid, LTIOStreamInf &stream)
 get metadata chunk More...
 
LT_STATUS writeProfile (const LTFileSpec &file) const
 
Jpeg2000ReaderSource & getReaderSouce () const
 
LT_STATUS setTileMaskList (const lt_uint32 *tileMaskList, lt_uint32 tileMaskListLen)
 
virtual lt_int64 getEncodingCost (const LTIScene &scene) const
 get the cost to encode this scene More...
 
virtual lt_uint32 getModifications (const LTIScene &scene) const
 get the modification bitfield for this image More...
 
precision control
LT_STATUS setParameter_Precision (lt_uint32 precision)
 control decoder use of bits of precision More...
 
lt_uint32 getParameter_Precision () const
 control decoder use of bits of precision More...
 
lt_uint32 getParameter_MinPrecision () const
 control decoder use of bits of precision More...
 
lt_uint32 getParameter_MaxPrecision () const
 control decoder use of bits of precision More...
 
lt_uint32 getParameter_DefaultPrecision () const
 control decoder use of bits of precision More...
 
quality layer control
LT_STATUS setParameter_Layers (lt_uint32 numLayers)
 control decoder use of quality layers More...
 
lt_uint32 getParameter_Layers () const
 control decoder use of quality layers More...
 
lt_uint32 getParameter_MinLayers () const
 control decoder use of quality layers More...
 
lt_uint32 getParameter_MaxLayers () const
 control decoder use of quality layers More...
 
lt_uint32 getParameter_DefaultLayers () const
 control decoder use of quality layers More...
 
- Public Member Functions inherited from LTIImageFilter
lt_uint32 getWidth () const
 get image width More...
 
lt_uint32 getHeight () const
 get image height More...
 
LT_STATUS getDimsAtMag (double mag, lt_uint32 &width, lt_uint32 &height) const
 get image width and height at given magnification More...
 
const LTIPixelgetPixelProps () const
 get the pixel properties of the image More...
 
const LTIPixelgetBackgroundPixel () const
 get the values of the background pixel More...
 
const LTIPixelgetNoDataPixel () const
 get the values of the "no data" (transparency) pixel More...
 
const LTIPixelLookupTablegetPixelLookupTable () const
 get the color lookup table, if any More...
 
const LTIPixelgetMinDynamicRange () const
 get the minimum dynamic range value of image More...
 
const LTIPixelgetMaxDynamicRange () const
 get the maximum dynamic range value of image More...
 
const LTIGeoCoordgetGeoCoord () const
 get the geographic coordinates of the image More...
 
bool isGeoCoordImplicit () const
 is geo information "real" or not More...
 
const LTIMetadataDatabasegetMetadata () const
 get the metadata associated with the image More...
 
double getMinMagnification () const
 get the minimum magnification More...
 
double getMaxMagnification () const
 get the maximum magnification More...
 
bool isSelective () const
 check if image supports "random access" decoding More...
 
void setProgressDelegate (LTIProgressDelegate *delegate)
 set progress delegate More...
 
LTIProgressDelegategetProgressDelegate () const
 get progress delegate More...
 
void setInterruptDelegate (LTIInterruptDelegate *delegate)
 set interrupt delegate More...
 
LTIInterruptDelegategetInterruptDelegate () const
 get interrupt delegate More...
 
lt_uint32 getStripHeight () const
 get strip height More...
 
LT_STATUS setStripHeight (lt_uint32 stripHeight)
 set the strip height More...
 
lt_int64 getEncodingCost (const LTIScene &scene) const
 get the cost to encode this scene More...
 
bool getReaderScene (const LTIScene &decodeScene, LTIScene &readerScene) const
 get the underlying scene to be used More...
 
LT_STATUS overrideBackgroundPixel (const LTIPixel *backgroundPixel)
 override the background color of the image More...
 
LT_STATUS overrideNoDataPixel (const LTIPixel *nodataPixel)
 override the "no data" (transparency) color of the image More...
 
LT_STATUS overrideGeoCoord (const LTIGeoCoord &geoCoord)
 override the geographic coordinates of the image More...
 
LT_STATUS overrideDynamicRange (const LTIPixel &drmin, const LTIPixel &drmax)
 override the dynamic range of the image More...
 
LT_STATUS overridePixelBPS (lt_uint8)
 override the bits-per-sample of the image's (sample's) datatype More...
 
LT_STATUS overridePixelLookupTable (const LTIPixelLookupTable *pixelLookupTable)
 override the CLUT of the image More...
 
LT_STATUS overrideMetadata (const LTIMetadataDatabase &metadata)
 override the metadata of the image More...
 
LTIMaskSource * getMask () const
 
bool getPipelineInfo (LTIPipelineInfo info) const
 
LTIImageStagegetPreviousStage (void) const
 
- Public Member Functions inherited from LTIImageStage
LT_STATUS read (const LTIScene &scene, LTISceneBuffer &buffer)
 read (decode) a scene from the image More...
 
virtual LT_STATUS readBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)
 start strip-based read More...
 
virtual LT_STATUS readStrip (LTISceneBuffer &buffer, const LTIScene &stripScene)
 read a strip from the image More...
 
virtual LT_STATUS readEnd ()
 finish strip-based read More...
 
lt_uint32 getNumStrips () const
 get number of strips in scene More...
 
LTIScene getStripScene (lt_uint32 stripNumber) const
 get a strip for current scene More...
 
- Public Member Functions inherited from LTIImage
lt_uint16 getNumBands () const
 get number of bands More...
 
LTIColorSpace getColorSpace () const
 get colorspace More...
 
LTIDataType getDataType () const
 get data type More...
 
bool isNaturalDynamicRange () const
 check if the range is "complete" or not More...
 
lt_int64 getNominalImageSizeWithoutAlpha () const
 get the nominal size of the image, not considering the alpha band More...
 
lt_int64 getNominalImageSizeWithAlpha () const
 get the nominal size of the image, including the alpha band More...
 
void getGeoPoint (LTIPosition position, double &x, double &y) const
 get position of a named point More...
 
LTIPixelcreateBackgroundPixel () const
 return new background pixel More...
 
- Public Member Functions inherited from LTIReferenceCountedObject
virtual void retain (void) const
 increment reference counter More...
 
virtual void release (void) const
 decrement the reference counter and delete the object when the counter is zero More...
 

Static Public Member Functions

static J2KImageReadercreate (void)
 

Protected Member Functions

 J2KImageReader (void)
 
virtual ~J2KImageReader (void)
 
- Protected Member Functions inherited from LTIImageFilter
 LTIImageFilter (void)
 
virtual ~LTIImageFilter (void)
 
LT_STATUS decodeBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)
 start strip-based read More...
 
LT_STATUS decodeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)
 read a strip from the image More...
 
LT_STATUS decodeEnd (void)
 finish strip-based read More...
 
LT_STATUS init (LTIImageStage *previousStage)
 
void releasePreviousStageNow (void)
 
- Protected Member Functions inherited from LTIImageStage
 LTIImageStage (void)
 
virtual ~LTIImageStage (void)
 
LT_STATUS fillBackground (const LTIScene &scene, LTISceneBuffer &buffer)
 fill the background of the scene More...
 
LT_STATUS fillBackground (const LTIScene &scene, LTISceneBuffer &buffer, const LTIPixel &color)
 fill the scene to given pixel More...
 
bool isBandSelected (const LTIPixel &pixelProps) const
 
const LTIScenegetFullScene () const
 get full scene More...
 
- Protected Member Functions inherited from LTIImage
 LTIImage (void)
 
virtual ~LTIImage (void)
 
- Protected Member Functions inherited from LTIReferenceCountedObject
 LTIReferenceCountedObject (void)
 
virtual ~LTIReferenceCountedObject (void)
 

Detailed Description

This class provides support for reading JPEG 2000 images.

Note
Not all JP2/Part 1 images are supported yet. See the release notes for details.
Examples:
DecodeJP2ToBBB.cpp, DecodeJP2ToJPG.cpp, and DecodeJP2ToMemory.cpp.

Definition at line 47 of file J2KImageReader.h.

Constructor & Destructor Documentation

J2KImageReader::J2KImageReader ( void  )
protected
virtual J2KImageReader::~J2KImageReader ( void  )
protectedvirtual

Member Function Documentation

static J2KImageReader* J2KImageReader::create ( void  )
static
virtual lt_int64 J2KImageReader::getEncodingCost ( const LTIScene scene) const
virtual

Returns the "cost" to encode this scene, for use by those image writers which have usage metering enabled. The typical cost is equal to the nominal image size (width * height * numBands * bytesPerSample), but this is overridden for special situations, e.g. the mosaic filter.

Parameters
scenethe scene to be charged for
Returns
the cost to encode the given scene

Implements LTIImageStage.

virtual lt_uint32 J2KImageReader::getModifications ( const LTIScene scene) const
virtual

This function returns a bitfield describing what kinds of modifications have been made to the image during and since its initial encoding.

Parameters
scenethe area pertaining to this request
Returns
a bitfield itemizing the encoding modifications

Reimplemented from LTIImageFilter.

lt_uint8 J2KImageReader::getNumLevels ( ) const

Returns the number of wavelet resolution levels encoded in the image. This is equivalent to the minimum magnification value, expressed as a power of two.

Returns
the number of resolution levels
void J2KImageReader::getParameter_CodeblockSize ( int &  width,
int &  height 
) const

Returns the size of the codeblock used to encode the image, in pixels.

Parameters
widthcodeblock width, in pixels
heightcodeblock width, in pixels
lt_uint32 J2KImageReader::getParameter_DefaultLayers ( ) const

These functions allow the caller to control the number of quality layers used in satisfying the decode request. Use of quality layers allow for "preset" compression ratios to be encoded into the image.

The default is to use all available layers).

lt_uint32 J2KImageReader::getParameter_DefaultPrecision ( ) const

These functions allow the caller to control the number of bits of precision (or bits per sample) used in satisfying the decode request.

The default is to use all available bits.

Note this allows for precision control on a per-decode basis. The maxBpp constructor parameter performs a similar function, but sets the value for all decode operations on the image.

lt_uint32 J2KImageReader::getParameter_Layers ( ) const

These functions allow the caller to control the number of quality layers used in satisfying the decode request. Use of quality layers allow for "preset" compression ratios to be encoded into the image.

The default is to use all available layers).

lt_uint32 J2KImageReader::getParameter_MaxLayers ( ) const

These functions allow the caller to control the number of quality layers used in satisfying the decode request. Use of quality layers allow for "preset" compression ratios to be encoded into the image.

The default is to use all available layers).

lt_uint32 J2KImageReader::getParameter_MaxPrecision ( ) const

These functions allow the caller to control the number of bits of precision (or bits per sample) used in satisfying the decode request.

The default is to use all available bits.

Note this allows for precision control on a per-decode basis. The maxBpp constructor parameter performs a similar function, but sets the value for all decode operations on the image.

lt_uint32 J2KImageReader::getParameter_MinLayers ( ) const

These functions allow the caller to control the number of quality layers used in satisfying the decode request. Use of quality layers allow for "preset" compression ratios to be encoded into the image.

The default is to use all available layers).

lt_uint32 J2KImageReader::getParameter_MinPrecision ( ) const

These functions allow the caller to control the number of bits of precision (or bits per sample) used in satisfying the decode request.

The default is to use all available bits.

Note this allows for precision control on a per-decode basis. The maxBpp constructor parameter performs a similar function, but sets the value for all decode operations on the image.

void J2KImageReader::getParameter_Precincts ( const int *&  widths,
const int *&  heights,
int &  numPrecincts 
) const

Returns the size of the precinct(s) used to encode the image, in pixels. The data is returned as pointers to arrays, one width/height value for each of the numPrecincts precincts.

Parameters
widthsreturned array of precincts widths, in pixels
heightsreturned array of precincts heights, in pixels
numPrecinctsnumber of precincts in image (and length of widths / heights arrays)
lt_uint32 J2KImageReader::getParameter_Precision ( ) const

These functions allow the caller to control the number of bits of precision (or bits per sample) used in satisfying the decode request.

The default is to use all available bits.

Note this allows for precision control on a per-decode basis. The maxBpp constructor parameter performs a similar function, but sets the value for all decode operations on the image.

J2KProgressionOrder J2KImageReader::getParameter_ProgressionOrder ( ) const

Returns the progression order of the image.

Returns
the progression order
void J2KImageReader::getParameter_TileSize ( int &  width,
int &  height 
) const

Returns the size of the tile(s) used to encode the image, in pixels. An image that is "not tiled" is considered to be encoded as one large tile, the size of the entire image.

Parameters
widthtile width, in pixels
heighttile height, in pixels
bool J2KImageReader::getParameter_UsingYCbCr ( ) const

Returns true if the RGB-YCbCr multiple component transform is used for this image.

Returns
true, if image encoded with YCC transform
bool J2KImageReader::getParameter_Wavelet97 ( ) const

Returns true if the image was encoded with the 9-7 wavelet. The 9-7 wavelet may give better image quality as compared to the 5-3 wavelet for a given compression ratio, however the 9-7 wavelet does not support lossless encoding.

Returns
true, if the 9-7 wavelet was used
Jpeg2000ReaderSource& J2KImageReader::getReaderSouce ( ) const
LT_STATUS J2KImageReader::initialize ( const LTFileSpec fileSpec,
bool  isPersistent = true,
float  maxBpp = -1.0f,
bool  useWorldFile = true 
)

Create a JPEG 2000 image reader from a file.

The isPersistent parameter is used as a performance hint to the underlying codec. If you intend to do only one decode request from the image, you may set this value to false; this may result in improved memory usage and performance. If multiple decode requests are to be made, the value must be set to true.

The maxBpp parameter controls the number of bits per sample to decode from. Values smaller than the number of bits per sample will produce lossy images, but generally the decode operations will be faster. A value of -1.0 indicates all available bits are to be used.

The bandList parameter, if set to a value other than NULL, will attempt to open the image as if it contained only numBands bands (components). Note if the YCbCr transform was used to encode the image, the band data will be returned still in the YCC colorspace; this is typically not what you want if any of the bands in bandList are in the range 0...2. Also note that if two values in the bandList are the same an error will be returned.

Parameters
fileSpecfile to read from
isPersistentset to true, unless only doing one decode request
maxBppset to number of bits per sample desired (or -1.0f for all bits)
useWorldFileuse world file information if available
bandListNULL for all bands or zero based list of band (Kakadu component) indices
numBandsZero for all bands or number of indices in bandList
Examples:
DecodeJP2ToBBB.cpp, DecodeJP2ToJPG.cpp, and DecodeJP2ToMemory.cpp.
LT_STATUS J2KImageReader::initialize ( LTIOStreamInf stream,
bool  isPersistent = true,
float  maxBpp = -1.0f,
bool  useWorldFile = true 
)

Create a JPEG 2000 image reader from a stream.

See file initialize for parameter descriptions.

Parameters
streamstream to read from
isPersistentset to true, unless only doing one decode request
maxBppset to number of bits per sample desired (or -1.0f for all bits)
useWorldFileuse world file information if available
bandListNULL for all bands or zero based list of band (Kakadu component) indices
numBandsZero for all bands or number of indices in bandList
LT_STATUS J2KImageReader::readMetadataBox ( const lt_uint8 uuid,
LTIOStreamInf stream 
)

This function is used to access the contents of a metadata box in the JPEG 2000 image, given a UUID. The box contents are copied into a user-supplied stream.

Parameters
uuidthe UUID of the box to read
streamstream to receive the metadata
Returns
success or failure status code
LT_STATUS J2KImageReader::setParameter_Layers ( lt_uint32  numLayers)

These functions allow the caller to control the number of quality layers used in satisfying the decode request. Use of quality layers allow for "preset" compression ratios to be encoded into the image.

The default is to use all available layers).

LT_STATUS J2KImageReader::setParameter_Precision ( lt_uint32  precision)

These functions allow the caller to control the number of bits of precision (or bits per sample) used in satisfying the decode request.

The default is to use all available bits.

Note this allows for precision control on a per-decode basis. The maxBpp constructor parameter performs a similar function, but sets the value for all decode operations on the image.

LT_STATUS J2KImageReader::setTileMaskList ( const lt_uint32 tileMaskList,
lt_uint32  tileMaskListLen 
)
LT_STATUS J2KImageReader::writeProfile ( const LTFileSpec file) const

The documentation for this class was generated from the following file:

LizardTech