MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
MrSIDImageReader Class Reference

reader for MrSID images (MG2, MG3 and MG4) More...

#include <MrSIDImageReader.h>

Inheritance diagram for MrSIDImageReader:
Collaboration diagram for MrSIDImageReader:

Public Member Functions

LT_STATUS initialize (const LTFileSpec &fileSpec, bool useWorldFile=false, MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT, MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT)
 initializer More...
 
LT_STATUS initialize (LTIOStreamInf *stream, LTIOStreamInf *worldFileStream=NULL, MrSIDMemoryUsage memoryUsage=MRSID_MEMORY_USAGE_DEFAULT, MrSIDStreamUsage streamUsage=MRSID_STREAM_USAGE_DEFAULT)
 initializer More...
 
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...
 
lt_uint8 getNumLevels (void) const
 get number of resolution levels More...
 
bool isLocked (void) const
 image encryption query More...
 
void setMaxWorkerThreads (int numThreads)
 set the maximum number of worker threads More...
 
int getMaxWorkerThreads () const
 get the maximum number of worker threads More...
 
const MrSIDImageStageManagergetManager (void) const
 
const LTIMosaicFiltergetMosaicFilter (void) const
 
const MG2ImageReader * getMG2ImageReader (void) const
 
const MG3SingleImageReader * getMG3ImageReader (void) const
 
const MG4SingleImageReader * getMG4ImageReader (void) const
 
- 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...
 
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...
 
- Public Member Functions inherited from MrSIDImageReaderInterface
virtual ~MrSIDImageReaderInterface ()
 
void setPasswordDelegate (MrSIDPasswordDelegate *passwordDelegate)
 set password handler More...
 
void setPassword (const lt_utf8 *password)
 set password handler More...
 
LT_STATUS getMrSIDGeneration (lt_uint8 &gen, bool &raster) const
 get MrSID generation More...
 
LT_STATUS getMrSIDVersion (lt_uint8 &major, lt_uint8 &minor, lt_uint8 &tweak, char &letter) const
 get MrSID image version (for LizardTech internal use only) More...
 

Static Public Member Functions

static MrSIDImageReadercreate (void)
 
- Static Public Member Functions inherited from MrSIDImageReaderInterface
static LT_STATUS getMrSIDGeneration (const LTFileSpec &fileSpec, lt_uint8 &gen, bool &raster)
 get MrSID generation More...
 
static LT_STATUS getMrSIDGeneration (LTIOStreamInf &stream, lt_uint8 &gen, bool &raster)
 get MrSID generation More...
 
static LT_STATUS getMrSIDGeneration (const lt_uint8 version[8], lt_uint8 &gen, bool &raster)
 get MrSID generation More...
 

Protected Member Functions

 MrSIDImageReader (void)
 
virtual ~MrSIDImageReader (void)
 
LT_STATUS protectedInit (LTIOStreamInf *worldfile, bool deleteImages)
 
- 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)
 
void changePreviousStage (LTIImageStage *newPref)
 
- 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)
 
- Protected Member Functions inherited from MrSIDImageReaderInterface
 MrSIDImageReaderInterface ()
 
LT_STATUS init (MrSIDMemoryUsage memoryUsage, MrSIDStreamUsage streamUsage, const lt_uint8 preamble[8])
 

Protected Attributes

MrSIDImageStageManagerm_manager
 
LTIMosaicFilterm_mosaicFilter
 
MrSIDSingleImageReaderBasem_mrsidReader
 
lt_uint8 m_numLevels
 
bool m_isLocked
 
- Protected Attributes inherited from MrSIDImageReaderInterface
MrSIDMemoryUsage m_memoryUsage
 
MrSIDStreamUsage m_streamUsage
 
lt_uint8 m_magic [8]
 

Additional Inherited Members

- Static Protected Member Functions inherited from MrSIDImageReaderInterface
static LT_STATUS getGeoCoordFromMetadata (LTIMetadataDatabase &metadata, LTIGeoCoord &geoCoord, bool &hasGeo)
 
static LTIOStreamInfopenWorldFileStream (const LTFileSpec &fileSpec, bool useWorldFile)
 

Detailed Description

This class supports reading MrSID/MG2, MrSID/MG3, and MrSID/MG4 raster images, including MG3 and MG4 composites.

Examples:
DecodeMrSIDBandSelection.cpp, DecodeMrSIDToMemory.cpp, DecodeMrSIDToRaw.cpp, DecodeMrSIDToTIFF.cpp, ErrorHandling.cpp, GeoScene.cpp, ImageInfo.cpp, InterruptDelegate.cpp, MetadataDump.cpp, ProgressDelegate.cpp, and SceneBuffer.cpp.

Definition at line 35 of file MrSIDImageReader.h.

Constructor & Destructor Documentation

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

Member Function Documentation

virtual lt_int64 MrSIDImageReader::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.

const MrSIDImageStageManager& MrSIDImageReader::getManager ( void  ) const
int MrSIDImageReader::getMaxWorkerThreads ( ) const
virtual

This function gets the maximun number of worker threads that can be used during a decode request.

See Also
setMaxWorkerThreads() for details.
Returns
the maximum number of worker threads that may be used

Implements MrSIDImageReaderInterface.

const MG2ImageReader* MrSIDImageReader::getMG2ImageReader ( void  ) const
const MG3SingleImageReader* MrSIDImageReader::getMG3ImageReader ( void  ) const
const MG4SingleImageReader* MrSIDImageReader::getMG4ImageReader ( void  ) const
virtual lt_uint32 MrSIDImageReader::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.

const LTIMosaicFilter* MrSIDImageReader::getMosaicFilter ( void  ) const
lt_uint8 MrSIDImageReader::getNumLevels ( void  ) const
virtual

Returns the number of resolution levels supported by the image. This value returned corresponds to the LTIImage::getMinMagnification() function.

Returns
the number of resolution levels in the MrSID image

Implements MrSIDImageReaderInterface.

LT_STATUS MrSIDImageReader::initialize ( const LTFileSpec fileSpec,
bool  useWorldFile = false,
MrSIDMemoryUsage  memoryUsage = MRSID_MEMORY_USAGE_DEFAULT,
MrSIDStreamUsage  streamUsage = MRSID_STREAM_USAGE_DEFAULT 
)

Construct a MrSID reader from the given file.

Parameters
fileSpecfile containing MrSID image
useWorldFileincorporate world file data when reading image
memoryUsagecontrol memory resource usage
streamUsagecontrol stream resource usage
Examples:
DecodeMrSIDBandSelection.cpp, DecodeMrSIDToMemory.cpp, DecodeMrSIDToRaw.cpp, DecodeMrSIDToTIFF.cpp, ErrorHandling.cpp, GeoScene.cpp, ImageInfo.cpp, InterruptDelegate.cpp, MetadataDump.cpp, ProgressDelegate.cpp, and SceneBuffer.cpp.
LT_STATUS MrSIDImageReader::initialize ( LTIOStreamInf stream,
LTIOStreamInf worldFileStream = NULL,
MrSIDMemoryUsage  memoryUsage = MRSID_MEMORY_USAGE_DEFAULT,
MrSIDStreamUsage  streamUsage = MRSID_STREAM_USAGE_DEFAULT 
)

Construct a MrSID reader from the given stream.

Parameters
streamstream containing MrSID image (may not be NULL)
worldFileStreamstream containing world file data (may be NULL)
memoryUsagecontrol memory resource usage
streamUsagecontrol stream resource usage
bool MrSIDImageReader::isLocked ( void  ) const
virtual

Returns true iff the image is password-protected. If the image is locked, the setPasswordDelegate() or setPassword() function must be used to provide the decoder with information to decrypt the image as decode requests are processed.

Returns
true, if image is password-protected

Implements MrSIDImageReaderInterface.

LT_STATUS MrSIDImageReader::protectedInit ( LTIOStreamInf worldfile,
bool  deleteImages 
)
protected
void MrSIDImageReader::setMaxWorkerThreads ( int  numThreads)
virtual

This function sets the maximum number of worker threads that can be used during a decode request.

Parameters
numThreadsthe maximum number of threads to use, including the calling thread numThreads < 1 defaults to the number of logical cores
Note
: The internal decoder may use fewer threads. For example, MG2 does not use wroker threads.
: The internal decoder may limit the number of threads to the number of logical core on the system.

Implements MrSIDImageReaderInterface.

Examples:
DecodeMrSIDToMemory.cpp.

Member Data Documentation

bool MrSIDImageReader::m_isLocked
protected

Definition at line 99 of file MrSIDImageReader.h.

MrSIDImageStageManager* MrSIDImageReader::m_manager
protected

Definition at line 95 of file MrSIDImageReader.h.

LTIMosaicFilter* MrSIDImageReader::m_mosaicFilter
protected

Definition at line 96 of file MrSIDImageReader.h.

MrSIDSingleImageReaderBase* MrSIDImageReader::m_mrsidReader
protected

Definition at line 97 of file MrSIDImageReader.h.

lt_uint8 MrSIDImageReader::m_numLevels
protected

Definition at line 98 of file MrSIDImageReader.h.


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

LizardTech