OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimImageData.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: MIT
4 //
5 // See LICENSE.txt file in the top level directory for more details.
6 //
7 // Author: Garrett Potts
8 //
9 // Description: Container class for a tile of image data.
10 //
11 //*******************************************************************
12 // $Id: ossimImageData.h 23371 2015-06-12 13:08:34Z gpotts $
13 #ifndef ossimImageData_HEADER
14 #define ossimImageData_HEADER 1
15 
16 #include <vector>
17 #include <iosfwd> /* for ostream */
18 
19 #include <ossim/base/ossimCommon.h>
21 #include <ossim/base/ossimIrect.h>
22 #include <ossim/base/ossimIpt.h>
23 #include <ossim/base/ossimRefPtr.h>
25 
27 
29 {
30 public:
31 
34  {
35  /*
36  * The COLOR_DISCREPANCY rule directs that the selected band of a pixel
37  * of the destination buffer is to be overwritten if *any* one of the
38  * other bands of the same destination pixel have color values that
39  * deviate from its color.
40  * Deprecated in favor of COLOR_DISCREPANCY_OF_ANY_FROM_DEST.
41  */
42  COLOR_DISCREPANCY = 0,
43 
44  /*
45  * The COLOR_DISCREPANCY_OF_ANY_FROM_DEST rule directs that the selected
46  * band of a pixel of the destination buffer is to be overwritten if
47  * *any* one of the other bands of the same destination pixel have color
48  * values that deviate from its color.
49  * Same as the deprecated COLOR_DISCREPANCY.
50  */
51  COLOR_DISCREPANCY_OF_ANY_FROM_DEST = 1,
52 
53  /*
54  * The COLOR_DISCREPANCY_OF_ALL_FROM_DEST rule directs that the selected
55  * band of a pixel of the destination buffer is to be overwritten only if
56  * *all* of the other bands of the same destination pixel have color
57  * values that deviate from its color.
58  */
59  COLOR_DISCREPANCY_OF_ALL_FROM_DEST = 2,
60 
61  /*
62  * The COLOR_EQUALITY_OF_ANY_TO_SRC rule directs that the selected
63  * band of a pixel of the destination buffer is to be overwritten if
64  * *any* one of the other bands of the same destination pixel have color
65  * values that are equal to the color of the selected band of the source
66  * pixel.
67  */
68  COLOR_EQUALITY_OF_ANY_TO_SRC = 3,
69 
70  /*
71  * The COLOR_EQUALITY_OF_ALL_TO_SRC rule directs that the selected
72  * band of a pixel of the destination buffer is to be overwritten only if
73  * *all* of the other bands of the same destination pixel have color
74  * values that are equal to the color of the selected band of the source
75  * pixel.
76  */
77  COLOR_EQUALITY_OF_ALL_TO_SRC = 4,
78 
79  /*
80  * The selected band of the destination buffer is to be overwritten
81  * by the selected band of the source image data (no questions asked).
82  */
83  NULL_RULE = 5
84  };
85 
87  ossimImageData(const ossimImageData &rhs);
88 
90 
100  ossimImageData(ossimSource* source,
101  ossimScalarType scalar,
102  ossim_uint32 bands = 1);
103 
115  ossimImageData(ossimSource* source,
116  ossimScalarType scalar,
117  ossim_uint32 bands,
118  ossim_uint32 width,
119  ossim_uint32 height);
120 
122  virtual ~ossimImageData();
123 
129  virtual const ossimImageData& operator=(const ossimImageData &rhs);
130 
131 
135  virtual ossim_uint32 getWidth()const;
136 
140  virtual ossim_uint32 getHeight()const;
141 
145  virtual ossimIrect getImageRectangle() const;
146  virtual void getWidthHeight(ossim_uint32& w, ossim_uint32& h);
147  virtual void setWidth(ossim_uint32 width);
148  virtual void setHeight(ossim_uint32 height);
149  virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h);
150  virtual void setImageRectangleAndBands(const ossimIrect& rect,
151  ossim_uint32 numberOfBands);
152  virtual void setImageRectangle(const ossimIrect& rect);
153  virtual void setOrigin(const ossimIpt& origin);
154 
155  virtual void assign(const ossimDataObject* data);
156  virtual void assign(const ossimImageData* data);
157  virtual void assignBand(const ossimImageData* data,
158  ossim_uint32 source_band,
159  ossim_uint32 output_band);
160 
161  virtual ossimObject* dup() const;
162 
170  virtual ossim_uint32 getHashId()const;
171 
172  virtual void setNullPix(ossim_float64 null_pix);
173  virtual void setNullPix(ossim_float64 null_pix, ossim_uint32 band);
174  virtual void setNullPix(const ossim_float64* nullPixArray,
175  ossim_uint32 numberOfValues);
176  virtual void setMinPix(ossim_float64 min_pix);
177  virtual void setMinPix(ossim_float64 min_pix, ossim_uint32 band);
178  virtual void setMinPix(const ossim_float64* minPixArray,
179  ossim_uint32 numberOfValues);
180  virtual void setMaxPix(ossim_float64 max_pix);
181  virtual void setMaxPix(ossim_float64 max_pix, ossim_uint32 band);
182  virtual void setMaxPix(const ossim_float64* maxPixArray,
183  ossim_uint32 numberOfValues);
184 
185  virtual const ossimIpt& getOrigin()const{return m_origin;}
186 
198  virtual void computeMinMaxPix(std::vector<ossim_float64>& minBands,
199  std::vector<ossim_float64>& maxBands) const;
200 
214  virtual void computeMinMaxNulPix(
215  std::vector<ossim_float64>& minBands,
216  std::vector<ossim_float64>& maxBands,
217  std::vector<ossim_float64>& nulBands) const;
218 
219  virtual const ossim_float64* getNullPix()const;
220  virtual const ossim_float64* getMinPix()const;
221  virtual const ossim_float64* getMaxPix()const;
222  virtual ossim_float64 getNullPix(ossim_uint32 band) const;
223  virtual ossim_float64 getMinPix(ossim_uint32 band) const;
224  virtual ossim_float64 getMaxPix(ossim_uint32 band) const;
225 
229  virtual ossim_float64 getMinNormalizedPix() const;
230  virtual ossimString getScalarTypeAsString()const;
231  virtual ossim_uint32 getNumberOfBands() const;
232  virtual void setNumberOfBands(ossim_uint32 bands,
233  bool reallocate=false);
234 
240  virtual ossim_float64 getPix(const ossimIpt& position,
241  ossim_uint32 band=0) const;
242 
246  virtual ossim_float64 getPix(ossim_uint32 offset,
247  ossim_uint32 band = 0) const;
248 
253  void fill(ossim_uint32 band, ossim_float64 value);
254 
259  void fill(ossim_float64 value);
260 
267  void createTestTile();
268 
269  bool isNull(ossim_uint32 offset)const;
270  bool isNull(ossim_uint32 offset, ossim_uint32 band)const;
271  void setNull(ossim_uint32 offset);
272  void setNull(ossim_uint32 offset, ossim_uint32 band);
273 
274  bool isNull(const ossimIpt& pt)const;
275  void setNull(const ossimIpt& pt);
276  bool isNull(const ossimIpt& pt, ossim_uint32 band)const;
277  void setNull(const ossimIpt& pt, ossim_uint32 band);
278 
279  virtual bool isValidBand(ossim_uint32 band) const;
280  virtual ossimDataObjectStatus validate() const;
281 
286  virtual ossimRefPtr<ossimImageData> newNormalizedFloat()const;
287 
293  virtual void getNormalizedFloat(ossim_uint32 offset,
294  ossim_uint32 bandNumber,
295  ossim_float32& result)const;
296 
301  virtual void setNormalizedFloat(ossim_uint32 offset,
302  ossim_uint32 bandNumber,
303  ossim_float32 input);
304 
309  virtual void convertToNormalizedFloat(ossimImageData* result)const;
310 
315  virtual ossimImageData* newNormalizedDouble()const;
316 
321  virtual void convertToNormalizedDouble(ossimImageData* result)const;
322 
323  template <class T> void copyTileToFloatBuffer(
324  T /* dummyTemplate*/, ossim_float32* buf)const
325  {
326  const ossim_uint32 SIZE = getSizePerBand();
327  const ossim_uint32 BANDS = getNumberOfBands();
328 
329  for(ossim_uint32 band = 0; band < BANDS; ++band)
330  {
331  const T* s = (T*)getBuf(band); // source
332  ossim_float32* d = (ossim_float32*)(buf + (band*SIZE)); // destination
333 
334  for(ossim_uint32 offset = 0; offset < SIZE; ++offset)
335  {
336  ossim_float32 p = s[offset];
337  d[offset] = p;
338  }
339  }
340  }
341 
353  virtual void unnormalizeInput(ossimImageData* normalizedInput);
354 
358  virtual ossim_float64 computeAverageBandValue(
359  ossim_uint32 bandNumber = 0) const;
360 
370  virtual ossim_float64 computeMeanSquaredError(
371  ossim_float64 meanValue,
372  ossim_uint32 bandNumber = 0) const;
373 
374  virtual void populateHistogram(ossimRefPtr<ossimMultiBandHistogram> histo);
375 
376  virtual void setHistogram(ossimRefPtr<ossimMultiResLevelHistogram> histo);
378 
382  virtual bool hasAlpha() const;
383 
388  virtual const ossim_uint8* getAlphaBuf() const;
389 
394  virtual ossim_uint8* getAlphaBuf();
395 
399  virtual const void* getBuf() const;
400 
405  virtual const ossim_uint8* getUcharBuf() const;
406 
411  virtual const ossim_uint16* getUshortBuf() const;
412 
417  virtual const ossim_sint16* getSshortBuf() const;
418 
423  virtual const ossim_float32* getFloatBuf() const;
424 
429  virtual const ossim_float64* getDoubleBuf() const;
430 
434  virtual void* getBuf();
435 
440  virtual ossim_uint8* getUcharBuf();
441 
446  virtual ossim_uint16* getUshortBuf();
447 
452  virtual ossim_sint16* getSshortBuf();
453 
458  virtual ossim_float32* getFloatBuf();
459 
464  virtual ossim_float64* getDoubleBuf();
465 
470  virtual const void* getBuf(ossim_uint32 band) const;
471 
477  virtual const ossim_uint8* getUcharBuf(ossim_uint32 band) const;
478 
484  virtual const ossim_uint16* getUshortBuf(ossim_uint32 band) const;
485 
491  virtual const ossim_sint16* getSshortBuf(ossim_uint32 band) const;
492 
498  virtual const ossim_float32* getFloatBuf(ossim_uint32 band) const;
499 
505  virtual const ossim_float64* getDoubleBuf(ossim_uint32 band) const;
506 
511  virtual void* getBuf(ossim_uint32 band);
512 
518  virtual ossim_uint8* getUcharBuf(ossim_uint32 band);
519 
525  virtual ossim_uint16* getUshortBuf(ossim_uint32 band);
526 
532  virtual ossim_sint16* getSshortBuf(ossim_uint32 band);
533 
539  virtual ossim_float32* getFloatBuf(ossim_uint32 band);
540 
546  virtual ossim_float64* getDoubleBuf(ossim_uint32 band);
547 
552  virtual ossim_uint32 getSize() const;
553 
558  virtual ossim_uint32 getSizePerBand()const;
559 
563  virtual ossim_uint32 getSizePerBandInBytes() const;
564 
565  virtual ossim_uint32 getDataSizeInBytes()const;
566 
570  virtual ossim_uint32 getSizeInBytes() const;
571 
575  virtual void makeBlank();
576 
580  virtual void initialize();
581 
594  virtual bool write(const ossimFilename& f) const;
595 
601  virtual void copyTileToNormalizedBuffer(ossim_float64* buf) const;
602  virtual void copyTileToNormalizedBuffer(ossim_float32* buf)const;
603 
612  virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band,
613  ossim_float64* buf) const;
614 
623  virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band,
624  ossim_float32* buf)const;
625 
632  virtual void copyNormalizedBufferToTile(ossim_float64* buf);
633  virtual void copyNormalizedBufferToTile(ossim_float32* buf);
634 
641  virtual void copyNormalizedBufferToTile(ossim_uint32 band,
642  ossim_float64* buf);
643  virtual void copyNormalizedBufferToTile(ossim_uint32 band,
644  ossim_float32* buf);
645 
646  virtual bool isWithin(ossim_int32 x, ossim_int32 y);
647  virtual void setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color);
648 
649  virtual void loadBand(const void* src,
650  const ossimIrect& src_rect,
651  ossim_uint32 band);
652 
653  virtual void loadBand(const void* src,
654  const ossimIrect& src_rect,
655  const ossimIrect& clip_rect,
656  ossim_uint32 band);
657 
658  virtual void loadTile(const void* src,
659  const ossimIrect& src_rect,
660  ossimInterleaveType il_type);
661  virtual void loadTileWithAlpha(const void* src,
662  const ossimIrect& src_rect,
663  ossimInterleaveType il_type);
664 
665  virtual void loadTile(const void* src,
666  const ossimIrect& src_rect,
667  const ossimIrect& clip_rect,
668  ossimInterleaveType il_type);
669 
670  virtual void nullTileAlpha(const ossim_uint8* src,
671  const ossimIrect& src_rect,
672  bool mutliplyAlphaFlag=false);
673  virtual void nullTileAlpha(const ossim_uint8* src,
674  const ossimIrect& src_rect,
675  const ossimIrect& clip_rect,
676  bool multiplyAlphaFlag=false);
687  virtual void loadTile(const ossimImageData* src);
688 
689  virtual void loadTileFrom1Band(const ossimImageData* data);
690 
691  virtual void loadTileFrom1Band(const void* src,
692  const ossimIrect& src_rect);
697  virtual void loadShortBand(const void* src,
698  const ossimIrect& src_rect,
699  ossim_uint32 band,
700  bool swap_bytes=false);
701 
749  virtual void unloadBand( void* dest,
750  ossim_uint32 src_band,
751  ossim_uint32 dest_band,
752  const ossimIrect& dest_rect,
754  OverwriteBandRule ow_type=NULL_RULE ) const;
755 
804  virtual void unloadBand( void* dest,
805  ossim_uint32 src_band,
806  ossim_uint32 dest_band,
807  const ossimIrect& dest_rect,
808  const ossimIrect& clip_rect,
810  OverwriteBandRule ow_type=NULL_RULE ) const;
811 
818  virtual void unloadBand(void* dest,
819  const ossimIrect& dest_rect,
820  ossim_uint32 src_band) const;
821 
829  virtual void unloadBand(void* dest,
830  const ossimIrect& dest_rect,
831  const ossimIrect& clip_rect,
832  ossim_uint32 src_band) const;
833 
834  virtual void unloadTile(void* dest,
835  const ossimIrect& dest_rect,
836  ossimInterleaveType il_type ) const;
837 
838  virtual void unloadTile(void* dest,
839  const ossimIrect& dest_rect,
840  const ossimIrect& clip_rect,
841  ossimInterleaveType il_type) const;
842 
849  virtual void unloadTileToBipAlpha(void* dest,
850  const ossimIrect& dest_rect,
851  const ossimIrect& clip_rect) const;
852 
853  virtual bool isPointWithin(const ossimIpt& point)const;
854  virtual bool isPointWithin(ossim_int32 x,
855  ossim_int32 y)const;
856 
857  virtual std::ostream& print(std::ostream& out) const;
858 
863  virtual void stretchMinMax();
864 
871  virtual void computeAlphaChannel();
872 
900  virtual void copyLine(const void* src,
901  ossim_int32 lineNumber,
902  ossim_int32 lineStartSample,
903  ossim_int32 lineStopSample,
904  ossimInterleaveType lineInterleave);
905 
913  void setIndexedFlag(bool flag);
914 
916  bool getIndexedFlag() const;
917 
922  ossim_float64 percentFull() const { return m_percentFull; }
923 
924 
925  virtual bool isEqualTo(const ossimDataObject& rhs,
926  bool deepTest=false)const;
927 
928  virtual bool saveState(ossimKeywordlist& kwl, const char* prefix=0)const;
929  virtual bool loadState(const ossimKeywordlist& kwl, const char* prefix=0);
930 protected:
932  template <class T> void copyLineTemplate(T dummyTemplate,
933  const void* src,
934  ossim_int32 lineNumber,
935  ossim_int32 lineStartSample,
936  ossim_int32 lineStopSample,
937  ossimInterleaveType lineInterleave);
938 
945  template <class T> void stretchMinMax(T dummyTemplate);
946 
953  template <class T> void computeAlphaChannel(T dummyTemplate);
954 
962  template <class T> ossimDataObjectStatus validate(T dummyTemplate) const;
963 
967  template <class T> void makeBlank(T dummyTemplate);
968 
972  template <class T>
973  ossim_float64 computeMeanSquaredError(T dummyTemplate,
974  ossim_float64 meanValue,
975  ossim_uint32 bandNumber) const;
976 
980  template <class T>
981  ossim_float64 computeAverageBandValue(T dummyTemplate,
982  ossim_uint32 bandNumber) const;
983 
984  void loadTileFromBip(const void* src, const ossimIrect& src_rect);
985  void loadTileFromBipAlpha(const void* src, const ossimIrect& src_rect);
986  void loadTileFromBil(const void* src, const ossimIrect& src_rect);
987  void loadTileFromBsq(const void* src, const ossimIrect& src_rect);
988 
989  void loadTileFromBip(const void* src,
990  const ossimIrect& src_rect,
991  const ossimIrect& clip_rect);
992  void loadTileFromBil(const void* src,
993  const ossimIrect& src_rect,
994  const ossimIrect& clip_rect);
995  void loadTileFromBsq(const void* src,
996  const ossimIrect& src_rect,
997  const ossimIrect& clip_rect);
998 
999  void unloadTileToBip(void* dest,
1000  const ossimIrect& dest_rect,
1001  const ossimIrect& clip_rect) const;
1002  void unloadTileToBil(void* dest,
1003  const ossimIrect& dest_rect,
1004  const ossimIrect& clip_rect) const;
1005  void unloadTileToBsq(void* dest,
1006  const ossimIrect& dest_rect,
1007  const ossimIrect& clip_rect) const;
1008 
1020  virtual void unloadBandToBsq( void* dest,
1021  ossim_uint32 src_band,
1022  ossim_uint32 dest_band,
1023  const ossimIrect& dest_rect,
1024  const ossimIrect& clip_rect,
1025  OverwriteBandRule ow_type=NULL_RULE ) const;
1026 
1032  template <class T>
1033  void copyTileToNormalizedBuffer(T dummyTemplate,
1034  ossim_float64* buf) const;
1035  template <class T>
1036  void copyTileToNormalizedBuffer(T dummyTemplate,
1037  ossim_float32* buf)const;
1038 
1043  template <class T>
1044  void copyTileToNormalizedBuffer(T dummyTemplate,
1045  ossim_uint32 band, ossim_float64* buf) const;
1046  template <class T>
1047  void copyTileToNormalizedBuffer(T dummyTemplate,
1048  ossim_uint32 band, ossim_float32* buf)const;
1049 
1056  template <class T>
1057  void copyNormalizedBufferToTile(T dummyTemplate,
1058  ossim_float64* buf);
1059  template <class T>
1060  void copyNormalizedBufferToTile(T dummyTemplate,
1061  ossim_float32* buf);
1062  template <class T>
1063  void copyNormalizedBufferToTile(T dummyTemplate,
1064  ossim_uint32 band,
1065  ossim_float64* buf);
1066  template <class T>
1067  void copyNormalizedBufferToTile(T dummyTemplate,
1068  ossim_uint32 band,
1069  ossim_float32* buf);
1070 
1071 
1072  template <class T>
1073  void computeMinMaxPix(T dummyValue,
1074  std::vector<ossim_float64>& minBands,
1075  std::vector<ossim_float64>& maxBands) const;
1076 
1077  template <class T>
1078  void computeMinMaxNulPix(T dummyValue,
1079  std::vector<ossim_float64>& minBands,
1080  std::vector<ossim_float64>& maxBands,
1081  std::vector<ossim_float64>& nulBands) const;
1082 
1083  template <class T> void loadBandTemplate(T, // dummy template variable
1084  const void* src,
1085  const ossimIrect& src_rect,
1086  ossim_uint32 band);
1087 
1088  template <class T> void loadBandTemplate(T, // dummy template variable
1089  const void* src,
1090  const ossimIrect& src_rect,
1091  const ossimIrect& clip_rect,
1092  ossim_uint32 band);
1093 
1094  template <class T> void nullTileAlphaTemplate(T,
1095  const ossim_uint8* src,
1096  const ossimIrect& src_rect,
1097  const ossimIrect& clip_rect,
1098  bool multiplyAlphaFlag=false);
1099 
1100  template <class T> void loadTileFromBipTemplate(T, // dummy template variable
1101  const void* src,
1102  const ossimIrect& src_rect);
1103  template <class T> void loadTileFromBipAlphaTemplate(T, // dummy template variable
1104  const void* src,
1105  const ossimIrect& src_rect);
1106 
1107  template <class T> void loadTileFromBipTemplate(T, // dummy template variable
1108  const void* src,
1109  const ossimIrect& src_rect,
1110  const ossimIrect& clip_rect);
1111  template <class T>
1112  void loadTileFromBipAlphaTemplate(T, // dummy template variable
1113  const void* src,
1114  const ossimIrect& src_rect,
1115  const ossimIrect& clip_rect);
1116 
1117  template <class T> void loadTileFromBilTemplate(T, // dummy template variable
1118  const void* src,
1119  const ossimIrect& src_rect);
1120 
1121  template <class T> void loadTileFromBilTemplate(T, // dummy template variable
1122  const void* src,
1123  const ossimIrect& src_rect,
1124  const ossimIrect& clip_rect);
1125 
1126  template <class T> void loadTileFromBsqTemplate(T, // dummy template variable
1127  const void* src,
1128  const ossimIrect& src_rect);
1129 
1130  template <class T> void loadTileFromBsqTemplate(T, // dummy template variable
1131  const void* src,
1132  const ossimIrect& src_rect,
1133  const ossimIrect& clip_rect);
1134 
1135  template <class T> void unloadTileToBipTemplate(T, // dummy template variable
1136  void* dest,
1137  const ossimIrect& dest_rect,
1138  const ossimIrect& clip_rect) const;
1139 
1140  template <class T> void unloadTileToBipAlphaTemplate(T, // dummy template variable
1141  void* dest,
1142  const ossimIrect& dest_rect,
1143  const ossimIrect& clip_rect) const;
1144 
1145  template <class T> void unloadTileToBilTemplate(T, // dummy template variable
1146  void* dest,
1147  const ossimIrect& dest_rect,
1148  const ossimIrect& clip_rect) const;
1149 
1150  template <class T> void unloadTileToBsqTemplate(T, // dummy template variable
1151  void* dest,
1152  const ossimIrect& dest_rect,
1153  const ossimIrect& clip_rect) const;
1154 
1155  template <class T> void unloadBandTemplate(T, // dummy template variable
1156  void* dest,
1157  const ossimIrect& dest_rect,
1158  const ossimIrect& clip_rect,
1159  ossim_uint32 band) const;
1160 
1161  template <class T> void unloadBandToBsqTemplate(T, // dummy template variable
1162  void* dest,
1163  ossim_uint32 src_band,
1164  ossim_uint32 dest_band,
1165  const ossimIrect& dest_rect,
1166  const ossimIrect& clip_rect,
1167  OverwriteBandRule ow_type=NULL_RULE) const;
1168 
1174  template <class T> void createTestTile(T);
1175 
1180  virtual void initializeDefaults();
1181 
1186  virtual void initializeMinDefault();
1187 
1192  virtual void initializeMaxDefault();
1193 
1198  virtual void initializeNullDefault();
1199 
1200 
1202  {
1203  bool result = false;
1204  if(data)
1205  {
1206  result = ((m_spatialExtents.size() ==
1207  data->m_spatialExtents.size())&&
1208  (m_spatialExtents[0] == data->m_spatialExtents[0])&&
1209  (m_spatialExtents[1] == data->m_spatialExtents[1])&&
1210  (m_scalarType == data->m_scalarType));
1211  }
1212  return result;
1213  }
1214 
1216  std::vector<ossim_float64> m_nullPixelValue;
1217 
1219  std::vector<ossim_float64> m_minPixelValue;
1220 
1222  std::vector<ossim_float64> m_maxPixelValue;
1223 
1225  std::vector<ossim_uint8> m_alpha;
1226 
1228 
1231 
1233 
1238 
1239 private:
1240 
1241 
1242 TYPE_DATA
1243 };
1244 
1245 inline bool ossimImageData::hasAlpha() const
1246 {
1247  return (m_alpha.size()?true:false);
1248 }
1249 
1251 {
1252  ossimIpt lr(m_origin.x + getWidth() - 1,
1253  m_origin.y + getHeight() - 1);
1254 
1255  return ossimIrect(m_origin, lr);
1256 }
1257 
1259 {
1260  return ( m_nullPixelValue.size() > 0 ? &m_nullPixelValue.front() : 0 );
1261 }
1262 
1264 {
1265  return ( m_minPixelValue.size() > 0 ? &m_minPixelValue.front() : 0 );
1266 }
1267 
1269 {
1270  return ( m_maxPixelValue.size() > 0 ? &m_maxPixelValue.front() : 0 );
1271 }
1272 
1274 {
1275  return ( band < m_nullPixelValue.size() ? m_nullPixelValue[band] :
1277 }
1278 
1280 {
1281  return ( band < m_minPixelValue.size() ? m_minPixelValue[band] :
1283 }
1284 
1286 {
1287  return ( band < m_maxPixelValue.size() ? m_maxPixelValue[band] :
1289 }
1290 
1292 {
1293  const unsigned char *bufx = (unsigned char*)(&m_origin.x);
1294  const unsigned char *bufy = (unsigned char*)(&m_origin.y);
1295  return (ossim_uint32)(bufx[0]*101 + bufx[1]*103 +
1296  bufx[2]*107 + bufx[3]*109 +
1297  bufy[0]*139 + bufy[1]*149 +
1298  bufy[2]*151 + bufy[3]*157);
1299 }
1300 
1301 #endif
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual ossim_uint32 getWidth() const
ossim_uint32 x
virtual const ossim_float64 * getMaxPix() const
virtual bool isEqualTo(const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
void copyTileToFloatBuffer(T, ossim_float32 *buf) const
ossim_uint32 y
std::vector< ossim_uint8 > m_alpha
Alpha channel.
float ossim_float32
virtual bool hasAlpha() const
virtual ossim_uint32 getHeight() const
virtual void assign(const ossimRectilinearDataObject *data)
unsigned short ossim_uint16
virtual ossim_uint32 getDataSizeInBytes() const
double ossim_float64
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
Definition: ossimCommon.cpp:73
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram
signed short ossim_sint16
#define TYPE_DATA
Definition: ossimRtti.h:339
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
OverwriteBandRule
Definitions for the unloadBand routines.
virtual ossimIrect getImageRectangle() const
std::vector< ossim_uint32 > m_spatialExtents
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
ossimInterleaveType
ossim_float64 m_percentFull
percentage (0-100) of image tile that has valid (non-null) pixel values.
ossimScalarType
virtual const ossim_float64 * getMinPix() const
virtual void initialize()
Initializes m_dataBuffer to current spatial extents.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual ossimScalarType getScalarType() const
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
ossim_int32 y
Definition: ossimIpt.h:142
bool m_indexedFlag
Indicates data contains palette indexes.
virtual ossimObject * dup() const
Definition: ossimObject.cpp:29
str write(os2.str().data(), os2.str().size())
virtual const ossimRectilinearDataObject & operator=(const ossimRectilinearDataObject &rhs)
assignment operator=
ossim_int32 x
Definition: ossimIpt.h:141
ossimDataObjectStatus
Definitions for data object status.
virtual ossim_uint32 getHashId() const =0
ossim_float64 percentFull() const
Returns the percentage (0-100) of data buffer containing non-null (valid) entries.
virtual const ossimIpt & getOrigin() const
unsigned char ossim_uint8
virtual std::ostream & print(std::ostream &out) const
Generic print method.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
bool hasSameDimensionsAs(ossimImageData *data) const
int ossim_int32
virtual ossim_uint32 getHashId() const
Uses prime numbers as coefficients for this summation.