MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
J2KImageReader Class Reference

image reader for JPEG 2000 images More...

#include <J2KImageReader.h>

Inheritance diagram for J2KImageReader:
LTIImageFilter LTIImageStage LTIImage LTIReferenceCountedObject

List of all members.

Public Member Functions

LT_STATUS initialize (const LTFileSpec &fileSpec, bool isPersistent=true, float maxBpp=-1.0f, bool useWorldFile=true)
 initializer
LT_STATUS initialize (LTIOStreamInf &stream, bool isPersistent=true, float maxBpp=-1.0f, bool useWorldFile=true)
 initializer
void getParameter_TileSize (int &width, int &height) const
 get image tile size
void getParameter_Precincts (const int *&widths, const int *&heights, int &numPrecincts) const
 get image precinct sizes
J2KProgressionOrder getParameter_ProgressionOrder () const
 get image progression order
void getParameter_CodeblockSize (int &width, int &height) const
 get image codeblock size
bool getParameter_Wavelet97 () const
 query if 9-7 wavelet used
bool getParameter_UsingYCbCr () const
 query if YCC transform is used
lt_uint8 getNumLevels () const
 get number of resolution levels
LT_STATUS readMetadataBox (const lt_uint8 *uuid, LTIOStreamInf &stream)
 get metadata chunk
LT_STATUS writeProfile (const LTFileSpec &file) const
Jpeg2000ReaderSource & getReaderSouce () const
virtual lt_int64 getEncodingCost (const LTIScene &scene) const
 get the cost to encode this scene
virtual lt_uint32 getModifications (const LTIScene &scene) const
 get the modification bitfield for this image
precision control
LT_STATUS setParameter_Precision (lt_uint32 precision)
 control decoder use of bits of precision
lt_uint32 getParameter_Precision () const
 control decoder use of bits of precision
lt_uint32 getParameter_MinPrecision () const
 control decoder use of bits of precision
lt_uint32 getParameter_MaxPrecision () const
 control decoder use of bits of precision
lt_uint32 getParameter_DefaultPrecision () const
 control decoder use of bits of precision
quality layer control
LT_STATUS setParameter_Layers (lt_uint32 numLayers)
 control decoder use of quality layers
lt_uint32 getParameter_Layers () const
 control decoder use of quality layers
lt_uint32 getParameter_MinLayers () const
 control decoder use of quality layers
lt_uint32 getParameter_MaxLayers () const
 control decoder use of quality layers
lt_uint32 getParameter_DefaultLayers () const
 control decoder use of quality layers

Static Public Member Functions

static J2KImageReadercreate (void)

Protected Member Functions

 J2KImageReader (void)
virtual ~J2KImageReader (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  ) [protected, virtual]

Member Function Documentation

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

Reimplemented from LTIImageFilter.

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.

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

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).

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.

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).

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).

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.

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).

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)

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.

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

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

Returns:
true, if image encoded with YCC transform

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

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

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).

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.


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