MrSID Decode SDK for Raster Reference Manual
9.0.0.3864
|
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 LTI_PIXEL_H 00014 #define LTI_PIXEL_H 00015 00016 // lt_lib_mrsid_core 00017 #include "lti_sample.h" 00018 00019 00020 LT_BEGIN_NAMESPACE(LizardTech) 00021 00022 00023 00036 class LTIPixel 00037 { 00038 public: 00045 LTIPixel(void); 00046 00058 LTIPixel(LTIColorSpace colorSpace, 00059 lt_uint16 numBands, 00060 LTIDataType dataType, 00061 const LTISample* samples = NULL); 00062 00073 LTIPixel(const LTIPixel &pixel, 00074 const lt_uint16 *bandSelection, 00075 lt_uint16 numBands); 00076 00090 LTIPixel(const LTISample* samples, 00091 lt_uint16 numBands, 00092 LTIColorSpace colorSpace = LTI_COLORSPACE_INVALID); 00093 00097 LTIPixel(const LTIPixel&); 00098 00102 virtual ~LTIPixel(); 00103 00107 LTIPixel& operator=(const LTIPixel&); 00108 00112 bool operator==(const LTIPixel&) const; 00113 00117 bool operator!=(const LTIPixel&) const; 00118 00127 lt_uint16 getNumBands() const; 00128 00137 lt_uint16 getNumBandsWithoutAlpha() const; 00138 00148 LTIDataType getDataType() const; 00149 bool isSignedData() const; 00150 00158 LTIColorSpace getColorSpace() const; 00159 00167 LTIColorSpace getColorSpaceWithoutAlpha() const; 00168 00174 bool hasAlphaBand() const; 00175 00181 bool hasPreMultipliedAlphaBand() const; 00182 00193 lt_uint32 getNumBytes() const; 00194 00205 lt_uint32 getNumBytesWithoutAlpha() const; 00206 00215 lt_uint32 getMaxBytesPerSample() const; 00216 00226 LT_STATUS checkImpedance(const LTIPixel& pixel, 00227 bool enforceColorSpace = true) const; 00228 LT_STATUS checkImpedanceWithoutAlpha(const LTIPixel& pixel) const; 00229 00230 LTISample *getSamples() const; 00231 LTISample &getSample(lt_uint16) const; 00232 00233 //#define DEPRECATE_PIXEL_HELPERS 00234 #ifndef DEPRECATE_PIXEL_HELPERS 00235 00239 00249 const void* getSampleValueAddr(lt_uint16 band) const; 00250 00260 lt_uint8 getSampleValueUint8(lt_uint16 band) const; 00261 00271 lt_int8 getSampleValueSint8(lt_uint16 band) const; 00272 00282 lt_uint16 getSampleValueUint16(lt_uint16 band) const; 00283 00293 lt_int16 getSampleValueSint16(lt_uint16 band) const; 00294 00304 lt_uint32 getSampleValueUint32(lt_uint16 band) const; 00305 00315 lt_int32 getSampleValueSint32(lt_uint16 band) const; 00316 00326 float getSampleValueFloat32(lt_uint16 band) const; 00327 00337 double getSampleValueFloat64(lt_uint16 band) const; 00338 #endif 00339 00345 bool areSampleValuesMin() const; 00346 00352 bool areSampleValuesMax() const; 00353 00354 00361 00367 void setSampleValuesToMin(); 00368 00374 void setSampleValuesToMax(); 00375 00376 #ifndef DEPRECATE_PIXEL_HELPERS 00377 00385 void setSampleValueAddr(lt_uint16 band, const void* data) const; 00386 00395 void setSampleValuesUint8(lt_uint8 value); 00396 00405 void setSampleValuesSint8(lt_int8 value); 00406 00415 void setSampleValuesUint16(lt_uint16 value); 00416 00425 void setSampleValuesSint16(lt_int16 value); 00426 00435 void setSampleValuesUint32(lt_uint32 value); 00436 00445 void setSampleValuesSint32(lt_int32 value); 00446 00455 void setSampleValuesFloat32(float value); 00456 00465 void setSampleValuesFloat64(double value); 00466 #endif 00467 00474 void setSampleValuesFromDouble(double value); 00475 00476 #ifndef DEPRECATE_PIXEL_HELPERS 00477 00486 void setSampleValueUint8(lt_uint16 band, lt_uint8 value); 00487 00497 void setSampleValueSint8(lt_uint16 band, lt_int8 value); 00498 00508 void setSampleValueUint16(lt_uint16 band, lt_uint16 value); 00509 00519 void setSampleValueSint16(lt_uint16 band, lt_int16 value); 00520 00530 void setSampleValueUint32(lt_uint16 band, lt_uint32 value); 00531 00541 void setSampleValueSint32(lt_uint16 band, lt_int32 value); 00542 00552 void setSampleValueFloat32(lt_uint16 band, float value); 00553 00563 void setSampleValueFloat64(lt_uint16 band, double value); 00564 00573 void setSampleValuesUint8(const lt_uint8 values[]); 00574 00583 void setSampleValuesSint8(const lt_int8 values[]); 00584 00593 void setSampleValuesUint16(const lt_uint16 values[]); 00594 00603 void setSampleValuesSint16(const lt_int16 values[]); 00604 00613 void setSampleValuesUint32(const lt_uint32 values[]); 00614 00623 void setSampleValuesSint32(const lt_int32 values[]); 00624 00633 void setSampleValuesFloat32(const float values[]); 00634 00643 void setSampleValuesFloat64(const double values[]); 00645 #endif 00646 00647 LT_STATUS getBandSelection(lt_uint16 *&bandSelection) const; 00648 00649 static LT_STATUS checkCompatible(const LTIPixel &dstPixelProps, 00650 const LTIPixel &srcPixelProps); 00651 00652 private: 00653 void createSamples(LTIDataType dt, lt_uint16 numSamples); 00654 00655 void copySamples(const LTISample *samples, lt_uint16 numSamples, 00656 const lt_uint16 *bandSelection, lt_uint16 numBands); 00657 00658 LTISample* m_samples; 00659 lt_uint16 m_numBands; 00660 LTIColorSpace m_colorSpace; 00661 }; 00662 00663 00664 LT_END_NAMESPACE(LizardTech) 00665 00666 00667 #endif // LTI_PIXEL_H