MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
BMPImageWriter.h
Go to the documentation of this file.
00001 /* $Id$ */
00002 /* //////////////////////////////////////////////////////////////////////////
00003 //                                                                         //
00004 // This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue,   //
00005 // Suite 200, Seattle, WA 98104.  Unauthorized use or distribution         //
00006 // prohibited.  Access to and use of this code is permitted only under     //
00007 // license from LizardTech, Inc.  Portions of the code are protected by    //
00008 // US and foreign patents and other filings. All Rights Reserved.          //
00009 //                                                                         //
00011 /* PUBLIC */
00012 
00013 #ifndef BMPIMAGEWRITER_H
00014 #define BMPIMAGEWRITER_H
00015 
00016 // lt_lib_mrsid_core
00017 #include "lti_geoFileImageWriter.h"
00018 
00019 // lt_lib_utils
00020 #include "lti_imageWriter.h"
00021 
00022 
00023 LT_BEGIN_NAMESPACE(LizardTech)
00024 
00025 #if defined(LT_COMPILER_MS)
00026    #pragma warning(push,4)
00027 #endif
00028 
00029 class LTReusableBuffer;
00030 class LTIBandSelectFilter;
00031 
00037 class BMPImageWriter : public LTIGeoFileImageWriter
00038 {
00039    LT_DISALLOW_COPY_CONSTRUCTOR(BMPImageWriter);
00040 public:
00041    BMPImageWriter(void);
00042    ~BMPImageWriter(void);
00043    
00044    LT_STATUS initialize(LTIImageStage* image);
00045 
00046    LT_STATUS writeBegin(const LTIScene& scene);
00047    LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
00048    LT_STATUS writeEnd();
00049 
00050 private:
00051    LT_STATUS checkImpedance() const;
00052 
00053    LT_STATUS normalizeProperties(lt_uint32 width, lt_uint32 height);
00054    LT_STATUS initFile(lt_uint32 width, lt_uint32 height);
00055    LT_STATUS writeHeaders(lt_uint32 width, lt_uint32 height);
00056    LT_STATUS initBitmapHeader(lt_uint32 width, lt_uint32 height);
00057    LT_STATUS initEndian();
00058    LT_STATUS writeStrip(lt_uint32 stripHeight,
00059                         const lt_uint8* buf);
00060 
00061    lt_uint32 m_alignedRowBytes;
00062    lt_uint32 m_unalignedRowBytes;
00063    lt_uint8* m_padding;
00064    lt_uint32 m_padsize;
00065 
00066    struct bitmapFileHeaderType;
00067    struct bitmapHeaderType;
00068 
00069    bitmapFileHeaderType* m_bmpFileHeader;
00070    bitmapHeaderType* m_bmpHeader;
00071 
00072    //  This will provide a marker so the image doesn't write over itself
00073    // I need to know how far back to seek.
00074    lt_int32 m_seekBackTo;
00075 
00076    LTReusableBuffer* m_stripBuffer;
00077 };
00078 
00079 
00080 LT_END_NAMESPACE(LizardTech)
00081 
00082 #if defined(LT_COMPILER_MS)
00083    #pragma warning(pop)
00084 #endif
00085 
00086 #endif // BMPIMAGEWRITER_H