Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Member Functions | Static Private Attributes | Friends | List of all members
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>

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. More...
 
template<class T >
bool get_property (std::string tag, T &out_value) const
 Sets out_value to the value of field specified by tag. More...
 
template<class T >
bool get_property (std::string tag, int i, T &out_value) const
 Sets out_value to the value of std::vector field element specified by tag and index. More...
 
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
 
std::string get_image_source () const
 
std::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, std::vector< std::vector< unsigned char > > &lut_d) const
 Returns true if the ith image band in this image subheader has LUT info and false otherwise. More...
 
virtual vil_nitf2_field::field_treeget_tree (int i=0) const
 
bool get_rpc_params (std::string &rpc_type, std::string &image_id, std::string &image_corner_geo_locations, double *rpc_data)
 Get RPC parameters, if present. User provides rpc_data array. More...
 
bool get_sun_params (double &sun_el, double &sun_az)
 Return the elevation and azimuth angles of the sun. More...
 
bool get_date_time (int &year, int &month, int &day, int &hour, int &min, int &sec)
 Extract the date and time. More...
 
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 = nullptr
 
static vil_nitf2_field_definitionss_field_definitions_20 = nullptr
 

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 28 of file vil_nitf2_image_subheader.h.

Constructor & Destructor Documentation

◆ vil_nitf2_image_subheader()

vil_nitf2_image_subheader::vil_nitf2_image_subheader ( vil_nitf2_classification::file_version  version)

Definition at line 25 of file vil_nitf2_image_subheader.cxx.

◆ ~vil_nitf2_image_subheader()

vil_nitf2_image_subheader::~vil_nitf2_image_subheader ( )
virtual

Definition at line 40 of file vil_nitf2_image_subheader.cxx.

Member Function Documentation

◆ add_geo_field_defs()

void vil_nitf2_image_subheader::add_geo_field_defs ( vil_nitf2_field_definitions defs,
const vil_nitf2_classification::file_version version 
)
staticprivate

Definition at line 214 of file vil_nitf2_image_subheader.cxx.

◆ add_ICHIPB_definitions()

void vil_nitf2_image_subheader::add_ICHIPB_definitions ( )
staticprivate

intelligent data.

full image coordinate system.

Definition at line 747 of file vil_nitf2_image_subheader.cxx.

◆ add_MPD26A_definitions()

void vil_nitf2_image_subheader::add_MPD26A_definitions ( )
staticprivate

Definition at line 859 of file vil_nitf2_image_subheader.cxx.

◆ add_rpc_definitions()

void vil_nitf2_image_subheader::add_rpc_definitions ( )
staticprivate

Definition at line 599 of file vil_nitf2_image_subheader.cxx.

◆ add_shared_field_defs_1()

void vil_nitf2_image_subheader::add_shared_field_defs_1 ( vil_nitf2_field_definitions defs)
staticprivate

Definition at line 339 of file vil_nitf2_image_subheader.cxx.

◆ add_shared_field_defs_2()

void vil_nitf2_image_subheader::add_shared_field_defs_2 ( vil_nitf2_field_definitions defs)
staticprivate

Definition at line 261 of file vil_nitf2_image_subheader.cxx.

◆ add_shared_field_defs_3()

void vil_nitf2_image_subheader::add_shared_field_defs_3 ( vil_nitf2_field_definitions defs)
staticprivate

Definition at line 96 of file vil_nitf2_image_subheader.cxx.

◆ add_STDIDB_definitions()

void vil_nitf2_image_subheader::add_STDIDB_definitions ( )
staticprivate

Definition at line 823 of file vil_nitf2_image_subheader.cxx.

◆ add_STDIDC_definitions()

void vil_nitf2_image_subheader::add_STDIDC_definitions ( )
staticprivate

Definition at line 792 of file vil_nitf2_image_subheader.cxx.

◆ add_USE_definitions()

void vil_nitf2_image_subheader::add_USE_definitions ( )
staticprivate

Definition at line 682 of file vil_nitf2_image_subheader.cxx.

◆ data_mask_table()

const vil_nitf2_data_mask_table* vil_nitf2_image_subheader::data_mask_table ( ) const
inline

Definition at line 66 of file vil_nitf2_image_subheader.h.

◆ get_correction_offset()

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

Definition at line 919 of file vil_nitf2_image_subheader.cxx.

◆ get_date_time()

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

Extract the date and time.

Definition at line 397 of file vil_nitf2_image_subheader.cxx.

◆ get_field_definitions_20()

const vil_nitf2_field_definitions * vil_nitf2_image_subheader::get_field_definitions_20 ( )
staticprotected

Definition at line 82 of file vil_nitf2_image_subheader.cxx.

◆ get_field_definitions_21()

const vil_nitf2_field_definitions * vil_nitf2_image_subheader::get_field_definitions_21 ( )
staticprotected

Definition at line 69 of file vil_nitf2_image_subheader.cxx.

◆ get_image_source()

std::string vil_nitf2_image_subheader::get_image_source ( ) const

Definition at line 542 of file vil_nitf2_image_subheader.cxx.

◆ get_image_type()

std::string vil_nitf2_image_subheader::get_image_type ( ) const

Definition at line 551 of file vil_nitf2_image_subheader.cxx.

◆ get_lut_info()

bool vil_nitf2_image_subheader::get_lut_info ( unsigned int  band,
int &  n_luts,
int &  ne_lut,
std::vector< std::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_lutsnumber of luts for this image band (NITF spec says it's in the range [1-4] (if luts present)
ne_lutnumber of elements in each lut
lut_dthe 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 560 of file vil_nitf2_image_subheader.cxx.

◆ get_num_blocks_x()

unsigned int vil_nitf2_image_subheader::get_num_blocks_x ( ) const

Definition at line 515 of file vil_nitf2_image_subheader.cxx.

◆ get_num_blocks_y()

unsigned int vil_nitf2_image_subheader::get_num_blocks_y ( ) const

Definition at line 524 of file vil_nitf2_image_subheader.cxx.

◆ get_number_of_bits_per_pixel()

unsigned int vil_nitf2_image_subheader::get_number_of_bits_per_pixel ( ) const

Definition at line 533 of file vil_nitf2_image_subheader.cxx.

◆ get_pixels_per_block_x()

unsigned int vil_nitf2_image_subheader::get_pixels_per_block_x ( ) const

Definition at line 467 of file vil_nitf2_image_subheader.cxx.

◆ get_pixels_per_block_y()

unsigned int vil_nitf2_image_subheader::get_pixels_per_block_y ( ) const

Definition at line 491 of file vil_nitf2_image_subheader.cxx.

◆ get_property() [1/2]

template<class T >
bool vil_nitf2_image_subheader::get_property ( std::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 44 of file vil_nitf2_image_subheader.h.

◆ get_property() [2/2]

template<class T >
bool vil_nitf2_image_subheader::get_property ( std::string  tag,
int  i,
T &  out_value 
) const
inline

Sets out_value to the value of std::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 52 of file vil_nitf2_image_subheader.h.

◆ get_rpc_params()

bool vil_nitf2_image_subheader::get_rpc_params ( std::string &  rpc_type,
std::string &  image_id,
std::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 986 of file vil_nitf2_image_subheader.cxx.

◆ get_sun_params()

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

◆ get_tree()

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

Definition at line 587 of file vil_nitf2_image_subheader.cxx.

◆ has_data_mask_table()

bool vil_nitf2_image_subheader::has_data_mask_table ( ) const
inline

Definition at line 65 of file vil_nitf2_image_subheader.h.

◆ nplanes()

unsigned vil_nitf2_image_subheader::nplanes ( ) const

Definition at line 450 of file vil_nitf2_image_subheader.cxx.

◆ read()

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

Friends And Related Function Documentation

◆ vil_nitf2::cleanup_static_members

Member Data Documentation

◆ m_data_mask_table

vil_nitf2_data_mask_table* vil_nitf2_image_subheader::m_data_mask_table
protected

Definition at line 131 of file vil_nitf2_image_subheader.h.

◆ m_field_sequence

vil_nitf2_field_sequence vil_nitf2_image_subheader::m_field_sequence
protected

Definition at line 130 of file vil_nitf2_image_subheader.h.

◆ m_version

vil_nitf2_classification::file_version vil_nitf2_image_subheader::m_version
protected

Definition at line 133 of file vil_nitf2_image_subheader.h.

◆ s_field_definitions_20

vil_nitf2_field_definitions * vil_nitf2_image_subheader::s_field_definitions_20 = nullptr
staticprivate

Definition at line 151 of file vil_nitf2_image_subheader.h.

◆ s_field_definitions_21

vil_nitf2_field_definitions * vil_nitf2_image_subheader::s_field_definitions_21 = nullptr
staticprivate

Definition at line 150 of file vil_nitf2_image_subheader.h.


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