MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
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 
00090    LT_STATUS createReader(Nitf::ImageReader*& reader, lt_uint32 idx);
00091 
00107    LT_STATUS createImageStage(lt_uint32 imageNumber,
00108                               LTIImageStage *&imageStage);
00109 
00125    void setCompat_2500B_N2(bool use2500B);
00126 
00135    bool getCompat_2500B_N2() const;
00136 
00137    lt_int64 getFileSize() const;
00138 
00142    const Nitf::FileHeader* getFileHeader() const;
00143 
00147    lt_uint32 getNumImageSegments() const;
00148 
00159    const Nitf::ImageSegment* getImageSegment(lt_uint32 num) const;
00160 
00164    const char* getImageSegmentIID1(lt_uint32 num) const;
00165 
00169    lt_uint32 getNumGraphicSegments() const;
00170 
00179    const Nitf::GraphicSegment* getGraphicSegment(lt_uint32 num) const;
00180 
00184    lt_uint32 getNumLabelSegments() const;
00185 
00194    const Nitf::LabelSegment* getLabelSegment(lt_uint32 num) const;
00195 
00199    lt_uint32 getNumTextSegments() const;
00200 
00209    const Nitf::TextSegment* getTextSegment(lt_uint32 num) const;
00210 
00214    lt_uint32 getNumDataSegments() const;
00215 
00224    const Nitf::DataSegment* getDataSegment(lt_uint32 num) const;
00225 
00229    lt_uint32 getNumResSegments() const;
00230 
00239    const Nitf::ReservedSegment* getResSegment(lt_uint32 num) const;
00240 
00244    const char* getVersionString() const;
00245 
00249    const Nitf::FileMetadata* getFileMetadata() const;
00250 
00254    const Nitf::SecurityMetadata* getSecurityMetadata() const;
00255 
00256    // not for public use
00257    LTFileSpec* getFileSpec() const;
00258 
00259 private:
00260     LT_STATUS fixMetadata(LTIImageStage *mos);
00261 
00262    LTFileSpec *m_fileSpec;
00263    LTIOStreamInf *m_stream;
00264    bool m_ownStream;
00265    lt_int64 m_fileSize;
00266    bool m_useWorldFile;
00267 
00268    Nitf::FileHeader* m_fileHeader;
00269    Nitf::ImageSegment** m_imageSegments;
00270    Nitf::GraphicSegment** m_graphicSegments;
00271    Nitf::LabelSegment** m_labelSegments;
00272    Nitf::TextSegment** m_textSegments;
00273    Nitf::DataSegment** m_dataSegments;
00274    Nitf::ReservedSegment** m_resSegments;
00275    lt_uint32 m_numImageSegments;
00276    lt_uint32 m_numGraphicSegments;
00277    lt_uint32 m_numLabelSegments;
00278    lt_uint32 m_numTextSegments;
00279    lt_uint32 m_numDataSegments;
00280    lt_uint32 m_numResSegments;
00281 
00282    char* m_versionString;
00283 
00284    bool m_compat_2500B_N2;
00285 };
00286 
00287 
00288 LT_END_LIZARDTECH_NAMESPACE
00289 
00290 #endif // NITFReaderManager_H