vil_nitf2_image_subheader Class Reference

#include <vil_nitf2_image_subheader.h>

List of all 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.


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
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_treeget_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_correction_offset (double &u_off, double &v_off)

Static Protected Member Functions

static const vil_nitf2_field_definitionsget_field_definitions_21 ()
static const vil_nitf2_field_definitionsget_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_definitionss_field_definitions_21
static vil_nitf2_field_definitionss_field_definitions_20

Friends

void vil_nitf2::cleanup_static_members ()

Constructor & Destructor Documentation

vil_nitf2_image_subheader::vil_nitf2_image_subheader ( vil_nitf2_classification::file_version  version  ) 

Definition at line 21 of file vil_nitf2_image_subheader.cxx.

vil_nitf2_image_subheader::~vil_nitf2_image_subheader (  )  [virtual]

Definition at line 36 of file vil_nitf2_image_subheader.cxx.


Member Function Documentation

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

unsigned vil_nitf2_image_subheader::nplanes (  )  const

Definition at line 353 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_pixels_per_block_x (  )  const

Definition at line 370 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_pixels_per_block_y (  )  const

Definition at line 379 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_num_blocks_x (  )  const

Definition at line 388 of file vil_nitf2_image_subheader.cxx.

unsigned int vil_nitf2_image_subheader::get_num_blocks_y (  )  const

Definition at line 397 of file vil_nitf2_image_subheader.cxx.

bool vil_nitf2_image_subheader::has_data_mask_table (  )  const [inline]

Definition at line 59 of file vil_nitf2_image_subheader.h.

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

Definition at line 60 of file vil_nitf2_image_subheader.h.

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 interpretted. 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 406 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 432 of file vil_nitf2_image_subheader.cxx.

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.ismc.nima.mil/ntb/superceded/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 848 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 555 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 777 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 64 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 77 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 338 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 260 of file vil_nitf2_image_subheader.cxx.

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 209 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 91 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 444 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 526 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 590 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 717 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 636 of file vil_nitf2_image_subheader.cxx.

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

Definition at line 672 of file vil_nitf2_image_subheader.cxx.


Friends And Related Function Documentation

void vil_nitf2::cleanup_static_members (  )  [friend]


Member Data Documentation

vil_nitf2_field_sequence vil_nitf2_image_subheader::m_field_sequence [protected]

Definition at line 122 of file vil_nitf2_image_subheader.h.

vil_nitf2_data_mask_table* vil_nitf2_image_subheader::m_data_mask_table [protected]

Definition at line 123 of file vil_nitf2_image_subheader.h.

vil_nitf2_classification::file_version vil_nitf2_image_subheader::m_version [protected]

Definition at line 125 of file vil_nitf2_image_subheader.h.

vil_nitf2_field_definitions * vil_nitf2_image_subheader::s_field_definitions_21 [static, private]

Definition at line 142 of file vil_nitf2_image_subheader.h.

vil_nitf2_field_definitions * vil_nitf2_image_subheader::s_field_definitions_20 [static, private]

Definition at line 143 of file vil_nitf2_image_subheader.h.


The documentation for this class was generated from the following files:
Generated on Tue Oct 7 05:07:50 2008 for core/vil by  doxygen 1.5.1