OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimU8ImageData.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: David Burken
8 //
9 // Description:
10 //
11 // Class declaration of ossimU8ImageData. Specialized image data object for
12 // unsigned char data.
13 //
14 // NOTE: This object is optimized for unsigned char data and assumes the
15 // following: null pixel value = 0.0
16 // min pixel value = 1.0
17 // max pixel value = 255.0
18 //
19 // If you want anything else use the less efficient ossimImageData.
20 //
21 //*************************************************************************
22 // $Id: ossimU8ImageData.h 16052 2009-12-08 22:20:40Z dburken $
23 
24 #ifndef ossimU8ImageData_HEADER
25 #define ossimU8ImageData_HEADER
26 
29 
31 {
32 public:
33  ossimU8ImageData(ossimSource* source=NULL,
34  ossim_uint32 bands = 1);
35 
37  ossim_uint32 bands,
38  ossim_uint32 width,
39  ossim_uint32 height);
40 
42  :ossimImageData(rhs)
43  {}
44 
45 
46  virtual ossimObject* dup()const;
47 
52  void fill(ossim_uint32 band, double value);
53  void fill(double value);
54 
55  bool isNull(ossim_uint32 offset)const;
56  void setNull(ossim_uint32 offset);
57 
58  virtual ossimDataObjectStatus validate() const;
59 
65  virtual void getNormalizedFloat(ossim_uint32 offset,
66  ossim_uint32 bandNumber,
67  float& result)const;
68 
73  virtual void setNormalizedFloat(ossim_uint32 offset,
74  ossim_uint32 bandNumber,
75  float input);
76 
81  virtual void convertToNormalizedFloat(ossimImageData* result)const;
82 
87  virtual void convertToNormalizedDouble(ossimImageData* result)const;
88 
100  virtual void unnormalizeInput(ossimImageData* normalizedInput);
101 
105  virtual double computeAverageBandValue(ossim_uint32 bandNumber = 0);
106 
118  virtual double computeMeanSquaredError(double meanValue,
119  ossim_uint32 bandNumber = 0);
120 
121  virtual void setValue(ossim_int32 x, ossim_int32 y, double color);
122 
128  virtual void copyTileToNormalizedBuffer(double* buf) const;
129  virtual void copyTileToNormalizedBuffer(float* buf) const;
130 
135  virtual void copyTileToNormalizedBuffer(ossim_uint32 band, double* buf) const;
136  virtual void copyTileToNormalizedBuffer(ossim_uint32 band, float* buf)const;
137 
144  virtual void copyNormalizedBufferToTile(double* buf);
145  virtual void copyNormalizedBufferToTile(float* buf);
146 
152  virtual void copyNormalizedBufferToTile(ossim_uint32 band,
153  double* buf);
154  virtual void copyNormalizedBufferToTile(ossim_uint32 band,
155  float* buf);
156 
158  virtual ossim_float64 getMinNormalizedPix() const;
159 
160 protected:
161  virtual ~ossimU8ImageData();
162 
163 private:
164 
166 
167 TYPE_DATA
168 };
169 
171 {
172  return m_remapTable[1];
173 }
174 
175 #endif
ossim_uint32 x
void fill(ossim_uint32 band, ossim_float64 value)
will fill the entire band with the value.
virtual void setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color)
#define OSSIMDLLEXPORT
virtual ossim_float64 getMinNormalizedPix() const
returns normalized minimum pixel value of band zero.
virtual ossim_float64 getMinNormalizedPix() const
ossim_uint32 y
virtual void getNormalizedFloat(ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 &result) const
will go to the band and offset and compute the normalized float and return it back to the caller thro...
virtual ossimObject * dup() const
Eight bit normalized remap table to go to/from normalized value to pixel value.
bool isNull(ossim_uint32 offset) const
double ossim_float64
virtual ossimDataObjectStatus validate() const
#define TYPE_DATA
Definition: ossimRtti.h:339
unsigned int ossim_uint32
virtual void unnormalizeInput(ossimImageData *normalizedInput)
Will take the normalized input and convert it to this tile's data type.
virtual ossim_float64 computeMeanSquaredError(ossim_float64 meanValue, ossim_uint32 bandNumber=0) const
This will call the compute average band value and then use that in the calculation of: ...
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
static const ossimNormalizedU8RemapTable m_remapTable
virtual ossim_float64 computeAverageBandValue(ossim_uint32 bandNumber=0) const
This will compute the average value for the band.
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
void setNull(ossim_uint32 offset)
virtual void setNormalizedFloat(ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 input)
This will assign to this object a normalized value by unnormalizing to its native type...
virtual void convertToNormalizedDouble(ossimImageData *result) const
Will use the memory that you pass in to normalize this data object.
ossimDataObjectStatus
Definitions for data object status.
virtual void convertToNormalizedFloat(ossimImageData *result) const
Will use the memory that you pass in to normalize this data object.
ossimU8ImageData(const ossimU8ImageData &rhs)
int ossim_int32