OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimPiecewiseRemapper.h
Go to the documentation of this file.
1 //---
2 // License: MIT
3 //
4 // Author: David Burken
5 //
6 // Description:
7 //
8 // Piecewise remapper class declaration.
9 //
10 //---
11 // $Id$
12 
13 #ifndef ossimPiecewiseRemapper_HEADER
14 #define ossimPiecewiseRemapper_HEADER 1
15 
17 #include <ossim/base/ossimRtti.h>
18 #include <vector>
19 
64 {
65 public:
66 
68  {
69  UNKNOWN = 0,
70  LINEAR_NATIVE = 1
71  };
72 
75 
77  virtual ossimString getClassName()const;
78 
80  virtual ossimString getLongName() const;
81 
83  virtual ossimString getShortName() const;
84 
91  virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tileRect,
92  ossim_uint32 resLevel = 0);
93 
95  virtual void initialize();
96 
104  void setRemapType( const std::string& type );
105 
110  virtual bool saveState(ossimKeywordlist& kwl,
111  const char* prefix=0)const;
112 
118  virtual bool loadState(const ossimKeywordlist& kwl,
119  const char* prefix=0);
120 
121 
123  virtual ostream& print(ostream& os) const;
124 
126  virtual double getMinPixelValue(ossim_uint32 band=0)const;
127 
129  virtual double getMaxPixelValue(ossim_uint32 band=0)const;
130 
131 protected:
132 
141  virtual ~ossimPiecewiseRemapper();
142 
143 private:
144 
151  {
152  public:
153  ossimRemapSet();
154  ossimRemapSet(const ossimRemapSet& obj);
155  const ossimRemapSet& operator=(const ossimRemapSet& rhs);
156  std::vector<ossim_float64> m_set;
157  };
158 
165  {
166  public:
167  ossimBandRemap();
168  ossimBandRemap(const ossimBandRemap& obj);
169  const ossimBandRemap& operator=(const ossimBandRemap& rhs);
170 
171  void loadState( const ossimKeywordlist& kwl,
172  const std::string& prefix,
173  ossim_uint32 band );
174 
175  void saveState( ossimKeywordlist& kwl,
176  const std::string& prefix,
178  ossim_uint32 band ) const;
179 
188  bool initRemapSetFromString( const std::string& s,
190 
197  void getRemapSetString( ossimPiecewiseRemapper::PiecewiseRemapType remapType,
199  std::string& s ) const;
200 
201  void getLinearRemapSetString( const ossimPiecewiseRemapper::ossimRemapSet& set,
202  std::string& s ) const;
203 
204  std::vector<ossimRemapSet> m_remap;
205 
206  }; // End: class ossimBandRemap
207 
213  void getRemapTypeString( ossimPiecewiseRemapper::PiecewiseRemapType remapType,
214  std::string& s ) const;
215 
224  void getLinearRemapSetString(
226  std::string& s ) const;
227 
229  void buildTable();
230 
232  void buildLinearNativeTable();
233 
235  template <class T> void buildLinearNativeTable(T dummy);
236 
244  void setupTable();
245 
247  void initMinMax();
248 
251 
254 
256  bool m_dirty;
257 
259 
260  // One set per band.
261  std::vector<ossimPiecewiseRemapper::ossimBandRemap> m_bandRemap;
262 
263 #if 1 /* Not sure if we need min/max right now.(drb) */
264  // Stores the min/max from the table for each band.
265  vector<ossim_float64> m_min;
266  vector<ossim_float64> m_max;
267 #endif
268 
269  TYPE_DATA
270 };
271 
272 #endif /* #ifndef ossimPiecewiseRemapper_HEADER */
ossimTableRemapper & operator=(const ossimTableRemapper &tr)
virtual ostream & print(ostream &os) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
vector< ossim_float64 > m_min
#define OSSIMDLLEXPORT
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
virtual ossimRefPtr< ossimImageData > getTile(const ossimIrect &tile_rect, ossim_uint32 resLevel=0)
Represents serializable keyword/value map.
PiecewiseRemapType m_remapType
vector< ossim_float64 > m_max
virtual ossimString getClassName() const
Definition: ossimObject.cpp:64
virtual ossimString getShortName() const
Definition: ossimObject.cpp:48
std::vector< ossimPiecewiseRemapper::ossimBandRemap > m_bandRemap
virtual void initialize()
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
virtual ossimString getLongName() const
Definition: ossimObject.cpp:53
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max pixel of the band.
bool m_dirty
Dirty flag to indicate table needs to be rebuilt.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
This class provides piecewise linear remapping of input pixels to output pixels.
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23