OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimTableRemapper.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Table remapper class declaration.
10 //
11 // Takes input tile, remaps it through a table, then output tile in the desired
12 // scalar type.
13 //
14 // Two modes one that works on native remap tables, that being of the same
15 // scalar type (like ossim_uint8) of the input connection, and another that
16 // uses a normalized remap table (more scalar independent).
17 //
18 //*************************************************************************
19 // $Id: ossimTableRemapper.h 22479 2013-11-12 02:18:55Z dburken $
20 #ifndef ossimTableRemapper_HEADER
21 #define ossimTableRemapper_HEADER
22 
24 
26 {
27 public:
29  {
30  UKNOWN = 0,
31  NATIVE = 1,
32  MIN_MAX = 2, // the data is native but must use min max for scale
33  NORMALIZED = 3
34  };
35 
38 
39  virtual ossimScalarType getOutputScalarType() const;
40 
41  virtual ossimRefPtr<ossimImageData> getTile(const ossimIrect& tile_rect,
42  ossim_uint32 resLevel=0);
43 
44  virtual void initialize();
45 
46 
47 
48  virtual bool saveState(ossimKeywordlist& kwl,
49  const char* prefix=0)const;
50 
55  virtual bool loadState(const ossimKeywordlist& kwl,
56  const char* prefix=0);
57 
58 
59  virtual ostream& print(ostream& os) const;
60 
61  friend ostream& operator << (ostream& os, const ossimTableRemapper& tr);
62 
63 protected:
65  virtual ~ossimTableRemapper();
66 
69  std::vector<ossim_uint8> theTable;
76 
77  void allocate(const ossimIrect& rect);
78  void destroy();
79 
80  void remapFromNativeTable(ossimRefPtr<ossimImageData>& inputTile);
81 
82  template <class T> void remapFromNativeTable(
83  T dummy,
84  ossimRefPtr<ossimImageData>& inputTile);
85 
86  void remapFromNormalizedTable(ossimRefPtr<ossimImageData>& inputTile);
87 
88  template <class T> void dumpTable(T dummy, ostream& os) const;
89 
90  // Do not allow copy constructor, operator=.
93 
94  TYPE_DATA
95 };
96 
97 #endif /* #ifndef ossimTableRemapper_HEADER */
RemapTableType theTableType
#define OSSIMDLLEXPORT
Represents serializable keyword/value map.
ossimRefPtr< ossimImageData > theTile
ossim_float64 * theNormBuf
const ossimImageSource & operator=(const ossimImageSource &)
std::vector< ossim_uint8 > theTable
ossimScalarType theInputScalarType
double ossim_float64
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossimScalarType
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossim_uint32 theTableBandCount
ossimRefPtr< ossimImageData > theTmpTile
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.
ossimScalarType theOutputScalarType
friend OSSIMDLLEXPORT std::ostream & operator<<(std::ostream &out, const ossimErrorStatusInterface &obj)
ossim_uint32 theTableBinCount
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)