MrSID Decode SDK for Raster Reference Manual 9.5.5.5244
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=nullptr, 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 MrSIDImageStageManager & getManager (void) const
 
const LTIMosaicFilter * getMosaicFilter (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 LTIPixel & getPixelProps () const
 get the pixel properties of the image More...
 
const LTIPixel * getBackgroundPixel () const
 get the values of the background pixel More...
 
const LTIPixel * getNoDataPixel () const
 get the values of the "no data" (transparency) pixel More...
 
const LTIPixelLookupTable * getPixelLookupTable () const
 get the color lookup table, if any More...
 
const LTIPixel & getMinDynamicRange () const
 get the minimum dynamic range value of image More...
 
const LTIPixel & getMaxDynamicRange () const
 get the maximum dynamic range value of image More...
 
const LTIGeoCoord & getGeoCoord () const
 get the geographic coordinates of the image More...
 
bool isGeoCoordImplicit () const
 is geo information "real" or not More...
 
const LTIMetadataDatabase & getMetadata () 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...
 
lt_uint32 getModifications (const LTIScene &scene) const
 get the modification bitfield for this image More...
 
LT_STATUS getMetadataBlob (const char *type, LTIOStreamInf *&stream) const
 extract the metadata associated with the image of the given type More...
 
bool hasMetadataBlob (const char *type) const
 
void setProgressDelegate (LTIProgressDelegate *delegate)
 set progress delegate More...
 
LTIProgressDelegate * getProgressDelegate () const
 get progress delegate More...
 
void setInterruptDelegate (LTIInterruptDelegate *delegate)
 set interrupt delegate More...
 
LTIInterruptDelegate * getInterruptDelegate () 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...
 
LT_STATUS overrideColorSpace (LTIColorSpace colorspace)
 override the colorspace of all the pixel properties (PixelProps, NoData, Background, Min/MaxDynamicRange) More...
 
LTIMaskSource * getMask () const
 
bool getPipelineInfo (LTIPipelineInfo info) const
 
LTIImageStage * getPreviousStage (void) const
 
- Public Member Functions inherited from LTIImageStage
virtual void setProgressDelegate (LTIProgressDelegate *delegate)=0
 set progress delegate More...
 
virtual LTIProgressDelegate * getProgressDelegate () const =0
 get progress delegate More...
 
virtual void setInterruptDelegate (LTIInterruptDelegate *delegate)=0
 set interrupt delegate More...
 
virtual LTIInterruptDelegate * getInterruptDelegate () const =0
 get interrupt delegate More...
 
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...
 
virtual lt_uint32 getStripHeight () const =0
 get strip height More...
 
virtual LT_STATUS setStripHeight (lt_uint32 stripHeight)=0
 set the strip height More...
 
virtual lt_int64 getEncodingCost (const LTIScene &scene) const =0
 get the cost to encode this scene More...
 
virtual bool getReaderScene (const LTIScene &decodeScene, LTIScene &readerScene) const =0
 get the underlying scene to be used 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...
 
virtual LT_STATUS overrideBackgroundPixel (const LTIPixel *backgroundPixel)=0
 override the background color of the image More...
 
virtual LT_STATUS overrideNoDataPixel (const LTIPixel *nodataPixel)=0
 override the "no data" (transparency) color of the image More...
 
virtual LT_STATUS overrideGeoCoord (const LTIGeoCoord &geoCoord)=0
 override the geographic coordinates of the image More...
 
virtual LT_STATUS overrideDynamicRange (const LTIPixel &drmin, const LTIPixel &drmax)=0
 override the dynamic range of the image More...
 
virtual LT_STATUS overridePixelBPS (lt_uint8)=0
 override the bits-per-sample of the image's (sample's) datatype More...
 
virtual LT_STATUS overridePixelLookupTable (const LTIPixelLookupTable *pixelLookupTable)=0
 override the CLUT of the image More...
 
virtual LT_STATUS overrideMetadata (const LTIMetadataDatabase &metadata)=0
 override the metadata of the image More...
 
virtual LT_STATUS overrideColorSpace (LTIColorSpace colorspace)=0
 override the colorspace of all the pixel properties (PixelProps, NoData, Background, Min/MaxDynamicRange) More...
 
virtual LTIMaskSource * getMask () const =0
 
virtual bool getPipelineInfo (LTIPipelineInfo info) const =0
 
virtual LTIImageStage * getPreviousStage () const =0
 
- Public Member Functions inherited from LTIImage
virtual lt_uint32 getWidth () const =0
 get image width More...
 
virtual lt_uint32 getHeight () const =0
 get image height More...
 
virtual LT_STATUS getDimsAtMag (double mag, lt_uint32 &width, lt_uint32 &height) const =0
 get image width and height at given magnification More...
 
lt_uint16 getNumBands () const
 get number of bands More...
 
lt_uint16 getNumBandsWithoutAlpha () const
 get number of bands without alpha More...
 
LTIColorSpace getColorSpace () const
 get colorspace More...
 
LTIDataType getDataType () const
 get data type More...
 
virtual const LTIPixel & getPixelProps () const =0
 get the pixel properties of the image More...
 
virtual const LTIPixel * getBackgroundPixel () const =0
 get the values of the background pixel More...
 
virtual const LTIPixel * getNoDataPixel () const =0
 get the values of the "no data" (transparency) pixel More...
 
virtual const LTIPixelLookupTable * getPixelLookupTable () const =0
 get the color lookup table, if any More...
 
virtual const LTIPixel & getMinDynamicRange () const =0
 get the minimum dynamic range value of image More...
 
virtual const LTIPixel & getMaxDynamicRange () const =0
 get the maximum dynamic range value of image More...
 
bool isNaturalDynamicRange () const
 check if the range is "complete" or not More...
 
virtual const LTIGeoCoord & getGeoCoord () const =0
 get the geographic coordinates of the image More...
 
virtual bool isGeoCoordImplicit () const =0
 is geo information "real" or not More...
 
virtual const LTIMetadataDatabase & getMetadata () const =0
 get the metadata associated with the image More...
 
virtual double getMinMagnification () const =0
 get the minimum magnification More...
 
virtual double getMaxMagnification () const =0
 get the maximum magnification More...
 
virtual bool isSelective () const =0
 check if image supports "random access" decoding More...
 
virtual lt_uint32 getModifications (const LTIScene &scene) const =0
 get the modification bitfield for this image More...
 
virtual LT_STATUS getMetadataBlob (const char *type, LTIOStreamInf *&stream) const
 extract the metadata associated with the image of the given type More...
 
virtual bool hasMetadataBlob (const char *type) const
 
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...
 
LTIPixel * createBackgroundPixel () 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 ()
 
virtual lt_uint8 getNumLevels () const =0
 get number of resolution levels More...
 
virtual bool isLocked () const =0
 image encryption query More...
 
void setPasswordDelegate (MrSIDPasswordDelegate *passwordDelegate)
 set password handler More...
 
void setPassword (const lt_utf8 *password)
 set password handler More...
 
virtual void setMaxWorkerThreads (int numThreads)=0
 set the maximum number of worker threads More...
 
virtual int getMaxWorkerThreads () const =0
 get the maximum number of worker threads 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 MrSIDImageReader * create (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
 
virtual LT_STATUS decodeBegin (const LTIPixel &pixelProps, const LTIScene &fullScene)=0
 start strip-based read More...
 
virtual LT_STATUS decodeStrip (LTISceneBuffer &stripBuffer, const LTIScene &stripScene)=0
 read a strip from the image More...
 
virtual LT_STATUS decodeEnd (void)=0
 finish strip-based read More...
 
const LTIScene & getFullScene () 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

MrSIDImageStageManager * m_manager
 
LTIMosaicFilter * m_mosaicFilter
 
MrSIDSingleImageReaderBase * m_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 LTIOStreamInf * openWorldFileStream (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 30 of file MrSIDImageReader.h.

Constructor & Destructor Documentation

◆ MrSIDImageReader()

MrSIDImageReader::MrSIDImageReader ( void  )
protected

◆ ~MrSIDImageReader()

virtual MrSIDImageReader::~MrSIDImageReader ( void  )
protectedvirtual

Member Function Documentation

◆ create()

◆ getEncodingCost()

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.

◆ getManager()

const MrSIDImageStageManager & MrSIDImageReader::getManager ( void  ) const

◆ getMaxWorkerThreads()

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.

◆ getMG2ImageReader()

const MG2ImageReader * MrSIDImageReader::getMG2ImageReader ( void  ) const

◆ getMG3ImageReader()

const MG3SingleImageReader * MrSIDImageReader::getMG3ImageReader ( void  ) const

◆ getMG4ImageReader()

const MG4SingleImageReader * MrSIDImageReader::getMG4ImageReader ( void  ) const

◆ getModifications()

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.

◆ getMosaicFilter()

const LTIMosaicFilter * MrSIDImageReader::getMosaicFilter ( void  ) const

◆ getNumLevels()

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.

◆ initialize() [1/2]

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.

◆ initialize() [2/2]

LT_STATUS MrSIDImageReader::initialize ( LTIOStreamInf *  stream,
LTIOStreamInf *  worldFileStream = nullptr,
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 nullptr)
worldFileStreamstream containing world file data (may be nullptr)
memoryUsagecontrol memory resource usage
streamUsagecontrol stream resource usage

◆ isLocked()

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.

◆ protectedInit()

LT_STATUS MrSIDImageReader::protectedInit ( LTIOStreamInf *  worldfile,
bool  deleteImages 
)
protected

◆ setMaxWorkerThreads()

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 value less than 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

◆ m_isLocked

bool MrSIDImageReader::m_isLocked
protected

Definition at line 94 of file MrSIDImageReader.h.

◆ m_manager

MrSIDImageStageManager* MrSIDImageReader::m_manager
protected

Definition at line 90 of file MrSIDImageReader.h.

◆ m_mosaicFilter

LTIMosaicFilter* MrSIDImageReader::m_mosaicFilter
protected

Definition at line 91 of file MrSIDImageReader.h.

◆ m_mrsidReader

MrSIDSingleImageReaderBase* MrSIDImageReader::m_mrsidReader
protected

Definition at line 92 of file MrSIDImageReader.h.

◆ m_numLevels

lt_uint8 MrSIDImageReader::m_numLevels
protected

Definition at line 93 of file MrSIDImageReader.h.


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

Extensis