MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
ImageReader.h
Go to the documentation of this file.
00001 /* //////////////////////////////////////////////////////////////////////////
00002 //                                                                         //
00003 // This code is Copyright (c) 2010 LizardTech, Inc, 1008 Western Avenue,   //
00004 // Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
00005 // prohibited.  Access to and use of this code is permitted only under     //
00006 // license from LizardTech, Inc.  Portions of the code are protected by    //
00007 // US and foreign patents and other filings. All Rights Reserved.          //
00008 //                                                                         //
00010 /* PUBLIC */
00011 
00012 #ifndef ImageReader_H
00013 #define ImageReader_H
00014 
00015 // lt_lib_base
00016 #include "lt_base.h"
00017 
00018 // lt_lib_mrsid_core
00019 #include "lti_geoImageReader.h"
00020 
00021 // local
00022 #include "nitf_types.h"
00023 
00024 LT_BEGIN_LIZARDTECH_NAMESPACE
00025 class LTFileSpec;
00026 class LTIOStreamInf;
00027 class LTReusableBuffer;
00028 class NITFReaderManager;
00029 
00030 namespace Nitf {
00031 class FileHeader;
00032 class ImageSegment;
00033 class ImageSegmentMetadata;
00034 class SecurityMetadata;
00035 
00036 
00046 class ImageReader : public LTIGeoImageReader
00047 {
00048    LT_DISALLOW_COPY_CONSTRUCTOR(ImageReader);
00049 public:
00053    const char* getIID1() const;
00054 
00055    lt_int64 getPhysicalFileSize() const;
00056 
00057    // not for public use
00058    NITFReaderManager& getManager() const;
00059 
00063    Format getFormat() const;
00064 
00068    Layout getLayout() const;
00069 
00073    bool isBlocked() const;
00074 
00078    bool isMasked() const;
00079 
00083   int getSegmentNumber() const;
00084 
00088   const ImageSegmentMetadata* getImageMetadata() const;
00089 
00093   const SecurityMetadata* getSecurityMetadata() const;
00094 
00095   // inherited
00096   LT_STATUS getDimsAtMag(double mag,
00097                          lt_uint32& width,
00098                          lt_uint32& height) const = 0;
00099 
00100 protected:
00101    ~ImageReader(void);
00102    ImageReader(bool supportBandSelection);
00103 
00104    const char *getSourceName(void) const;
00105    
00106    LT_STATUS init(LTIOStreamInf *stream,
00107                   NITFReaderManager *manager,
00108                   const ImageSegment *imageSegment,
00109                   bool useWorldFile);
00110 
00111    LT_STATUS addUnderlyingMetadata(const LTIImageStage &image);
00112 
00113    // blocked image support
00114    LTIScene computeBlockedScene(const LTIScene& scene) const;
00115    LT_STATUS copyIntoUserBuffer(const LTIScene& dstScene,
00116                                 LTISceneBuffer& dstBuffer) const;
00117    bool activeSceneContains(const LTIScene& scene) const;
00118    void putBlockIntoBuffer_SEQ(LTISceneBuffer& cBuffer,
00119                                lt_uint8* buf,
00120                                lt_uint32 blockRow,
00121                                lt_uint32 blockCol,
00122                                lt_uint32 blockBand) const;
00123    void putBlockIntoBuffer_BLOCK(LTISceneBuffer& cBuffer,
00124                                  lt_uint8* buf,
00125                                  lt_uint32 blockRow,
00126                                  lt_uint32 blockCol) const;
00127    void putBlockIntoBuffer_PIXEL(LTISceneBuffer& cBuffer,
00128                                lt_uint8* buf,
00129                                lt_uint32 blockRow,
00130                                lt_uint32 blockCol) const;
00131    void putBlockIntoBuffer_ROW(LTISceneBuffer& cBuffer,
00132                                lt_uint8* buf,
00133                                lt_uint32 blockRow,
00134                                lt_uint32 blockCol) const;
00135 
00136    
00137    
00138    LTIOStreamInf *m_stream;
00139    NITFReaderManager *m_manager;
00140    
00141    const ImageSegment *m_imageSegment;
00142    const FileHeader *m_fileHeader;
00143    
00144    LTReusableBuffer *m_reusableBuffer;
00145    LTIScene *m_activeScene;
00146    LTISceneBuffer *m_activeSceneBuffer;
00147 };
00148 
00149 
00150 }
00151 LT_END_LIZARDTECH_NAMESPACE
00152 
00153 #endif // ImageReader_H