MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
lti_bbbImageReader.h
Go to the documentation of this file.
1 /* $Id$ */
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 // //
11 /* PUBLIC */
12 
13 #ifndef LTI_BBB_IMAGE_READER_H
14 #define LTI_BBB_IMAGE_READER_H
15 
16 // lt_lib_mrsid_core
17 #include "lti_rawImageReader.h"
18 
19 // system
20 #include <stdio.h> // for FILE*
21 
22 LT_BEGIN_NAMESPACE(LizardTech)
23 
24 class LTIBBBHeaderReader;
25 
34 {
36 public:
45  LT_STATUS initialize(const LTFileSpec& fileSpec, bool useWorldFile = true);
46 
55  LT_STATUS initialize(const char* file, bool useWorldFile = true);
56 };
57 
58 #ifndef DOXYGEN_EXCLUDE
59 
60 class LTIBBBHeaderReader
61 {
62  LT_DISALLOW_COPY_CONSTRUCTOR(LTIBBBHeaderReader);
63 
64 public:
65  LTIBBBHeaderReader(const LTFileSpec&);
66  ~LTIBBBHeaderReader();
67  LT_STATUS read();
68 
69 public:
70  int m_width;
71  int m_height;
72  LTIDataType m_dataType;
73  LTIColorSpace m_colorSpace;
74  int m_numBands;
75  LTILayout m_layout;
76  char* m_byteOrder;
77  int m_numBits;
78  LTIEndian m_endian;
79 
80  double m_window;
81  double m_level;
82  double m_drMin;
83  double m_drMax;
84  bool m_hasWindow;
85  bool m_hasLevel;
86  bool m_hasDRMin;
87  bool m_hasDRMax;
88 
89  int m_bandgapbytes;
90  int m_bandrowbytes;
91  int m_totalrowbytes;
92  int m_skipbytes;
93 
94  bool m_hasUlxmap;
95  bool m_hasUlymap;
96  bool m_hasXllcorner;
97  bool m_hasYllcorner;
98  bool m_hasXllcenter;
99  bool m_hasYllcenter;
100  bool m_hasXdim;
101  bool m_hasYdim;
102  bool m_hasCellsize;
103  double m_ulxmap;
104  double m_ulymap;
105  double m_xllcorner;
106  double m_yllcorner;
107  double m_xllcenter;
108  double m_yllcenter;
109  double m_xdim;
110  double m_ydim;
111  double m_cellsize;
112 
113  // Imagine header data
114  bool m_bFromImagine; //indicates whether to display Imagine Metadata
115  char* m_projname;
116  char* m_sphereName;
117  char* m_units;
118  int m_proZone;
119  double* m_projParams;
120  double m_sphereMajor;
121  double m_sphereMinor;
122  double m_sphereEccentricitySquared;
123  double m_sphereRadius;
124 
125  char* m_wkt;
126  double* m_nodata;
127  int m_nodataSize;
128 
129 private:
130  LT_STATUS init();
131  LT_STATUS finish();
132  LT_STATUS readLines();
133  LT_STATUS readLine(int& offset_last, bool& done);
134  LT_STATUS nextLine();
135  LT_STATUS readInt(int&);
136  LT_STATUS readDouble(double&);
137  LT_STATUS readString(char*);
138 
139  const LTFileSpec& m_fileSpec;
140  FILE* m_fp;
141 };
142 #endif
143 
144 LT_END_NAMESPACE(LizardTech)
145 
146 #endif // LTI_BBB_IMAGE_READER_H

LizardTech