HiRISE
 PDS_JP2

Classes | Functions
UA::HiRISE Namespace Reference

Classes

struct  Point_2D
 A Point_2D holds 2-dimensional position information. More...
 
struct  Size_2D
 A Size_2D holds 2-dimensional size information. More...
 
struct  Rectangle
 A Rectangle is a position with a size. More...
 
class  Generic_PDS_Converter
 A Generic_PDS_Converter is used to convert a generic image data product PDS label between its attached PDS form and its detached PDS/JP2 form. More...
 
class  HiPrecision_PDS_Converter
 A HiRISE_PDS_Converter is used to convert a HiRISE image data product PDS label between its attached PDS form and its detached PDS/JP2 form. More...
 
class  HiRISE_PDS_Converter
 A HiRISE_PDS_Converter is used to convert a HiRISE image data product PDS label between its attached PDS form and its detached PDS/JP2 form. More...
 
class  Image_Data_Block
 An Image_Data_Block describes PDS image data. More...
 
class  JP2_Box
 A JP2_Box contains JP2 file format box data. More...
 
class  JP2_Decoder
 A JP2_Decoder decodes image pixel data from a JPEG2000 JP2 image file. More...
 
class  JP2_Encoder
 A JP2_Encoder encodes image pixel data into a JPEG2000 JP2 file. More...
 
class  PDS_Converter
 A PDS_Converter is used to convert an attached PDS image label to or from a detached PDS/JP2 label. More...
 
class  PDS_Data
 PDS_Data contains PDS label PVL parameters. More...
 
class  PDS_Data_Block
 A PDS_Data_Block describes a binary data block in a PDS label. More...
 
class  PDS_Projection_Data
 The PDS_Projection_Data provides geographic projection capabilities between image and real world coordinates. More...
 

Functions

std::ostream & operator<< (std::ostream &stream, const Point_2D &point)
 Print a Point_2D description to an output stream. More...
 
std::ostream & operator<< (std::ostream &stream, const Size_2D &size)
 Print a Size_2D description to an output stream. More...
 
std::ostream & operator<< (std::ostream &stream, const Rectangle &rectangle)
 Print a Rectangle description to an output stream. More...
 
bool power_of_2 (unsigned int value)
 Test if a value is a power of 2. More...
 
PDS_Converterconverter_for (const std::string &pathname)
 Get a PDS_Converter for a data source. More...
 
Parameterfind_parameter (const idaeim::PVL::Aggregate &parameters, const std::string &pathname, bool case_sensitive=false, int skip=0, PDS_Data::Parameter_Class_Selection parameter_class=PDS_Data::ANY_PARAMETER)
 Find a named Parameter within a Parameter Aggregate. More...
 
Parameterremove_parameter (idaeim::PVL::Aggregate &parameters, const std::string &pathname, bool case_sensitive=false, int skip=0, PDS_Data::Parameter_Class_Selection parameter_class=PDS_Data::ANY_PARAMETER)
 Removes a named Parameter within a Parameter Aggregate. More...
 
double numeric_value (const idaeim::PVL::Parameter &parameter)
 Get the numeric value of a parameter. More...
 
std::string string_value (const idaeim::PVL::Parameter &parameter)
 Get the string value of a parameter. More...
 
std::string absolute_pathname (const std::string &pathname)
 Ensure an absolute pathname. More...
 
string to_uppercase (const string &a_string)
 
string indent (std::string lines, int amount)
 Indent lines of text by the specified number of spaces. More...
 
idaeim::PVL::Listerlabel_lister ()
 Get a PVL Lister appropriately configured for PDS label generation. More...
 
std::string to_uppercase (const std::string &a_string)
 Convert a string to all uppercase form. More...
 

Function Documentation

◆ operator<<() [1/3]

std::ostream & operator<< ( std::ostream &  stream,
const Point_2D point 
)

Print a Point_2D description to an output stream.

Parameters
streamThe ostream where the Point_2D will be printed.
pointThe Point_2D to be printed.
Returns
The stream that was written.

◆ operator<<() [2/3]

std::ostream & operator<< ( std::ostream &  stream,
const Size_2D size 
)

Print a Size_2D description to an output stream.

Parameters
streamThe ostream where the Size_2D will be printed.
sizeThe Size_2D to be printed.
Returns
The stream that was written.

◆ operator<<() [3/3]

std::ostream & operator<< ( std::ostream &  stream,
const Rectangle rectangle 
)

Print a Rectangle description to an output stream.

Parameters
streamThe ostream where the Rectangle will be printed.
rectangleThe Rectangle to be printed.
Returns
The stream that was written.

◆ power_of_2()

bool power_of_2 ( unsigned int  value)

Test if a value is a power of 2.

Parameters
valueAn unsigned integer value.
Returns
true if the value is a power of 2 (including 0); false otherwise.

Referenced by JP2_Encoder::invalid_precinct_size(), main(), and JP2_Encoder::precinct_size().

◆ converter_for()

PDS_Converter * converter_for ( const std::string &  pathname)

Get a PDS_Converter for a data source.

An attempt is made to construct a specific PDS_Converter on the source pathname. The most specific converters are tried before the Generic_PDS_Converter is finally tried. Each known PDS_Converter implementation is tried until one can be constructed and the source file label is recognized. If the constructor throws an exception it, and the converter, will be ignored.

N.B.: When a new PDS_Converter is implemented it must be added to the sequence of constructor tries. The converter's label_recognized method must return true to indicate that it is suitable for the specified source.

Any exception thrown by the Generic_PDS_Converter will be propogated.

Parameters
pathnameThe pathname string to the data source.
Returns
A pointer to a PDS_Converter, or NULL if no suitable converter can be constructed.
See also
PDS_Converter
Generic_PDS_Converter
HiRISE_PDS_Converter

Referenced by main().

◆ find_parameter()

idaeim::PVL::Parameter * find_parameter ( const idaeim::PVL::Aggregate parameters,
const std::string &  pathname,
bool  case_sensitive = false,
int  skip = 0,
PDS_Data::Parameter_Class_Selection  parameter_class = PDS_Data::ANY_PARAMETER 
)

Find a named Parameter within a Parameter Aggregate.

The Parameter to be found may be specified by a simple name, a relative pathname or an absolute pathname. A simple name is the name of a Parameter itself. A relative pathname is a simple name preceeded by the pathname of an Aggregate Parameter that must contain the Parameter with the simple name. An absolute pathname is a pathname that begins with a pathname delimiter ('/'); i.e. it is a fully qualified pathname beginning at the root of the Aggregate hierarchy, compared to a relative pathname that may begin at any Aggregate in the hierarchy.

Since it is not necessary that the pathname to each Parameter be unique, the number of matching pathnames to skip before selecting a Parameter may need to be specified to get the desired Parameter. Also, a specific type of Parameter - an Aggregate of Parameters or an Assignment of Values - may be specified. When skipping parameters, only the specified type, if any, are counted.

Parameters
parametersThe Aggregate within which to search.
pathnameThe pathname of the parameter to find.
case_sensitiveIf true, the name search is case sensitive; case insensitive otherwise.
skipThe number of parameters that match the name to skip before selecting a matching parameter.
parameter_classA PDS::Parameter_Class_Selection: If PDS_Data::AGGREGATE_PARAMETER, only Aggregate parameters will be selected; if PDS_Data::ASSIGNMENT_PARAMETER, only Assignment parameters will be selected; otherwise any type of parameter (PDS_Data::ANY_PARAMETER) is acceptable.
Returns
A pointer to the matching parameter, or NULL if it could not be found.
See also
PVL::Parameter::at_pathname()

References Parameter::name().

Referenced by HiPrecision_PDS_Converter::data_set_version(), HiRISE_PDS_Converter::data_set_version(), PDS_Data::find_parameter(), Generic_PDS_Converter::parameter_of(), and remove_parameter().

◆ remove_parameter()

idaeim::PVL::Parameter * remove_parameter ( idaeim::PVL::Aggregate parameters,
const std::string &  pathname,
bool  case_sensitive = false,
int  skip = 0,
PDS_Data::Parameter_Class_Selection  parameter_class = PDS_Data::ANY_PARAMETER 
)

Removes a named Parameter within a Parameter Aggregate.

Parameters
parametersThe Aggregate within which to search.
pathnameThe name of the parameter to find.
case_sensitiveIf true, the name search is case sensitive; case insensitive otherwise.
skipThe number of parameters that match the name to skip before selecting a matching parameter.
parameter_classA Parameter_Class_Selection: If AGGREGATE_PARAMETER, only Aggregate parameters will be selected; if ASSIGNMENT_PARAMETER, only Assignment parameters will be selected; otherwise any type of parameter (ANY_PARAMETER) is acceptable.
Returns
A pointer to the parameter that was removed, or NULL if it could not be found.

References find_parameter(), Parameter::parent(), and Aggregate::remove().

Referenced by PDS_Data::remove_parameter().

◆ numeric_value()

double numeric_value ( const idaeim::PVL::Parameter parameter)

Get the numeric value of a parameter.

Parameters
parameterThe parameter from which to obtain a numeric value.
Returns
The value of the parameter as a double.
Exceptions
idaeim::PVL_Invalid_ValueIf the Value is not Numeric.

References PDS_Data::ID, Value::is_Numeric(), Parameter::pathname(), Value::type_name(), and Parameter::value().

Referenced by PDS_Data::numeric_value().

◆ string_value()

std::string string_value ( const idaeim::PVL::Parameter parameter)

Get the string value of a parameter.

Parameters
parameterThe parameter from which to obtain a string value.
Returns
The value of the parameter as a string.
Exceptions
idaeim::PVL_Invalid_ValueIf the Value is not a String.

References PDS_Data::ID, Value::is_String(), Parameter::pathname(), Value::type_name(), and Parameter::value().

Referenced by PDS_Data::string_value().

◆ absolute_pathname()

std::string absolute_pathname ( const std::string &  pathname)

◆ to_uppercase() [1/2]

string UA::HiRISE::to_uppercase ( const string &  a_string)

◆ indent()

std::string indent ( std::string  lines,
int  amount 
)

Indent lines of text by the specified number of spaces.

The beginning of each line of text - where a line is terminated by a new-line ('
') character - is prepended with the specified amount of whitespace (' ' characters). If no new-line is present but the lines string is not empty it is taken to be a single line that is shifted.

Parameters
linesAn arbitrary string.
amountThe amount of whitespace to shift the lines. If this is less than or equal to zero no shifting is done.
Returns
The modified lines string.

Referenced by main().

◆ label_lister()

idaeim::PVL::Lister * label_lister ( )

Get a PVL Lister appropriately configured for PDS label generation.

The Lister will be configured to use strict mode except: Begin and End name markers on Aggregates will not be included, assignment value alignment will be enabled, array indenting will be enabled, single line commenting style will be used, and the statement end delimiter will not be used.

Returns
A pointer to an idaeim::PVL::Lister that has been allocated on the heap. N.B.: Delete when no longer needed.

Referenced by PDS_Converter::write_label(), and Generic_PDS_Converter::write_PDS_label().

◆ to_uppercase() [2/2]

std::string UA::HiRISE::to_uppercase ( const std::string &  a_string)

Convert a string to all uppercase form.

Parameters
a_stringThe string to be converted.
Returns
A copy of the given string with all characters converted to uppercase.