OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimBumpShadeTileSource.h
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: MIT
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 //*************************************************************************
11 // $Id: ossimBumpShadeTileSource.h 23108 2015-01-27 17:00:20Z okramer $
12 #ifndef ossimBumpShadeTileSource_HEADER
13 #define ossimBumpShadeTileSource_HEADER
16 #include <ossim/matrix/newmat.h>
17 
18 class ossimImageData;
19 
20 class ossimImageSourceConnection;
21 
102 {
103 public:
105 
106  ossimString getShortName()const;
107  ossimString getLongName()const;
108 
110  ossim_uint32 resLevel=0);
111 
112  virtual bool getTile(ossimImageData* tile, ossim_uint32 resLevel=0);
113 
117  virtual ossim_uint32 getNumberOfOutputBands() const;
118 
122  virtual ossimScalarType getOutputScalarType() const;
123 
129  virtual double getNullPixelValue()const;
130 
136  virtual double getMinPixelValue(ossim_uint32 band=0)const;
137 
143  virtual double getMaxPixelValue(ossim_uint32 band=0)const;
144 
148  virtual double getAzimuthAngle()const;
149 
153  virtual double getElevationAngle()const;
154 
158  virtual void setAzimuthAngle(double angle);
159 
163  virtual void setElevationAngle(double angle);
164 
168  virtual void initialize();
169 
173  virtual bool loadState(const ossimKeywordlist& kwl,
174  const char* prefix=0);
175 
179  virtual bool saveState(ossimKeywordlist& kwl,
180  const char* prefix=0)const;
181 
185  bool canConnectMyInputTo(ossim_int32 inputIndex,
186  const ossimConnectableObject* object)const;
187 
191  virtual void connectInputEvent(ossimConnectionEvent& event);
192 
196  virtual void disconnectInputEvent(ossimConnectionEvent& event);
197 
201  virtual void propertyEvent(ossimPropertyEvent& event);
202 
203  virtual void refreshEvent(ossimRefreshEvent& event);
204 
209  void computeLightDirection();
210 
211  /* ------------------- PROPERTY INTERFACE -------------------- */
212  virtual void setProperty(ossimRefPtr<ossimProperty> property);
213  virtual ossimRefPtr<ossimProperty> getProperty(const ossimString& name)const;
214  virtual void getPropertyNames(std::vector<ossimString>& propertyNames)const;
215  /* ------------------ PROPERTY INTERFACE END ------------------- */
216 
228  void setRgbColorSource(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b);
229 
236  void getRgbColorSource(ossim_uint8& r, ossim_uint8& g, ossim_uint8& b) const;
237 
238 protected:
239  virtual ~ossimBumpShadeTileSource();
240  void allocate();
246 
251 
256 
261  NEWMAT::ColumnVector m_lightDirection;
262 
269 
270  void computeColor(ossim_uint8& r,
271  ossim_uint8& g,
272  ossim_uint8& b,
273  ossim_float64 normalX,
274  ossim_float64 normalY,
275  ossim_float64 normalZ,
276  ossim_uint8 dr,
277  ossim_uint8 dg,
278  ossim_uint8 db)const;
279 
280 TYPE_DATA
281 };
282 
283 #endif
virtual void propertyEvent(ossimPropertyEvent &event)
virtual void connectInputEvent(ossimConnectionEvent &event)
ossim_uint8 m_r
rgb values used when no color source (2nd layer) is present.
This uses a derivative of Blinn&#39;s bump function to compute a 3-D looking image.
#define OSSIMDLLEXPORT
virtual bool canConnectMyInputTo(ossim_int32 inputIndex, const ossimConnectableObject *object) const
required to be overriden by derived classes
This will be a base for all combiners.
Represents serializable keyword/value map.
virtual ossim_uint32 getNumberOfOutputBands() const
Returns the number of bands in a tile returned from this TileSource.
virtual double getMinPixelValue(ossim_uint32 band=0) const
Returns the min pixel of the band.
virtual void disconnectInputEvent(ossimConnectionEvent &event)
virtual ossimString getShortName() const
Definition: ossimObject.cpp:48
double m_lightSourceAzimuthAngle
Used for the light vector computation.
NEWMAT::ColumnVector m_lightDirection
This is computed from the elevation and azimuth angles of the light source.
double ossim_float64
virtual void setProperty(ossimRefPtr< ossimProperty > property)
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
virtual double getMaxPixelValue(ossim_uint32 band=0) const
Returns the max 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 getNullPixelValue(ossim_uint32 band=0) const
Each band has a null pixel associated with it.
ossimScalarType
virtual void refreshEvent(ossimRefreshEvent &event)
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
virtual ossimScalarType getOutputScalarType() const
This will be used to query the output pixel type of the tile source.
ossimRefPtr< ossimImageData > m_tile
The result of the illumination equation is stored in here.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=NULL) const
Method to save the state of an object to a keyword list.
unsigned char ossim_uint8
double m_lightSourceElevationAngle
Used for the light vector computation.
int ossim_int32
virtual ossimRefPtr< ossimImageData > getTile(const ossimIpt &origin, ossim_uint32 resLevel=0)