61 static ossimTrace traceDebug(
"ossimHillshadeUtil:debug");
63 static const std::string COLOR_BLUE_KW =
"color_blue";
64 static const std::string COLOR_GREEN_KW =
"color_green";
65 static const std::string COLOR_RED_KW =
"color_red";
66 static const std::string COLOR_SOURCE_KW =
"color_source";
69 "Computes shaded representation of input elevation surface with specified lighting parameters.";
100 std::string tempString1;
102 std::string tempString2;
104 std::string tempString3;
106 std::string tempString4;
108 std::string tempString5;
110 std::string tempString6;
118 if( ap.
read(
"--azimuth", stringParam1) )
123 if( ap.
read(
"--color", stringParam1, stringParam2, stringParam3) )
130 int color_source_idx = 0;
131 while( ap.
read(
"--color-source", stringParam1) )
140 if ( ap.
read(
"--elevation", stringParam1) )
175 if ( (f >= 0) && (f <= 360) )
188 if ( (f >= 0.0) && (f <= 90) )
231 usageString +=
" hillshade [option]... [input-option]... <input-file(s)> <output-file>\nNote at least one input is required either from one of the input options, e.g. --input-dem <my-dem.hgt> or adding to command line in front of the output file in which case the code will try to ascertain what type of input it is.\n\nAvailable traces:\n-T \"ossimChipperUtil:debug\" - General debug trace to standard out.\n-T \"ossimChipperUtil:log\" - Writes a log file to output-file.log.\n-T \"ossimChipperUtil:options\" - Writes the options to output-file-options.kwl.";
235 au->
addCommandLineOption(
"--azimuth",
"<azimuth>\nLight source azimuth angle for bump shade.\nRange: 0 to 360, Default = 180.0");
236 au->
addCommandLineOption(
"--color",
"<r> <g> <b>\nSet the red, green and blue color values to be used with hillshade.\nRange 0 to 255, Defualt r=255, g=255, b=255");
237 au->
addCommandLineOption(
"--color-source",
"<file>\nSpecifies the image file to use as a color source instead of a fixed RGB value.");
238 au->
addCommandLineOption(
"--elevation",
"<elevation>\nhillshade option - Light source elevation angle for bumb shade.\nRange: 0 to 90, Default = 45.0");
245 <<
"1) Never use same base name in the same directory! Example is you have a Chicago.tif\n" 246 <<
" and you want a Chicago.jp2, output Chicago.jp2 to its own directory.\n" 247 <<
"\nExample command to Hill shade: Hill shade two DEMs, output to a geotiff.\n" 248 << appName <<
" --color 255 255 255 --azimuth 270 --elevation 45 --exaggeration 2.0 N37W123.hgt N38W123.hgt outputs/hillshade.tif\n" 249 <<
"\n// Above command where all options are in a keyword list:\n" 250 << appName <<
" --options r39-options.kwl\n"
std::string getApplicationName() const
return the application name, as specified by argv[0]
void addCommandLineOption(const ossimString &option, const ossimString &explanation)
This uses a derivative of Blinn's bump function to compute a 3-D looking image.
std::basic_ostringstream< char > ostringstream
Class for char output memory streams.
static const char * FILE_KW
const std::string & findKey(const std::string &key) const
Find methods that take std::string(s).
ossim_uint8 toUInt8() const
void addOptions(ossimArgumentParser &parser)
bool read(const std::string &str)
search for an occurance of a string in the argument list, on sucess remove that occurance from the li...
static ossimString toString(bool aValue)
Numeric to string methods.
void addPair(const std::string &key, const std::string &value, bool overwrite=true)
void setCommandLineUsage(const ossimString &explanation)
ossimApplicationUsage * getApplicationUsage()
virtual void setElevationAngle(double angle)
std::string::size_type size() const
void setRgbColorSource(ossim_uint8 r, ossim_uint8 g, ossim_uint8 b)
Set the red, green and blue color source values.
ossim_float64 toFloat64() const
void setTrackScaleFlag(bool flag)
virtual void setAzimuthAngle(double angle)
virtual bool add(ossimConnectableObject *source)
Will return true or false if an image source was added to the chain.
virtual ossim_int32 connectMyInputTo(ossimConnectableObject *inputObject, bool makeOutputConnection=true, bool createEventFlag=true)
Will try to connect this objects input to the passed in object.
static const char * AZIMUTH_ANGLE_KW
void setDescription(const ossimString &desc)
void setSmoothnessFactor(double value)
static ossimInit * instance()
static const char * ELEVATION_ANGLE_KW
void setExpandEnvVarsFlag(bool flag)
unsigned char ossim_uint8
const std::string & string() const