Isis Developer Reference
|
Calculate light intensity reflected off a local slope of DEM. More...
#include <Hillshade.h>
Public Member Functions | |
Hillshade () | |
Create a default-constructed Hillshade. | |
Hillshade (Angle azimuth, Angle zenith, double resolution) | |
Construct and fully initialize a Hillshade. | |
Hillshade (const Hillshade &other) | |
Copy constructor. | |
~Hillshade () | |
void | setAzimuth (Angle azimuth) |
The azimuth is the direction of the light. | |
void | setZenith (Angle zenith) |
The zenith is the altitude/solar elevation of the light. | |
void | setResolution (double resolution) |
The resolution is the meters per pixel of the input to shadedValue(). | |
Angle | azimuth () const |
Get the current azimuth angle. | |
Angle | zenith () const |
Get the current zenith angle. | |
double | resolution () const |
Get the current resolution (meters per pixel). | |
double | shadedValue (Buffer &input) const |
Calculate the shaded value from a 3x3x1 window. | |
void | swap (Hillshade &other) |
Swap class data with other; this cannot throw an exception. | |
Hillshade & | operator= (const Hillshade &rhs) |
Assignment operator. | |
QString | toString () const |
Calculate light intensity reflected off a local slope of DEM.
This class basically does what the 'shade' application does. This calculates a shaded-relief cube given 3x3 topographic portals. Inputs include the sun angle (azimuth), solar elevation (zenith), and resolution (meters per pixel). This was abstracted out from the shade application, which uses the algorithm described at: http://people.csail.mit.edu/bkph/papers/Hill-Shading.pdf
I (Steven Lambright) took the code, originally authored by Tracie Sucharski, from the shade program and re-implemented it in this class.
This class is re-entrant and const methods are thread-safe.
Isis::Hillshade::Hillshade | ( | ) |
Create a default-constructed Hillshade.
You must use mutators to initialize this instance before it can be used to calculate shaded values.
References Isis::Null.
Construct and fully initialize a Hillshade.
This can immediately calculate shaded values.
References azimuth(), Isis::Null, resolution(), setAzimuth(), setResolution(), setZenith(), and zenith().
Isis::Hillshade::Hillshade | ( | const Hillshade & | other | ) |
Copy constructor.
Isis::Hillshade::~Hillshade | ( | ) |
References Isis::Null.
Angle Isis::Hillshade::azimuth | ( | ) | const |
double Isis::Hillshade::resolution | ( | ) | const |
Get the current resolution (meters per pixel).
Referenced by Hillshade(), and setResolution().
void Isis::Hillshade::setAzimuth | ( | Angle | azimuth | ) |
The azimuth is the direction of the light.
0 is north; this angle rotates the sun.
An invalid angle will silently fail; if shadedValue() is called without a valid azimuth angle then an exception will be thrown.
References azimuth(), and Isis::Angle::isValid().
Referenced by Hillshade().
void Isis::Hillshade::setResolution | ( | double | resolution | ) |
The resolution is the meters per pixel of the input to shadedValue().
A special pixel value will silently fail; if shadedValue() is called without a valid resolution angle then an exception will be thrown.
References resolution().
Referenced by Hillshade().
void Isis::Hillshade::setZenith | ( | Angle | zenith | ) |
The zenith is the altitude/solar elevation of the light.
0 is directly above and 90 is the horizon; this angle raises and lowers the sun.
An invalid angle will silently fail; if shadedValue() is called without a valid zenith angle then an exception will be thrown.
References Isis::Angle::isValid(), and zenith().
Referenced by Hillshade().
double Isis::Hillshade::shadedValue | ( | Buffer & | input | ) | const |
Calculate the shaded value from a 3x3x1 window.
References _FILEINFO_, Isis::Angle::Degrees, Isis::Angle::fullRotation(), Isis::IsSpecial(), Isis::Null, Isis::IException::Programmer, Isis::Angle::radians(), Isis::Angle::toString(), and Isis::IException::Unknown.
void Isis::Hillshade::swap | ( | Hillshade & | other | ) |
Swap class data with other; this cannot throw an exception.
Referenced by operator=().
QString Isis::Hillshade::toString | ( | ) | const |
Angle Isis::Hillshade::zenith | ( | ) | const |