Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Member Functions | Static Private Attributes | Friends
vil_nitf2_image_subheader Class Reference

This class is responsible for parsing a NITF 2.1 image header. More...

#include <vil_nitf2_image_subheader.h>

List of all members.

Public Member Functions

 vil_nitf2_image_subheader (vil_nitf2_classification::file_version version)
virtual ~vil_nitf2_image_subheader ()
virtual bool read (vil_stream *stream)
 Read the image header starting at stream's current position.
template<class T >
bool get_property (vcl_string tag, T &out_value) const
 Sets out_value to the value of field specified by tag.
template<class T >
bool get_property (vcl_string tag, int i, T &out_value) const
 Sets out_value to the value of vcl_vector field element specified by tag and index.
unsigned int nplanes () const
unsigned int get_pixels_per_block_x () const
unsigned int get_pixels_per_block_y () const
unsigned int get_num_blocks_x () const
unsigned int get_num_blocks_y () const
unsigned int get_number_of_bits_per_pixel () const
vcl_string get_image_source () const
vcl_string get_image_type () const
bool has_data_mask_table () const
const vil_nitf2_data_mask_tabledata_mask_table () const
bool get_lut_info (unsigned int band, int &n_luts, int &ne_lut, vcl_vector< vcl_vector< unsigned char > > &lut_d) const
 Returns true if the ith image band in this image subheader has LUT info and false otherwise.
virtual
vil_nitf2_field::field_tree
get_tree (int i=0) const
bool get_rpc_params (vcl_string &rpc_type, vcl_string &image_id, vcl_string &image_corner_geo_locations, double *rpc_data)
 Get RPC parameters, if present. User provides rpc_data array.
bool get_sun_params (double &sun_el, double &sun_az)
 Return the elevation and azimuth angles of the sun.
bool get_date_time (int &year, int &month, int &day, int &hour, int &min)
 Extract the date and time.
bool get_correction_offset (double &u_off, double &v_off)

Static Protected Member Functions

static const
vil_nitf2_field_definitions
get_field_definitions_21 ()
static const
vil_nitf2_field_definitions
get_field_definitions_20 ()

Protected Attributes

vil_nitf2_field_sequence m_field_sequence
vil_nitf2_data_mask_tablem_data_mask_table
vil_nitf2_classification::file_version m_version

Static Private Member Functions

static void add_shared_field_defs_1 (vil_nitf2_field_definitions *defs)
static void add_shared_field_defs_2 (vil_nitf2_field_definitions *defs)
static void add_geo_field_defs (vil_nitf2_field_definitions *defs, const vil_nitf2_classification::file_version &version)
static void add_shared_field_defs_3 (vil_nitf2_field_definitions *defs)
static void add_rpc_definitions ()
static void add_USE_definitions ()
static void add_ICHIPB_definitions ()
static void add_MPD26A_definitions ()
static void add_STDIDC_definitions ()
static void add_STDIDB_definitions ()

Static Private Attributes

static
vil_nitf2_field_definitions
s_field_definitions_21 = 0
static
vil_nitf2_field_definitions
s_field_definitions_20 = 0

Friends

void vil_nitf2::cleanup_static_members ()

Detailed Description

This class is responsible for parsing a NITF 2.1 image header.

It is used by vil_nitf_image for this purpose. You can access any of the information in the header via the appropriate get_property() function. There are also some shortcut functions for getting commonly needed data like nplanes() etc.

Definition at line 25 of file vil_nitf2_image_subheader.h.


Constructor & Destructor Documentation

vil_nitf2_image_subheader::vil_nitf2_image_subheader ( vil_nitf2_classification::file_version  version)

Definition at line 22 of file vil_nitf2_image_subheader.cxx.

vil_nitf2_image_subheader::~vil_nitf2_image_subheader ( ) [virtual]

Definition at line 37 of file vil_nitf2_image_subheader.cxx.


Member Function Documentation

void vil_nitf2_image_subheader::add_geo_field_defs ( vil_nitf2_field_definitions defs,
const vil_nitf2_classification::file_version version 
) [static, private]

Definition at line 211 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_ICHIPB_definitions ( ) [static, private]

intelligent data.

full image coordinate system.

Definition at line 711 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_MPD26A_definitions ( ) [static, private]

Definition at line 823 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_rpc_definitions ( ) [static, private]

Definition at line 563 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_shared_field_defs_1 ( vil_nitf2_field_definitions defs) [static, private]

Definition at line 336 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_shared_field_defs_2 ( vil_nitf2_field_definitions defs) [static, private]

Definition at line 258 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_shared_field_defs_3 ( vil_nitf2_field_definitions defs) [static, private]

Definition at line 93 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_STDIDB_definitions ( ) [static, private]

Definition at line 787 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_STDIDC_definitions ( ) [static, private]

Definition at line 756 of file vil_nitf2_image_subheader.cxx.

void vil_nitf2_image_subheader::add_USE_definitions ( ) [static, private]

Definition at line 646 of file vil_nitf2_image_subheader.cxx.

const vil_nitf2_data_mask_table* vil_nitf2_image_subheader::data_mask_table ( ) const [inline]

Definition at line 63 of file vil_nitf2_image_subheader.h.

bool vil_nitf2_image_subheader::get_correction_offset ( double &  u_off,
double &  v_off 
)

Definition at line 883 of file vil_nitf2_image_subheader.cxx.

bool vil_nitf2_image_subheader::get_date_time ( int &  year,
int &  month,
int &  day,
int &  hour,
int &  min 
)

Extract the date and time.

Definition at line 394 of file vil_nitf2_image_subheader.cxx.

const vil_nitf2_field_definitions * vil_nitf2_image_subheader::get_field_definitions_20 ( ) [static, protected]

Definition at line 79 of file vil_nitf2_image_subheader.cxx.

const vil_nitf2_field_definitions * vil_nitf2_image_subheader::get_field_definitions_21 ( ) [static, protected]

Definition at line 66 of file vil_nitf2_image_subheader.cxx.

vcl_string vil_nitf2_image_subheader::get_image_source ( ) const

Definition at line 506 of file vil_nitf2_image_subheader.cxx.

vcl_string vil_nitf2_image_subheader::get_image_type ( ) const

Definition at line 515 of file vil_nitf2_image_subheader.cxx.

bool vil_nitf2_image_subheader::get_lut_info ( unsigned int  band,
int &  n_luts,
int &  ne_lut,
vcl_vector< vcl_vector< unsigned char > > &  lut_d 
) const

Returns true if the ith image band in this image subheader has LUT info and false otherwise.

If it returns true, then all the out parameters will be populated from the header data.

Parameters:
n_luts,:number of luts for this image band (NITF spec says it's in the range [1-4] (if luts present)
ne_lut,:number of elements in each lut
lut_d,:the LUT data indexed first by lut, then lut element ie, the last element would be lut_d[n_luts-1][ne_lut-1]

See the NITF spec for exactly how this data is to be interpreted. Here's a summary: LUTS always contain 8 bit unsigned data. If n_luts is 1, then this band is to be transformed into an 8-bit image plane. Each pixel value in the original image can be used as an index into lut_d. (ie. lut_d[0][pixelVal]) If n_luts is 2, then the output image plate will be 16 bits. The MSBs of each of the output pixels will be obtained from lut_d[0] and the LSBs will be obtained from lut_d[1]. If n_luts is 3, then this plane will be transformed into 3 planes: R, G and B. lut_d[0] shall map to Red, lut_d[1] shall map to Green, and lut_d[2] shall map to Blue.

Definition at line 524 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_num_blocks_x ( ) const

Definition at line 479 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_num_blocks_y ( ) const

Definition at line 488 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_number_of_bits_per_pixel ( ) const

Definition at line 497 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_pixels_per_block_x ( ) const

Definition at line 461 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_pixels_per_block_y ( ) const

Definition at line 470 of file vil_nitf2_image_subheader.cxx.

template<class T >
bool vil_nitf2_image_subheader::get_property ( vcl_string  tag,
T &  out_value 
) const [inline]

Sets out_value to the value of field specified by tag.

Returns:
0 if such a field is not found or is of the wrong type.

Definition at line 41 of file vil_nitf2_image_subheader.h.

template<class T >
bool vil_nitf2_image_subheader::get_property ( vcl_string  tag,
int  i,
T &  out_value 
) const [inline]

Sets out_value to the value of vcl_vector field element specified by tag and index.

Returns:
0 if such a field is not found or is of the wrong type.

Definition at line 49 of file vil_nitf2_image_subheader.h.

bool vil_nitf2_image_subheader::get_rpc_params ( vcl_string &  rpc_type,
vcl_string &  image_id,
vcl_string &  image_corner_geo_locations,
double *  rpc_data 
)

Get RPC parameters, if present. User provides rpc_data array.

The parameters describe a camera projection based on the ratio of cubic polynomials in (lon, lat, ele). All variables are normalized to the range [-1, 1] using scale and offset parameters. For further definition of parameters see http://www.gwg.nga.mil/ntb/superseded/vimas/vimas.pdf The returned rpc_data vector is encoded as: rpc_data[0]-rpc_data[19] Line Numerator Cubic Coefficients rpc_data[20]-rpc_data[39] Line Denominator Cubic Coefficients rpc_data[40]-rpc_data[59] Sample Numerator Cubic Coefficients rpc_data[60]-rpc_data[79] Sample Denominator Cubic Coefficients rpc_data[80] Line Offset rpc_data[81] Sample Offset rpc_data[82] Latitude Offset rpc_data[83] Longitude Offset rpc_data[84] Elevation Offset rpc_data[85] Line Scale rpc_data[86] Sample Scale rpc_data[87] Latitude Scale rpc_data[88] Longitude Scale rpc_data[89] Elevation Scale

The ordering of coefficients can vary as indicated by rpc_type Defined extensions are RPC00A and RPC00B.

Definition at line 950 of file vil_nitf2_image_subheader.cxx.

bool vil_nitf2_image_subheader::get_sun_params ( double &  sun_el,
double &  sun_az 
)

Return the elevation and azimuth angles of the sun.

sun_el --> sun elevation angle sun_az --> sun azimuthal angle

Definition at line 676 of file vil_nitf2_image_subheader.cxx.

vil_nitf2_field::field_tree * vil_nitf2_image_subheader::get_tree ( int  i = 0) const [virtual]

Definition at line 551 of file vil_nitf2_image_subheader.cxx.

bool vil_nitf2_image_subheader::has_data_mask_table ( ) const [inline]

Definition at line 62 of file vil_nitf2_image_subheader.h.

unsigned vil_nitf2_image_subheader::nplanes ( ) const

Definition at line 444 of file vil_nitf2_image_subheader.cxx.

bool vil_nitf2_image_subheader::read ( vil_stream stream) [virtual]

Read the image header starting at stream's current position.

Returns:
false if failed

Definition at line 46 of file vil_nitf2_image_subheader.cxx.


Friends And Related Function Documentation

void vil_nitf2::cleanup_static_members ( ) [friend]

Member Data Documentation

Definition at line 128 of file vil_nitf2_image_subheader.h.

Definition at line 127 of file vil_nitf2_image_subheader.h.

Definition at line 130 of file vil_nitf2_image_subheader.h.

Definition at line 148 of file vil_nitf2_image_subheader.h.

Definition at line 147 of file vil_nitf2_image_subheader.h.


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