HiRISE
 PDS_JP2

Public Member Functions | Static Public Attributes | Protected Member Functions

Image_Data_Block Class Reference

An Image_Data_Block describes PDS image data. More...

#include <Image_Data_Block.hh>

Inheritance diagram for Image_Data_Block:
Inheritance graph
[legend]
Collaboration diagram for Image_Data_Block:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 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.
 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.
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.

Detailed Description

An Image_Data_Block describes PDS image data.

An Image_Data_Block is a PDS_Data_Block that specializes in describing PDS image data.

Author:
Bradford Castalia, Drew Davidson and Ben Pearson, UA/HiROC
Version:
1.13
See also:
PDS_Data_Block

Constructor & Destructor Documentation

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:
parametersParameter Aggregate describing the data block
file_offsetImage 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:
parametersParameter Aggregate describing the data block
filenameName of file containing the image.

Member Function Documentation

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.

Returns:
The number of image bands.

Referenced by main().

unsigned int image_width (  ) [inline]

Get the width of the image.

Returns:
The number of pixels in each line of the image. This will be zero if the value could not be determined from the IMAGE_WIDTH_PARAMETER_NAME parameter.

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.

Returns:
The number of lines in the image. This will be zero if the value could not be determined from the IMAGE_HEIGHT_PARAMETER_NAME parameter.

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.

Returns:
The number of storage bytes per pixel. This will be zero if the value could not be determined from the PIXEL_BYTES_PARAMETER_NAME parameter.

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.

Returns:
The number of valid bits in a pixel. This will be zero if neither the PIXEL_BITS_PARAMETER_NAME parameter could be found nor the bytes per pixel determined.

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.

Returns:
1 if the data is signed, -1 if unsigned, 0 if unknown.

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.

Returns:
1 if the data is MSB ordered, -1 if LSB ordered, 0 if unknown.

Referenced by main().

unsigned int line_prefix_bytes (  ) [inline]

Get the number of line prefix bytes.

Returns:
The number of bytes preceeding each image pixel data line. This will be zero if the value could not be determined from the LINE_PREFIX_BYTES_PARAMETER_NAME parameter.

Referenced by main().

unsigned int line_suffix_bytes (  ) [inline]

Get the number of line suffix bytes.

Returns:
The number of bytes following each image pixel data line. This will be zero if the value could not be determined from the LINE_SUFFIX_BYTES_PARAMETER_NAME parameter.

Referenced by main().

std::string source_filename (  )
std::string source_filename ( std::string &  pathname )
unsigned long long data_block_size (  ) [protected, virtual]

Member Data Documentation

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().


The documentation for this class was generated from the following files: