MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
lti_sample.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_SAMPLE_H
14 #define LTI_SAMPLE_H
15 
16 // lt_lib_mrsid_core
17 #include "lti_types.h"
18 
19 LT_BEGIN_NAMESPACE(LizardTech)
20 
21 
28 class LTISample
29 {
30 public:
42  LTISample(lt_uint16 srcBandIndex,
43  LTIColor color,
44  LTIDataType dataType,
45  const void *data = NULL);
46 
47  LTISample();
48 
52  LTISample(const LTISample&);
53 
57  virtual ~LTISample();
58 
62  virtual LTISample& operator=(const LTISample&);
63 
67  bool operator==(const LTISample&) const;
68 
72  bool operator!=(const LTISample&) const;
73 
81  lt_uint16 getSourceBandIndex() const;
82 
90  LTIDataType getDataType() const;
91 
99  LTIColor getColor() const;
100 
112  void setPrecision(lt_uint32 precision);
113 
121  lt_uint32 getPrecision() const;
122 
132  lt_uint32 getNumBytes() const;
133 
143  LT_STATUS checkImpedance(const LTISample& sample) const;
144 
150  bool isValueMin() const;
151 
157  bool isValueMax() const;
158 
164  void setValueToMin();
165 
171  void setValueToMax();
172 
179  void setValueToMin(const LTISample&);
180 
187  void setValueToMax(const LTISample&);
188 
197  void setValueAddr(const void*);
198  const void* getValueAddr() const;
199 
200  void setValueUint8(lt_uint8);
201  void setValueUint16(lt_uint16);
202  void setValueUint32(lt_uint32);
203  void setValueSint8(lt_int8);
204  void setValueSint16(lt_int16);
205  void setValueSint32(lt_int32);
206  void setValueFloat32(float);
207  void setValueFloat64(double);
208 
209  lt_uint8 getValueUint8() const;
210  lt_uint16 getValueUint16() const;
211  lt_uint32 getValueUint32() const;
212  lt_int8 getValueSint8() const;
213  lt_int16 getValueSint16() const;
214  lt_int32 getValueSint32() const;
215  float getValueFloat32() const;
216  double getValueFloat64() const;
217 
218  void setValueFromDouble(double);
219  double getValueAsDouble() const;
222 private:
223  union ValueType
224  {
225  lt_uint8 uint8;
226  lt_uint16 uint16;
227  lt_uint32 uint32;
228 
229  lt_int8 sint8;
230  lt_int16 sint16;
231  lt_int32 sint32;
232 
233  float float32;
234  double float64;
235 
236  //float complex32[2];
237  //double complex64[2];
238  };
239 
240  lt_uint16 m_srcIndex;
241  LTIDataType m_dataType;
242  LTIColor m_color;
243  lt_uint32 m_numBytes;
244  lt_uint32 m_precision;
245  ValueType m_value;
246 };
247 
248 
249 LT_END_NAMESPACE(LizardTech)
250 
251 #endif // LTI_SAMPLE_H

LizardTech