MrSID Decode SDK for Raster Reference Manual  9.5.1.4427
lti_pixel.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_PIXEL_H
14 #define LTI_PIXEL_H
15 
16 // lt_lib_mrsid_core
17 #include "lti_sample.h"
18 
19 
20 LT_BEGIN_NAMESPACE(LizardTech)
21 
22 
23 
36 class LTIPixel
37 {
38 public:
45  LTIPixel(void);
46 
58  LTIPixel(LTIColorSpace colorSpace,
59  lt_uint16 numBands,
60  LTIDataType dataType,
61  const LTISample* samples = NULL);
62 
73  LTIPixel(const LTIPixel &pixel,
74  const lt_uint16 *bandSelection,
75  lt_uint16 numBands);
76 
90  LTIPixel(const LTISample* samples,
91  lt_uint16 numBands,
93 
97  LTIPixel(const LTIPixel&);
98 
102  virtual ~LTIPixel();
103 
107  LTIPixel& operator=(const LTIPixel&);
108 
112  bool operator==(const LTIPixel&) const;
113 
117  bool operator!=(const LTIPixel&) const;
118 
127  lt_uint16 getNumBands() const;
128 
137  lt_uint16 getNumBandsWithoutAlpha() const;
138 
148  LTIDataType getDataType() const;
149  bool isSignedData() const;
150 
158  LTIColorSpace getColorSpace() const;
159 
167  LTIColorSpace getColorSpaceWithoutAlpha() const;
168 
174  bool hasAlphaBand() const;
175 
181  bool hasPreMultipliedAlphaBand() const;
182 
186  bool isMultiSpectral() const;
187 
198  lt_uint32 getNumBytes() const;
199 
210  lt_uint32 getNumBytesWithoutAlpha() const;
211 
220  lt_uint32 getMaxBytesPerSample() const;
221 
231  LT_STATUS checkImpedance(const LTIPixel& pixel,
232  bool enforceColorSpace = true) const;
233  LT_STATUS checkImpedanceWithoutAlpha(const LTIPixel& pixel) const;
234 
235  LTISample *getSamples() const;
236  LTISample &getSample(lt_uint16) const;
237 
238 //#define DEPRECATE_PIXEL_HELPERS
239 #ifndef DEPRECATE_PIXEL_HELPERS
240 
244 
254  const void* getSampleValueAddr(lt_uint16 band) const;
255 
265  lt_uint8 getSampleValueUint8(lt_uint16 band) const;
266 
276  lt_int8 getSampleValueSint8(lt_uint16 band) const;
277 
287  lt_uint16 getSampleValueUint16(lt_uint16 band) const;
288 
298  lt_int16 getSampleValueSint16(lt_uint16 band) const;
299 
309  lt_uint32 getSampleValueUint32(lt_uint16 band) const;
310 
320  lt_int32 getSampleValueSint32(lt_uint16 band) const;
321 
331  float getSampleValueFloat32(lt_uint16 band) const;
332 
342  double getSampleValueFloat64(lt_uint16 band) const;
343 #endif
344 
350  bool areSampleValuesMin() const;
351 
357  bool areSampleValuesMax() const;
358 
359 
366 
372  void setSampleValuesToMin();
373 
379  void setSampleValuesToMax();
380 
381 #ifndef DEPRECATE_PIXEL_HELPERS
382 
390  void setSampleValueAddr(lt_uint16 band, const void* data) const;
391 
400  void setSampleValuesUint8(lt_uint8 value);
401 
410  void setSampleValuesSint8(lt_int8 value);
411 
420  void setSampleValuesUint16(lt_uint16 value);
421 
430  void setSampleValuesSint16(lt_int16 value);
431 
440  void setSampleValuesUint32(lt_uint32 value);
441 
450  void setSampleValuesSint32(lt_int32 value);
451 
460  void setSampleValuesFloat32(float value);
461 
470  void setSampleValuesFloat64(double value);
471 #endif
472 
479  void setSampleValuesFromDouble(double value);
480 
481 #ifndef DEPRECATE_PIXEL_HELPERS
482 
491  void setSampleValueUint8(lt_uint16 band, lt_uint8 value);
492 
502  void setSampleValueSint8(lt_uint16 band, lt_int8 value);
503 
513  void setSampleValueUint16(lt_uint16 band, lt_uint16 value);
514 
524  void setSampleValueSint16(lt_uint16 band, lt_int16 value);
525 
535  void setSampleValueUint32(lt_uint16 band, lt_uint32 value);
536 
546  void setSampleValueSint32(lt_uint16 band, lt_int32 value);
547 
557  void setSampleValueFloat32(lt_uint16 band, float value);
558 
568  void setSampleValueFloat64(lt_uint16 band, double value);
569 
578  void setSampleValuesUint8(const lt_uint8 values[]);
579 
588  void setSampleValuesSint8(const lt_int8 values[]);
589 
598  void setSampleValuesUint16(const lt_uint16 values[]);
599 
608  void setSampleValuesSint16(const lt_int16 values[]);
609 
618  void setSampleValuesUint32(const lt_uint32 values[]);
619 
628  void setSampleValuesSint32(const lt_int32 values[]);
629 
638  void setSampleValuesFloat32(const float values[]);
639 
648  void setSampleValuesFloat64(const double values[]);
650 #endif
651 
652  LT_STATUS getBandSelection(lt_uint16 *&bandSelection) const;
662  static LT_STATUS checkCompatible(const LTIPixel &dstPixelProps,
663  const LTIPixel &srcPixelProps);
664 
665 private:
666  void createSamples(LTIDataType dt, lt_uint16 numSamples);
667 
668  void copySamples(const LTISample *samples, lt_uint16 numSamples,
669  const lt_uint16 *bandSelection, lt_uint16 numBands);
670 
671  LTISample* m_samples;
672  lt_uint16 m_numBands;
673  LTIColorSpace m_colorSpace;
674 };
675 
676 
677 LT_END_NAMESPACE(LizardTech)
678 
679 
680 #endif // LTI_PIXEL_H
signed short lt_int16
signed 16-bit integer
Definition: lt_types.h:48
basic properties of a sample
Definition: lti_sample.h:28
unsigned short lt_uint16
unsigned 16-bit integer
Definition: lt_types.h:50
unsigned int lt_uint32
unsigned 32-bit integer
Definition: lt_types.h:54
basic properties of a pixel
Definition: lti_pixel.h:36
#define LT_BEGIN_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:84
LTIColorSpace
colorspaces
Definition: lti_types.h:38
signed int lt_int32
signed 32-bit integer
Definition: lt_types.h:52
unsigned char lt_uint8
unsigned 8-bit integer
Definition: lt_types.h:46
signed char lt_int8
signed 8-bit integer
Definition: lt_types.h:44
LTIDataType
datatypes
Definition: lti_types.h:105
#define LT_END_NAMESPACE(theNameSpace)
compiler does not support namespaces
Definition: lt_define.h:85
lt_uint32 LT_STATUS
An integral status code.
Definition: lt_status.h:39

LizardTech