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_table * | data_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_tree * | get_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_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_table * | m_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 = nullptr |
| static vil_nitf2_field_definitions * | s_field_definitions_20 = nullptr |
Friends | |
| void | vil_nitf2::cleanup_static_members () |
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.
| 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.
|
virtual |
Definition at line 40 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 214 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
intelligent data.
full image coordinate system.
Definition at line 747 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 859 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 599 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 339 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 261 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 96 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 823 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 792 of file vil_nitf2_image_subheader.cxx.
|
staticprivate |
Definition at line 682 of file vil_nitf2_image_subheader.cxx.
|
inline |
Definition at line 66 of file vil_nitf2_image_subheader.h.
| 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.
| 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.
|
staticprotected |
Definition at line 82 of file vil_nitf2_image_subheader.cxx.
|
staticprotected |
Definition at line 69 of file vil_nitf2_image_subheader.cxx.
| std::string vil_nitf2_image_subheader::get_image_source | ( | ) | const |
Definition at line 542 of file vil_nitf2_image_subheader.cxx.
| std::string vil_nitf2_image_subheader::get_image_type | ( | ) | const |
Definition at line 551 of file vil_nitf2_image_subheader.cxx.
| 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.
| 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 560 of file vil_nitf2_image_subheader.cxx.
| unsigned int vil_nitf2_image_subheader::get_num_blocks_x | ( | ) | const |
Definition at line 515 of file vil_nitf2_image_subheader.cxx.
| unsigned int vil_nitf2_image_subheader::get_num_blocks_y | ( | ) | const |
Definition at line 524 of file vil_nitf2_image_subheader.cxx.
| unsigned int vil_nitf2_image_subheader::get_number_of_bits_per_pixel | ( | ) | const |
Definition at line 533 of file vil_nitf2_image_subheader.cxx.
| unsigned int vil_nitf2_image_subheader::get_pixels_per_block_x | ( | ) | const |
Definition at line 467 of file vil_nitf2_image_subheader.cxx.
| unsigned int vil_nitf2_image_subheader::get_pixels_per_block_y | ( | ) | const |
Definition at line 491 of file vil_nitf2_image_subheader.cxx.
|
inline |
Sets out_value to the value of field specified by tag.
Definition at line 44 of file vil_nitf2_image_subheader.h.
|
inline |
Sets out_value to the value of std::vector field element specified by tag and index.
Definition at line 52 of file vil_nitf2_image_subheader.h.
| 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.
| 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.
|
virtual |
Definition at line 587 of file vil_nitf2_image_subheader.cxx.
|
inline |
Definition at line 65 of file vil_nitf2_image_subheader.h.
| unsigned vil_nitf2_image_subheader::nplanes | ( | ) | const |
Definition at line 450 of file vil_nitf2_image_subheader.cxx.
|
virtual |
Read the image header starting at stream's current position.
Definition at line 49 of file vil_nitf2_image_subheader.cxx.
|
friend |
|
protected |
Definition at line 131 of file vil_nitf2_image_subheader.h.
|
protected |
Definition at line 130 of file vil_nitf2_image_subheader.h.
|
protected |
Definition at line 133 of file vil_nitf2_image_subheader.h.
|
staticprivate |
Definition at line 151 of file vil_nitf2_image_subheader.h.
|
staticprivate |
Definition at line 150 of file vil_nitf2_image_subheader.h.
1.8.15