PDS_JP2
|
An Image_Data_Block describes PDS image data. More...
#include <Image_Data_Block.hh>
Public Member Functions | |
Image_Data_Block () | |
Constructs an empty Image_Data_Block. | |
Image_Data_Block (const idaeim::PVL::Aggregate ¶meters, std::ios::off_type file_offset) | |
Constructs an Image_Data_Block for an IMAGE OBJECT. | |
Image_Data_Block (const idaeim::PVL::Aggregate ¶meters, const std::string &filename) | |
Constructs an Image_Data_Block for an IMAGE OBJECT in a detached file. | |
unsigned int | image_bands () |
Get the number of bands in the image. | |
unsigned int | image_width () |
Get the width of the image. | |
unsigned int | image_height () |
Get the height of the image. | |
unsigned int | pixel_bytes () |
Get the storage size of a pixel in bytes. | |
unsigned int | pixel_bits () |
Get the number valid bits (data precision) in a pixel. | |
int | signed_data () |
Check if the pixel data is signed. | |
int | MSB_data () |
Determine if the pixel data is MSB ordered. | |
unsigned int | line_prefix_bytes () |
Get the number of line prefix bytes. | |
unsigned int | line_suffix_bytes () |
Get the number of line suffix bytes. | |
std::string | source_filename () |
std::string | source_filename (std::string &pathname) |
Static Public Attributes | |
static const char *const | ID = "UA::HiRISE::Image_Data_Block (1.14 2013/03/14 21:00:43)" |
Class identification name with source code version and date. | |
static const char *const | IMAGE_BANDS_PARAMETER_NAME = "BANDS" |
The name of the parameter used to obtain the image bands value. | |
static const char *const | IMAGE_WIDTH_PARAMETER_NAME = "LINE_SAMPLES" |
The name of the parameter used to obtain the image width value. | |
static const char *const | IMAGE_HEIGHT_PARAMETER_NAME = "LINES" |
The name of the parameter used to obtain the image height value. | |
static const char *const | PIXEL_BYTES_PARAMETER_NAME = "SAMPLE_BITS" |
The name of the parameter used to obtain the pixel storage bytes value. | |
static const char *const | PIXEL_BITS_PARAMETER_NAME = "SAMPLE_BIT_MASK" |
The name of the parameter used to obtain the valid pixel bits value. | |
static const char *const | PIXEL_DATA_TYPE_PARAMETER_NAME = "SAMPLE_TYPE" |
The name of the parameter used to obtain the pixel data type values. | |
static const char *const | UNSIGNED_PIXEL_TYPE_IDENTIFIER = "UNSIGNED" |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an unsigned pixel value. | |
static const char *const | SIGNED_PIXEL_TYPE_IDENTIFIER = "SIGNED" |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies a signed pixel value. | |
static const char *const | LSB_PIXEL_TYPE_IDENTIFIER = "LSB" |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an LSB ordered pixel. | |
static const char *const | MSB_PIXEL_TYPE_IDENTIFIER = "MSB" |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an MSB ordered pixel. | |
static const char *const | LINE_PREFIX_BYTES_PARAMETER_NAME = "LINE_PREFIX_BYTES" |
The name of the parameter used to obtain the line prefix bytes value. | |
static const char *const | LINE_SUFFIX_BYTES_PARAMETER_NAME = "LINE_SUFFIX_BYTES" |
The name of the parameter used to obtain the line suffix bytes value. | |
Protected Member Functions | |
virtual unsigned long long | data_block_size () |
Calculate the size of the binary data block. |
An Image_Data_Block describes PDS image data.
An Image_Data_Block is a PDS_Data_Block that specializes in describing PDS image data.
Image_Data_Block | ( | ) |
Constructs an empty Image_Data_Block.
Image_Data_Block | ( | const idaeim::PVL::Aggregate & | parameters, |
std::ios::off_type | file_offset | ||
) |
Constructs an Image_Data_Block for an IMAGE OBJECT.
parameters | Parameter Aggregate describing the data block |
file_offset | Image data block offset location in the source file. |
Image_Data_Block | ( | const idaeim::PVL::Aggregate & | parameters, |
const std::string & | filename | ||
) |
Constructs an Image_Data_Block for an IMAGE OBJECT in a detached file.
parameters | Parameter Aggregate describing the data block |
filename | Name of file containing the image. |
unsigned int image_bands | ( | ) | [inline] |
Get the number of bands in the image.
The number of image bands is assumed to be 1 if it can not be determined from the IMAGE_BANDS_PARAMETER_NAME parameter.
Referenced by main().
unsigned int image_width | ( | ) | [inline] |
Get the width of the image.
Referenced by HiRISE_PDS_Converter::adjust_image_map_projection(), HiPrecision_PDS_Converter::adjust_image_map_projection(), and main().
unsigned int image_height | ( | ) | [inline] |
Get the height of the image.
Referenced by HiRISE_PDS_Converter::adjust_image_map_projection(), HiPrecision_PDS_Converter::adjust_image_map_projection(), and main().
unsigned int pixel_bytes | ( | ) | [inline] |
Get the storage size of a pixel in bytes.
N.B.: The number of valid bits in a pixel may be less than the total number of bits in the pixel bytes used to store the pixel.
Referenced by main().
unsigned int pixel_bits | ( | ) | [inline] |
Get the number valid bits (data precision) in a pixel.
If the number of bits per pixel can not be determined from the PIXEL_BITS_PARAMETER_NAME parameter the valid pixel bits are assumed to be all bits in the pixel bytes.
N.B.: The number of valid bits in a pixel may be less than the total number of bits in the pixel bytes used to store the pixel. The valid pixel bits occupy the least significant bits of the pixel bytes.
Referenced by main().
int signed_data | ( | ) | [inline] |
Check if the pixel data is signed.
The signedness of the data is determined by identifying the UNSIGNED_PIXEL_TYPE_IDENTIFIER or SIGNED_PIXEL_TYPE_IDENTIFIER substring in the PIXEL_DATA_TYPE_PARAMETER_NAME parameter.
Referenced by main().
int MSB_data | ( | ) | [inline] |
Determine if the pixel data is MSB ordered.
The data order is determined by identifying the LSB_PIXEL_TYPE_IDENTIFIER or MSB_PIXEL_TYPE_IDENTIFIER substring in the PIXEL_DATA_TYPE_PARAMETER_NAME parameter.
Referenced by main().
unsigned int line_prefix_bytes | ( | ) | [inline] |
Get the number of line prefix bytes.
Referenced by main().
unsigned int line_suffix_bytes | ( | ) | [inline] |
Get the number of line suffix bytes.
Referenced by main().
std::string source_filename | ( | ) |
Referenced by main(), and Image_Data_Block::source_filename().
std::string source_filename | ( | std::string & | pathname ) |
References Image_Data_Block::source_filename().
unsigned long long data_block_size | ( | ) | [protected, virtual] |
Calculate the size of the binary data block.
The image data block size is calculated as:
image_height() * (line_prefix_bytes() + (image_width() * pixel_bytes()) + line_suffix_bytes()) image_bands()
N.B.: All of the image characterization values are determined in this method. It is presumed that it is called when the object is constructed.
Reimplemented from PDS_Data_Block.
References PDS_Data::find_parameter(), Image_Data_Block::IMAGE_BANDS_PARAMETER_NAME, Image_Data_Block::IMAGE_HEIGHT_PARAMETER_NAME, Image_Data_Block::IMAGE_WIDTH_PARAMETER_NAME, Image_Data_Block::LINE_PREFIX_BYTES_PARAMETER_NAME, Image_Data_Block::LINE_SUFFIX_BYTES_PARAMETER_NAME, Image_Data_Block::LSB_PIXEL_TYPE_IDENTIFIER, Image_Data_Block::MSB_PIXEL_TYPE_IDENTIFIER, Parameter::name(), Image_Data_Block::PIXEL_BITS_PARAMETER_NAME, Image_Data_Block::PIXEL_BYTES_PARAMETER_NAME, Image_Data_Block::PIXEL_DATA_TYPE_PARAMETER_NAME, Image_Data_Block::SIGNED_PIXEL_TYPE_IDENTIFIER, Image_Data_Block::UNSIGNED_PIXEL_TYPE_IDENTIFIER, and Parameter::value().
const char *const ID = "UA::HiRISE::Image_Data_Block (1.14 2013/03/14 21:00:43)" [static] |
Class identification name with source code version and date.
Reimplemented from PDS_Data_Block.
const char *const IMAGE_BANDS_PARAMETER_NAME = "BANDS" [static] |
The name of the parameter used to obtain the image bands value.
Referenced by Image_Data_Block::data_block_size().
const char *const IMAGE_WIDTH_PARAMETER_NAME = "LINE_SAMPLES" [static] |
The name of the parameter used to obtain the image width value.
Referenced by Image_Data_Block::data_block_size().
const char *const IMAGE_HEIGHT_PARAMETER_NAME = "LINES" [static] |
The name of the parameter used to obtain the image height value.
Referenced by Image_Data_Block::data_block_size().
const char *const PIXEL_BYTES_PARAMETER_NAME = "SAMPLE_BITS" [static] |
The name of the parameter used to obtain the pixel storage bytes value.
Referenced by Image_Data_Block::data_block_size().
const char *const PIXEL_BITS_PARAMETER_NAME = "SAMPLE_BIT_MASK" [static] |
The name of the parameter used to obtain the valid pixel bits value.
Referenced by Image_Data_Block::data_block_size().
const char *const PIXEL_DATA_TYPE_PARAMETER_NAME = "SAMPLE_TYPE" [static] |
The name of the parameter used to obtain the pixel data type values.
Referenced by Image_Data_Block::data_block_size().
const char *const UNSIGNED_PIXEL_TYPE_IDENTIFIER = "UNSIGNED" [static] |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an unsigned pixel value.
Referenced by Image_Data_Block::data_block_size().
const char *const SIGNED_PIXEL_TYPE_IDENTIFIER = "SIGNED" [static] |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies a signed pixel value.
Referenced by Image_Data_Block::data_block_size().
const char *const LSB_PIXEL_TYPE_IDENTIFIER = "LSB" [static] |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an LSB ordered pixel.
Referenced by Image_Data_Block::data_block_size().
const char *const MSB_PIXEL_TYPE_IDENTIFIER = "MSB" [static] |
Substring of the PIXEL_DATA_TYPE_PARAMETER_NAME parameter that identifies an MSB ordered pixel.
Referenced by Image_Data_Block::data_block_size().
const char *const LINE_PREFIX_BYTES_PARAMETER_NAME = "LINE_PREFIX_BYTES" [static] |
The name of the parameter used to obtain the line prefix bytes value.
Referenced by Image_Data_Block::data_block_size().
const char *const LINE_SUFFIX_BYTES_PARAMETER_NAME = "LINE_SUFFIX_BYTES" [static] |
The name of the parameter used to obtain the line suffix bytes value.
Referenced by Image_Data_Block::data_block_size().