MrSID Decode SDK for Raster Reference Manual  9.0.0.3864
NITFReaderManager.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 NITFReaderManager_H
00013 #define NITFReaderManager_H
00014 
00015 // lt_lib_base
00016 #include "lt_base.h"
00017 
00018 // lt_lib_mrsid_core
00019 #include "lti_geoImageReader.h"
00020 #include "lti_imageStageManager.h"
00021 
00022 LT_BEGIN_LIZARDTECH_NAMESPACE
00023 class LTFileSpec;
00024 class LTIOStreamInf;
00025 
00026 namespace Nitf
00027 {
00028    class ImageReader;
00029    class FileHeader;
00030    class ImageSegment;
00031    class GraphicSegment;
00032    class LabelSegment;
00033    class TextSegment;
00034    class DataSegment;
00035    class ReservedSegment;
00036    class FileMetadata;
00037    class SecurityMetadata;
00038 }
00039 
00040 
00053 class NITFReaderManager : public LTIImageStageManager
00054 {
00055    LTI_REFERENCE_COUNTED_BOILERPLATE(NITFReaderManager);
00056 public:
00066    LT_STATUS initialize(const LTFileSpec& fileSpec, bool useWorldFile=true);
00067 
00075    LT_STATUS initialize(LTIOStreamInf *stream);
00076 
00077    
00078    // not for public use
00079    // must be called before initialize
00080    LT_STATUS setTileMaskList(const lt_uint32* tileMaskList,
00081                              lt_uint32 tileMaskListLen);
00082 
00096    LT_STATUS createReader(Nitf::ImageReader*& reader, lt_uint32 idx);
00097 
00098    // not for public use - use createReader instead
00099    LT_STATUS createImageStage(lt_uint32 imageNumber,
00100                               LTIImageStage *&imageStage);
00101 
00117    void setCompat_2500B_N2(bool use2500B);
00118 
00127    bool getCompat_2500B_N2() const;
00128 
00129    lt_int64 getFileSize() const;
00130 
00134    const Nitf::FileHeader* getFileHeader() const;
00135 
00139    lt_uint32 getNumImageSegments() const;
00140 
00151    const Nitf::ImageSegment* getImageSegment(lt_uint32 num) const;
00152 
00156    const char* getImageSegmentIID1(lt_uint32 num) const;
00157 
00161    lt_uint32 getNumGraphicSegments() const;
00162 
00171    const Nitf::GraphicSegment* getGraphicSegment(lt_uint32 num) const;
00172 
00176    lt_uint32 getNumLabelSegments() const;
00177 
00186    const Nitf::LabelSegment* getLabelSegment(lt_uint32 num) const;
00187 
00191    lt_uint32 getNumTextSegments() const;
00192 
00201    const Nitf::TextSegment* getTextSegment(lt_uint32 num) const;
00202 
00206    lt_uint32 getNumDataSegments() const;
00207 
00216    const Nitf::DataSegment* getDataSegment(lt_uint32 num) const;
00217 
00221    lt_uint32 getNumResSegments() const;
00222 
00231    const Nitf::ReservedSegment* getResSegment(lt_uint32 num) const;
00232 
00236    const char* getVersionString() const;
00237 
00241    const Nitf::FileMetadata* getFileMetadata() const;
00242 
00246    const Nitf::SecurityMetadata* getSecurityMetadata() const;
00247 
00248    // not for public use
00249    LTFileSpec* getFileSpec() const;
00250 
00251 private:
00252     LT_STATUS fixMetadata(LTIImageStage *mos);
00253 
00254    LTFileSpec *m_fileSpec;
00255    LTIOStreamInf *m_stream;
00256    bool m_ownStream;
00257    lt_int64 m_fileSize;
00258    bool m_useWorldFile;
00259 
00260    Nitf::FileHeader* m_fileHeader;
00261    Nitf::ImageSegment** m_imageSegments;
00262    Nitf::GraphicSegment** m_graphicSegments;
00263    Nitf::LabelSegment** m_labelSegments;
00264    Nitf::TextSegment** m_textSegments;
00265    Nitf::DataSegment** m_dataSegments;
00266    Nitf::ReservedSegment** m_resSegments;
00267    lt_uint32 m_numImageSegments;
00268    lt_uint32 m_numGraphicSegments;
00269    lt_uint32 m_numLabelSegments;
00270    lt_uint32 m_numTextSegments;
00271    lt_uint32 m_numDataSegments;
00272    lt_uint32 m_numResSegments;
00273 
00274    char* m_versionString;
00275 
00276    bool m_compat_2500B_N2;
00277 
00278    const lt_uint32* m_tileMaskList;
00279    lt_uint32 m_tileMaskListLen;
00280 };
00281 
00282 
00283 LT_END_LIZARDTECH_NAMESPACE
00284 
00285 #endif // NITFReaderManager_H