OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimMultiBandHistogramTileSource.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: Garrett Potts
6 //
7 //*************************************************************************
8 // $Id: ossimMultiBandHistogramTileSource.h 15766 2009-10-20 12:37:09Z gpotts $
9 #ifndef ossimMultiBandHistogramTileSource_HEADER
10 #define ossimMultiBandHistogramTileSource_HEADER
12 #include <vector>
14 {
15 public:
17  {
18  OSSIM_HISTOGRAM_NO_ALGORITHM = 0,
19  OSSIM_HISTOGRAM_LINEAR_STRETCH_ALGORITHM = 1
20  };
22  ossimMultiBandHistogramTileSource(double minValuePercent,
23  double maxValuePercent,
24  ossimImageSource* inputSource,
25  ossimMultiResLevelHistogram* histogram);
26  virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
27  ossim_uint32 resLevel=0);
28 
29  virtual void setMinValuePercent(const std::vector<double>& arrayPercents)
30  {
31  theMinValuePercentArray = arrayPercents;
32  }
33  virtual void setMaxValuePercent(const std::vector<double>& arrayPercents)
34  {
35  theMaxValuePercentArray = arrayPercents;
36  }
37  virtual void setMinValuePercent(ossim_uint32 arrayIndex,
38  double minValue)
39  {
40  if(arrayIndex < theMinValuePercentArray.size())
41  {
42  theMinValuePercentArray[arrayIndex] = minValue;
43  }
44  }
45  virtual void setMaxValuePercent(ossim_uint32 arrayIndex,
46  double maxValue)
47  {
48  if(arrayIndex < theMaxValuePercentArray.size())
49  {
50  theMaxValuePercentArray[arrayIndex] = maxValue;
51  }
52  }
53  virtual double getMinValuePercent(ossim_uint32 arrayIndex)const
54  {
55  if(arrayIndex < theMinValuePercentArray.size())
56  {
57  return theMinValuePercentArray[arrayIndex];
58  }
59  return ossim::nan();
60  }
61  virtual double getMaxValuePercent(ossim_uint32 arrayIndex)const
62  {
63  if(arrayIndex < theMaxValuePercentArray.size())
64  {
65  return theMaxValuePercentArray[arrayIndex];
66  }
67  return ossim::nan();
68  }
70  {
71  return (ossim_uint32)theMinValuePercentArray.size();
72  }
74  {
75  return (ossim_uint32)theMinValuePercentArray.size();
76  }
77  virtual void initialize();
78 
79  virtual bool loadState(const ossimKeywordlist& kwl,
80  const char* prefix=0);
81  virtual bool saveState(ossimKeywordlist& kwl,
82  const char* prefix=0)const;
83 
84 protected:
86 
87  void allocate();
88 
91  std::vector<double> theMinValuePercentArray;
92  std::vector<double> theMaxValuePercentArray;
93 
94  template <class T> ossimRefPtr<ossimImageData> runLinearStretchAlgorithm(
95  T dummyVariable,
97 
99 };
100 #endif
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
ossimMultiBandHistogramAlgorithm theAlgorithm
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual void setMaxValuePercent(ossim_uint32 arrayIndex, double maxValue)
virtual double getMaxValuePercent(ossim_uint32 arrayIndex) const
#define TYPE_DATA
Definition: ossimRtti.h:339
virtual void setMinValuePercent(ossim_uint32 arrayIndex, double minValue)
unsigned int ossim_uint32
virtual void setMaxValuePercent(const std::vector< double > &arrayPercents)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Method to save the state of an object to a keyword list.
virtual double getMinValuePercent(ossim_uint32 arrayIndex) const
virtual void setMinValuePercent(const std::vector< double > &arrayPercents)
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)