svn-gvsig-desktop / trunk / libraries / libjni-mrsid / include / writers / BMPImageWriter.h @ 3539
History | View | Annotate | Download (2.75 KB)
1 |
/* $Id: BMPImageWriter.h 3539 2006-01-09 12:23:20Z nacho $ */
|
---|---|
2 |
/* //////////////////////////////////////////////////////////////////////////
|
3 |
// //
|
4 |
// This code is Copyright (c) 2004 LizardTech, Inc, 1008 Western Avenue, //
|
5 |
// Suite 200, Seattle, WA 98104. Unauthorized use or distribution //
|
6 |
// prohibited. Access to and use of this code is permitted only under //
|
7 |
// license from LizardTech, Inc. Portions of the code are protected by //
|
8 |
// US and foreign patents and other filings. All Rights Reserved. //
|
9 |
// //
|
10 |
////////////////////////////////////////////////////////////////////////// */
|
11 |
/* PUBLIC */
|
12 |
|
13 |
#ifndef BMPIMAGEWRITER_H
|
14 |
#define BMPIMAGEWRITER_H
|
15 |
|
16 |
// lt_lib_mrsid_core
|
17 |
#include "lti_geoFileImageWriter.h" |
18 |
|
19 |
// lt_lib_utils
|
20 |
#include "lti_imageWriter.h" |
21 |
|
22 |
|
23 |
LT_BEGIN_NAMESPACE(LizardTech) |
24 |
|
25 |
#if defined(LT_COMPILER_MS)
|
26 |
#pragma warning(push,4) |
27 |
#endif
|
28 |
|
29 |
class LTReusableBuffer; |
30 |
|
31 |
/**
|
32 |
* writes an image stage to a Windows BMP file
|
33 |
*
|
34 |
* This class writes an image stage to a Windows BMP file.
|
35 |
*/
|
36 |
class BMPImageWriter : public LTIGeoFileImageWriter |
37 |
{ |
38 |
public:
|
39 |
/**
|
40 |
* constructor
|
41 |
*
|
42 |
* Creates a writer for Windows BMP images.
|
43 |
*
|
44 |
* @param image the image to write from
|
45 |
*/
|
46 |
BMPImageWriter(LTIImageStage* image); |
47 |
virtual ~BMPImageWriter(); |
48 |
LT_STATUS initialize(); |
49 |
|
50 |
LT_STATUS writeBegin(const LTIScene& scene);
|
51 |
LT_STATUS writeStrip(LTISceneBuffer& stripBuffer, const LTIScene& stripScene);
|
52 |
LT_STATUS writeEnd(); |
53 |
|
54 |
private:
|
55 |
typedef LTIGeoFileImageWriter Super;
|
56 |
|
57 |
LT_STATUS checkImpedance() const;
|
58 |
|
59 |
// override from LTIImageFilter
|
60 |
LTIImageStage* getPreviousStage() const;
|
61 |
|
62 |
LT_STATUS normalizeProperties(lt_uint32 width, lt_uint32 height); |
63 |
LT_STATUS initFile(lt_uint32 width, lt_uint32 height); |
64 |
LT_STATUS writeHeaders(lt_uint32 width, lt_uint32 height); |
65 |
LT_STATUS initBitmapHeader(lt_uint32 width, lt_uint32 height); |
66 |
LT_STATUS initEndian(); |
67 |
LT_STATUS writeStrip(lt_uint32 stripHeight, |
68 |
const lt_uint8* buf);
|
69 |
|
70 |
LTIImageStage* m_mapTransform; |
71 |
|
72 |
lt_uint32 m_alignedRowBytes; |
73 |
lt_uint32 m_unalignedRowBytes; |
74 |
lt_uint8* m_padding; |
75 |
lt_uint32 m_padsize; |
76 |
|
77 |
struct bitmapFileHeaderType;
|
78 |
struct bitmapHeaderType;
|
79 |
|
80 |
bitmapFileHeaderType* m_bmpFileHeader; |
81 |
bitmapHeaderType* m_bmpHeader; |
82 |
|
83 |
// This will provide a marker so the image doesn't write over itself
|
84 |
// I need to know how far back to seek.
|
85 |
int m_seekBackTo;
|
86 |
|
87 |
LTReusableBuffer* m_stripBuffer; |
88 |
|
89 |
// nope
|
90 |
BMPImageWriter(); |
91 |
BMPImageWriter(BMPImageWriter&); |
92 |
BMPImageWriter& operator=(const BMPImageWriter&);
|
93 |
}; |
94 |
|
95 |
|
96 |
LT_END_NAMESPACE(LizardTech) |
97 |
|
98 |
#if defined(LT_COMPILER_MS)
|
99 |
#pragma warning(pop)
|
100 |
#endif
|
101 |
|
102 |
#endif // BMPIMAGEWRITER_H |