19 # include <vcl_msvc_warnings.h> 27 *get_field_definitions_20() :
28 *get_field_definitions_21()),
29 m_data_mask_table(nullptr),
56 std::string compression_code;
58 if (compression_code.find_first_of(
'M') != std::string::npos) {
99 .field(
"NICOM",
"Number of Image Comments",
NITF_INT(1),
false,
nullptr,
nullptr)
104 .field(
"ICOMn",
"Image Comment n",
NITF_STR_ECSA(80),
false,
nullptr,
nullptr))
106 .field(
"IC",
"Image Compression",
108 .value(
"NC",
"Not compressed")
109 .value(
"NM",
"Uncompressed - contains block mask and/or pad pixel mask")
110 .value(
"C1",
"Bi-level")
112 .value(
"C4",
"Vector Quantization")
113 .value(
"C5",
"Lossless JPEG")
114 .value(
"C6",
"Reserved - future correlated multicomponent compression")
115 .value(
"C7",
"Reserved - future SAR compression")
116 .value(
"C8",
"JPEG2000")
117 .value(
"I1",
"Downsampled JPEG")
118 .value(
"M1",
"Compressed - contains block mask and/or pad pixel mask")
119 .value(
"M3",
"Compressed - contains block mask and/or pad pixel mask")
120 .value(
"M4",
"Compressed - contains block mask and/or pad pixel mask")
121 .value(
"M5",
"Compressed - contains block mask and/or pad pixel mask")
122 .value(
"M6",
"Reserved - future correlated multicomponent compression")
123 .value(
"M7",
"Reserved - future SAR compression")
124 .value(
"M8",
"JPEG2000 - contains block mask and/or pad pixel mask")),
125 false,
nullptr,
nullptr);
127 std::vector<std::string> comp_ic_values;
128 comp_ic_values.emplace_back(
"C1");
129 comp_ic_values.emplace_back(
"C3");
130 comp_ic_values.emplace_back(
"C4");
131 comp_ic_values.emplace_back(
"C5");
132 comp_ic_values.emplace_back(
"C8");
133 comp_ic_values.emplace_back(
"M1");
134 comp_ic_values.emplace_back(
"M3");
135 comp_ic_values.emplace_back(
"M4");
136 comp_ic_values.emplace_back(
"M5");
137 comp_ic_values.emplace_back(
"M8");
138 comp_ic_values.emplace_back(
"I1");
142 .field(
"COMRAT",
"Compression Rate Code",
NITF_STR_BCSA(4),
true,
nullptr,
147 .field(
"NBANDS",
"Number of Bands",
NITF_INT(1),
false,
nullptr,
nullptr)
150 .field(
"XBANDS",
"Number of multispectral bands",
NITF_INT(5),
true,
nullptr,
157 .field(
"IREPBAND",
"nth Band Representation",
NITF_STR_BCSA(2),
true,
nullptr,
nullptr)
158 .field(
"ISUBCAT",
"nth Band Subcategory",
NITF_STR_BCSA(6),
true,
nullptr,
nullptr)
159 .field(
"IFC",
"nth Image Filter Condition",
NITF_STR_BCSA(1),
false,
nullptr,
nullptr)
160 .field(
"IMFLT",
"nth Band Standard Image Filter Code",
NITF_STR_BCSA(3),
true,
nullptr,
nullptr)
161 .field(
"NLUTS",
"Number of LUTS for the nth Image Band",
NITF_INT(1,
false),
false,
nullptr,
nullptr)
162 .field(
"NELUT",
"Number of LUT Entries for the nth Image Band",
NITF_INT(5,
false),
false,
nullptr,
167 .field(
"LUTDnm",
"nth Image Band, mth LUT",
NITF_BIN(1),
false,
171 .field(
"ISYNC",
"Image Sync Code",
NITF_INT(1),
false,
nullptr,
nullptr)
172 .field(
"IMODE",
"Image Mode",
174 .value(
"B",
"Band interleaved by block")
175 .value(
"P",
"Band interleaved by pixel")
176 .value(
"R",
"Band interleaved by row")
177 .value(
"S",
"Band sequential")),
178 false,
nullptr,
nullptr)
180 .field(
"NBPR",
"Number of Blocks per Row",
NITF_INT(4),
false,
nullptr,
nullptr)
181 .field(
"NBPC",
"Number of Blocks per Column",
NITF_INT(4),
false,
nullptr,
nullptr)
182 .field(
"NPPBH",
"Number of Pixels per Block Horizontal",
NITF_INT(4),
false,
nullptr,
nullptr)
183 .field(
"NPPBV",
"Number of Pixels per Block Vertical",
NITF_INT(4),
false,
nullptr,
nullptr)
184 .field(
"NBPP",
"Number of Bits per Pixel per Band",
NITF_INT(2),
false,
nullptr,
nullptr)
185 .field(
"IDLVL",
"Image Display Level",
NITF_INT(3),
false,
nullptr,
nullptr)
186 .field(
"IALVL",
"Attachment Level",
NITF_INT(3),
false,
nullptr,
nullptr)
191 .field(
"ILOC_ROW",
"Image Location Row",
NITF_STR_BCSA(5),
false,
nullptr,
nullptr)
192 .field(
"ILOC_COL",
"Image Location Column",
NITF_STR_BCSA(5),
false,
nullptr,
nullptr)
196 .field(
"IMAG",
"Image Magnification",
NITF_STR_BCSA(4),
false,
nullptr,
nullptr)
197 .field(
"UDIDL",
"User Defined Image Data Length",
NITF_INT(5),
false,
nullptr,
nullptr)
199 .field(
"UDOFL",
"User Defined Overflow",
NITF_INT(3),
false,
nullptr,
202 .field(
"UDID",
"User Defined Image Data",
NITF_TRES(),
false,
205 .field(
"IXSHDL",
"Image Extended Subheader Data Length",
NITF_INT(5),
false,
nullptr,
nullptr)
207 .field(
"IXSOFL",
"Image Extended Subheader Overflow",
NITF_INT(3),
false,
nullptr,
210 .field(
"IXSHD",
"Image Extended Subheader Data",
NITF_TRES(),
false,
222 .field(
"ICORDS",
"Image Coordinate Representation",
225 .value(
"G",
"Geodetic/Geographic")
227 .value(
"C",
"Geocentric")),
228 false,
nullptr,
nullptr);
230 std::vector<std::string> igeolo_icords;
231 igeolo_icords.emplace_back(
"U");
232 igeolo_icords.emplace_back(
"G");
233 igeolo_icords.emplace_back(
"C");
236 .field(
"IGEOLO",
"Image Geographic Location",
NITF_STR_BCSA(60),
false,
nullptr,
243 .field(
"ICORDS",
"Image Coordinate Representation",
245 .value(
"U",
"UTM expressed in MGRS form")
246 .value(
"G",
"Geographic")
247 .value(
"N",
"UTM/UPS (Northern hemisphere)")
248 .value(
"S",
"UTM/UPS (Southern hemisphere)")
249 .value(
"D",
"Decimal degrees")),
250 true,
nullptr,
nullptr)
252 .field(
"IGEOLO",
"Image Geographic Location",
NITF_STR_BCSA(60),
false,
nullptr,
257 assert(!
"unsupported case");
264 .field(
"ENCRYP",
"Encryption",
267 .value(
"0",
"Not Encrypted")),
268 false,
nullptr,
nullptr)
269 .field(
"ISORCE",
"Image Source",
NITF_STR_ECSA(42),
true,
nullptr,
nullptr)
271 .field(
"NROWS",
"Number of Significant Rows in Image",
NITF_INT(8,
false),
false,
nullptr,
nullptr)
273 .field(
"NCOLS",
"Number of Significant Columns in Image",
NITF_INT(8,
false),
false,
nullptr,
nullptr)
274 .field(
"PVTYPE",
"Pixel Value Type",
276 .value(
"INT",
"Integer")
277 .value(
"B",
"Bi-level")
278 .value(
"SI",
"2's complement signed integer")
280 .value(
"C",
"Complex")),
281 false,
nullptr,
nullptr)
282 .field(
"IREP",
"Image Representation",
284 .value(
"MONO",
"Monochrome")
285 .value(
"RGB",
"Red, green, blue true color")
286 .value(
"RGB/LUT",
"Red, green, blue mapped Color")
287 .value(
"MULTI",
"Multiband imagery")
288 .value(
"NODISPLY",
"Not intended for display")
289 .value(
"NVECTOR",
"Cartesian coordinates")
290 .value(
"POLAR",
"Polar coordinates")
291 .value(
"VPH",
"SAR video phase history")
292 .value(
"YCbCr601",
"BT.601-5 color space")),
293 false,
nullptr,
nullptr)
295 .field(
"ICAT",
"Image Category",
297 .value(
"VIS",
"Visible imagery")
298 .value(
"SL",
"Side-looking radar")
299 .value(
"TI",
"Thermal infrared")
300 .value(
"FL",
"Forward-looking radar")
301 .value(
"RD",
"Radar")
302 .value(
"EO",
"Electro-optical")
303 .value(
"OP",
"Optical")
304 .value(
"HR",
"High-resolution radar")
305 .value(
"HS",
"Hyperspectral")
306 .value(
"CP",
"Color frame photography")
307 .value(
"BP",
"Black/white frame photography")
308 .value(
"SARIQ",
"SAR radio hologram")
309 .value(
"SAR",
"Synthetic aperture radar")
310 .value(
"IR",
"Infrared")
311 .value(
"MS",
"Multispectral")
312 .value(
"FP",
"Fingerprints")
313 .value(
"MRI",
"Magnetic resonance imagery")
314 .value(
"XRAY",
"X-ray")
315 .value(
"CAT",
"CAT scan")
316 .value(
"VD",
"Video")
317 .value(
"BARO",
"Barometric pressure")
318 .value(
"CURRENT",
"Water current")
319 .value(
"DEPTH",
"Water depth")
320 .value(
"MAP",
"Raster map")
321 .value(
"PAT",
"Color patch")
322 .value(
"LEG",
"Legends")
323 .value(
"DTEM",
"Elevation models")
324 .value(
"MATR",
"Matrix data (other types)")
325 .value(
"LOCG",
"Location Grids")),
328 .field(
"ICAT",
"Image Category",
NITF_STR_ECSA(8),
false,
nullptr,
nullptr)
329 #endif //UNCLASS_ONLY 331 .field(
"ABPP",
"Actual Bits Per Pixel per Band",
NITF_INT(2),
false,
nullptr,
nullptr)
332 .field(
"PJUST",
"Pixel Justification",
334 .value(
"L",
"Left-justified")
335 .value(
"R",
"Right-justified")),
336 false,
nullptr,
nullptr);
342 .field(
"IM",
"File Part Type",
344 .value(
"IM",
"Image Header")))
350 .field(
"TGTID",
"Target Identifier",
NITF_STR_BCSA(17),
true)
351 .field(
"IID2",
"Image Identifier 2",
NITF_STR_ECSA(80),
true);
354 #if 0 // get_date_time() commented out 356 get_date_time(
int& year,
int& month,
int& day,
int& hour,
int& min)
358 std::cout <<
"In vil_nitf2_image_subheader::get_date_time!\n";
359 std::string date_time =
"";
362 std::cout <<
"IDATIM Property failed in vil_nitf2_image_subheader\n";
365 std::cout <<
"In vil_nitf2_image_subheader::get_date_time!\n";
368 std::string s_day, s_hour, s_min, s_month, s_year_suff;
369 s_day = date_time.substr(0,2);
370 s_hour = date_time.substr(2,2);
371 s_min = date_time.substr(4,2);
372 s_month = date_time.substr(9,3);
373 s_year_suff = date_time.substr(12,2);
374 std::string months[]={
"JAN",
"FEB",
"MAR",
"APR",
"MAY",
"JUN",
"JUL",
"AUG",
375 "SEP",
"OCT",
"NOV",
"DEC"};
377 std::cout << date_time <<
'\n' 378 << s_day <<
' ' << s_hour <<
' ' << s_min
379 <<
' ' << s_month <<
' ' << s_year_suff << std::endl;
380 for (
int i = 0; (i<12)&&(!found); ++i)
381 if (s_month==months[i]){
387 day = std::atoi(s_day.c_str());
388 hour = std::atoi(s_hour.c_str());
389 min = std::atoi(s_min.c_str());
390 year = std::atoi(s_year_suff.c_str());
397 get_date_time(
int& year,
int& month,
int& day,
int& hour,
int& min,
int& sec)
399 std::string date_time =
"";
402 std::cout <<
"IDATIM Property failed in vil_nitf2_image_subheader\n";
407 std::string s_day, s_hour, s_min, s_month, s_year, s_sec;
409 std::string s_zulu = date_time.substr(8,1);
411 s_day = date_time.substr(0,2);
412 s_hour = date_time.substr(2,2);
413 s_min = date_time.substr(4,2);
414 s_sec = date_time.substr(6,2);
415 s_month = date_time.substr(9,3);
416 s_year = date_time.substr(12,2);
417 std::string months[]={
"JAN",
"FEB",
"MAR",
"APR",
418 "MAY",
"JUN",
"JUL",
"AUG",
419 "SEP",
"OCT",
"NOV",
"DEC"};
421 for (
int i = 0; (i<12)&&(!found); ++i) {
422 if (s_month==months[i]){
432 s_year = date_time.substr(0,4);
433 s_month = date_time.substr(4,2);
434 s_day = date_time.substr(6,2);
435 s_hour = date_time.substr(8,2);
436 s_min = date_time.substr(10,2);
437 s_sec = date_time.substr(12,2);
438 month = std::atoi(s_month.c_str());
440 day = std::atoi(s_day.c_str());
441 hour = std::atoi(s_hour.c_str());
442 min = std::atoi(s_min.c_str());
443 sec = std::atoi(s_sec.c_str());
444 year = std::atoi(s_year.c_str());
469 int pixels_per_block;
474 if (pixels_per_block == 0) {
476 int blocks_per_row = 0;
478 if (blocks_per_row != 1)
return 0;
481 return pixels_per_block;
486 return pixels_per_block;
493 int pixels_per_block;
498 if (pixels_per_block == 0) {
500 int blocks_per_col = 0;
502 if (blocks_per_col != 1)
return 0;
505 return pixels_per_block;
510 return pixels_per_block;
519 return blocks_per_row;
528 return blocks_per_col;
537 return bits_per_pixel;
561 int& n_luts,
int& ne_lut,
562 std::vector< std::vector< unsigned char > >& lut_d)
const 569 lut_d.resize(n_luts);
571 for (
int lut_index = 0 ; lut_index < n_luts ; lut_index++) {
572 lut_d[lut_index].resize(ne_lut);
576 for (
int el_index = 0 ; el_index < ne_lut ; el_index++ ) {
577 lut_d[lut_index][el_index] = static_cast<unsigned char*>(raw_lut_data)[el_index];
590 std::stringstream name_stream;
591 name_stream <<
"Image Subheader";
592 if ( i > 0 ) name_stream <<
" #" << i;
593 t->
columns.push_back( name_stream.str() );
613 .
field(
"LAT_OFF",
"Latitude Offset",
NITF_DBL(8, 4,
true),
false)
614 .
field(
"LON_OFF",
"Longitude offset",
NITF_DBL(9, 4,
true),
false)
618 .
field(
"LAT_SCALE",
"Latitude Scale",
NITF_DBL(8, 4,
true),
false)
619 .
field(
"LON_SCALE",
"Longitude Scale",
NITF_DBL(9, 4,
true),
false)
628 .field(
"LNC",
"Line Number Coefficient",
NITF_EXP(6,1))
631 .field(
"LDC",
"Line Density Coefficient",
NITF_EXP(6,1))
634 .field(
"SNC",
"Sample Number Coefficient",
NITF_EXP(6,1))
637 .field(
"SDC",
"Sample Density Coefficient",
NITF_EXP(6,1))
652 .
field(
"LAT_OFF",
"Latitude Offset",
NITF_DBL(8, 4,
true),
false)
653 .
field(
"LON_OFF",
"Longitude offset",
NITF_DBL(9, 4,
true),
false)
657 .
field(
"LAT_SCALE",
"Latitude Scale",
NITF_DBL(8, 4,
true),
false)
658 .
field(
"LON_SCALE",
"Longitude Scale",
NITF_DBL(9, 4,
true),
false)
667 .field(
"LNC",
"Line Number Coefficient",
NITF_EXP(6,1))
670 .field(
"LDC",
"Line Density Coefficient",
NITF_EXP(6,1))
673 .field(
"SNC",
"Sample Number Coefficient",
NITF_EXP(6,1))
676 .field(
"SDC",
"Sample Density Coefficient",
NITF_EXP(6,1))
690 .
field(
"MEAN_GSD",
"Mean Ground Sample Distance",
NITF_DBL(5, 1,
false),
false)
692 .
field(
"DYNAMIC_RANGE",
"Dynamic Range",
NITF_LONG(5,
false),
true)
694 .
field(
"OBL_ANG",
"Obliquity Angle",
NITF_DBL(5,2,
false),
true)
697 .
field(
"N_REF",
"Number of Reference Lines.",
NITF_INT(2,
false),
false)
698 .
field(
"REV_NUM",
"Revolution Number",
NITF_LONG(5,
false),
false)
699 .
field(
"N_SEG",
"Number of Segments",
NITF_INT(3,
false),
false)
700 .
field(
"MAX_LP_SEG",
"Maximum Lines Per Segment",
NITF_LONG(6,
false),
true)
716 vil_nitf2_tagged_record_sequence::iterator tres_itr;
722 for (tres_itr = isxhd_tres.begin(); tres_itr != isxhd_tres.end(); ++tres_itr)
724 std::string type = (*tres_itr)->name();
725 if ( type ==
"USE00A")
727 success = (*tres_itr)->get_value(
"SUN_EL", sun_el);
728 success = success && (*tres_itr)->get_value(
"SUN_AZ", sun_az);
730 std::cout<<
"\n Error reading USE00A\n";
734 else if ( type ==
"MPD26A")
736 success = (*tres_itr)->get_value(
"SUN_EL", sun_el);
737 success = success && (*tres_itr)->get_value(
"SUN_AZ", sun_az);
739 std::cout<<
"\n Error reading MPD26A\n";
754 .
field(
"XFRM_FLAG",
"Non-linear Transformation Flag",
NITF_INT(2),
false)
755 .
field(
"SCALE_FACTOR",
"Scale Factor Relative to R0",
NITF_DBL(10, 5,
false),
false)
756 .
field(
"ANAMRPH_CORR",
"Anamorphic Correction Indicator",
NITF_INT(2),
false)
757 .
field(
"SCANBLK_NUM",
"Scan Block Number",
NITF_INT(2,
false),
true)
759 .
field(
"OP_ROW_11",
"Output product row number component of grid point index (1,1)",
NITF_DBL(12,3,
false),
false)
760 .
field(
"OP_COL_11",
"Output product column number component of grid point index (1,1)",
NITF_DBL(12,3,
false),
false)
762 .
field(
"OP_ROW_12",
"Output product row number component of grid point index (1,2)",
NITF_DBL(12,3,
false),
false)
763 .
field(
"OP_COL_12",
"Output product column number component of grid point index (1,2)",
NITF_DBL(12,3,
false),
false)
765 .
field(
"OP_ROW_21",
"Output product row number component of grid point index (2,1)",
NITF_DBL(12,3,
false),
false)
766 .
field(
"OP_COL_21",
"Output product column number component of grid point index (2,1)",
NITF_DBL(12,3,
false),
false)
768 .
field(
"OP_ROW_22",
"Output product row number component of grid point index (2,2)",
NITF_DBL(12,3,
false),
false)
769 .
field(
"OP_COL_22",
"Output product column number component of grid point index (2,2)",
NITF_DBL(12,3,
false),
false)
772 .
field(
"FI_ROW_11",
"Output product row number component of grid point index (1,1)",
NITF_DBL(12,3,
false),
false)
773 .
field(
"FI_COL_11",
"Output product column number component of grid point index (1,1)",
NITF_DBL(12,3,
false),
false)
775 .
field(
"FI_ROW_12",
"Output product row number component of grid point index (1,2)",
NITF_DBL(12,3,
false),
false)
776 .
field(
"FI_COL_12",
"Output product column number component of grid point index (1,2)",
NITF_DBL(12,3,
false),
false)
778 .
field(
"FI_ROW_21",
"Output product row number component of grid point index (2,1)",
NITF_DBL(12,3,
false),
false)
779 .
field(
"FI_COL_21",
"Output product column number component of grid point index (2,1)",
NITF_DBL(12,3,
false),
false)
781 .
field(
"FI_ROW_22",
"Output product row number component of grid point index (2,2)",
NITF_DBL(12,3,
false),
false)
782 .
field(
"FI_COL_22",
"Output product column number component of grid point index (2,2)",
NITF_DBL(12,3,
false),
false)
784 .
field(
"FI_ROW",
"Full Image Number of Rows",
NITF_LONG(8,
false),
false)
785 .
field(
"FI_COL",
"Full Image Number of COlumns",
NITF_LONG(8,
false),
false)
875 .
field(
"SUN_EL",
"Sun Elevation angle",
NITF_DBL(5,1,
true),
false)
876 .
field(
"SUN_AZ",
"Sun Azimuthal angle",
NITF_DBL(5,1,
false),
false)
923 vil_nitf2_tagged_record_sequence::iterator tres_itr;
929 for (tres_itr = isxhd_tres.begin(); tres_itr != isxhd_tres.end(); ++tres_itr)
931 std::string type = (*tres_itr)->name();
932 if ( type ==
"ICHIPB" )
936 if ( (*tres_itr)->get_value(
"FI_ROW_11", r_off) &&
937 (*tres_itr)->get_value(
"FI_COL_11", c_off) )
945 else if ( type ==
"STDIDC" )
949 if ( (*tres_itr)->get_value(
"START_ROW", r_off) &&
950 (*tres_itr)->get_value(
"START_COLUMN", c_off) )
958 else if ( type ==
"STDIDB" )
962 std::string temp_off;
963 if ( (*tres_itr)->get_value(
"START_ROW", r_off) &&
964 (*tres_itr)->get_value(
"START_COLUMN", temp_off) )
966 if ((
int)temp_off[0]>=65)
967 c_off=((
int)temp_off[0]-55)*10;
969 c_off=((int)temp_off[0]-48)*10;
970 c_off+=(int)temp_off[1]-48;
987 std::string& image_corner_geo_locations,
991 std::string iid2 =
"";
994 std::cout <<
"IID2 Property failed in vil_nitf2_image_subheader\n";
997 image_id = iid2.substr(0,39);
998 std::string igeolo =
"";
1001 std::cout <<
"IGEOLO Property failed in vil_nitf2_image_subheader\n";
1004 image_corner_geo_locations = igeolo;
1008 vil_nitf2_tagged_record_sequence::iterator tres_itr;
1013 for (tres_itr = isxhd_tres.begin(); tres_itr != isxhd_tres.end(); ++tres_itr)
1015 std::string type = (*tres_itr)->name();
1017 if ( type ==
"RPC00B" || type ==
"RPC00A")
1024 success = (*tres_itr)->get_value(
"LINE_OFF", line_off);
1026 std::cout <<
"LINE_OFF Property failed in vil_nitf2_image_subheader\n";
1029 rpc_data[80] = line_off;
1032 success = (*tres_itr)->get_value(
"SAMP_OFF", samp_off);
1034 std::cout <<
"SAMP_OFF Property failed in vil_nitf2_image_subheader\n";
1037 rpc_data[81] = samp_off;
1040 success = (*tres_itr)->get_value(
"LAT_OFF", lat_off);
1042 std::cout <<
"LAT_OFF Property failed in vil_nitf2_image_subheader\n";
1045 rpc_data[82] = lat_off;
1048 success = (*tres_itr)->get_value(
"LON_OFF", lon_off);
1050 std::cout <<
"LON_OFF Property failed in vil_nitf2_image_subheader\n";
1053 rpc_data[83] = lon_off;
1056 success = (*tres_itr)->get_value(
"HEIGHT_OFF", height_off);
1058 std::cout <<
"HEIGHT_OFF Property failed in vil_nitf2_image_subheader\n";
1061 rpc_data[84] = height_off;
1064 success = (*tres_itr)->get_value(
"LINE_SCALE", line_scale);
1066 std::cout <<
"LINE_SCALE Property failed in vil_nitf2_image_subheader\n";
1069 rpc_data[85] = line_scale;
1072 success = (*tres_itr)->get_value(
"SAMP_SCALE", samp_scale);
1074 std::cout <<
"SAMP_SCALE Property failed in vil_nitf2_image_subheader\n";
1077 rpc_data[86] = samp_scale;
1080 success = (*tres_itr)->get_value(
"LAT_SCALE", lat_scale);
1082 std::cout <<
"LAT_SCALE Property failed in vil_nitf2_image_subheader\n";
1085 rpc_data[87] = lat_scale;
1088 success = (*tres_itr)->get_value(
"LON_SCALE", lon_scale);
1090 std::cout <<
"LON_SCALE Property failed in vil_nitf2_image_subheader\n";
1093 rpc_data[88] = lon_scale;
1096 success = (*tres_itr)->get_value(
"HEIGHT_SCALE", height_scale);
1098 std::cout <<
"HEIGHT_SCALE Property failed in vil_nitf2_image_subheader\n";
1101 rpc_data[89] = height_scale;
1104 std::vector<double> LNC;
1105 success = (*tres_itr)->get_values(
"LNC", LNC);
1107 std::cout <<
"LNC Property failed in vil_nitf2_image_subheader\n";
1110 for (
int i = 0; i < 20; i++) {
1111 rpc_data[i] = LNC[i];
1114 std::vector<double> LDC;
1115 success = (*tres_itr)->get_values(
"LDC", LDC);
1117 std::cout <<
"LDC Property failed in vil_nitf2_image_subheader\n";
1120 for (
int i = 0; i < 20; i++) {
1121 rpc_data[i+20] = LDC[i];
1124 std::vector<double> SNC;
1125 success = (*tres_itr)->get_values(
"SNC", SNC);
1127 std::cout <<
"SNC Property failed in vil_nitf2_image_subheader\n";
1130 for (
int i = 0; i < 20; i++) {
1131 rpc_data[i+40] = SNC[i];
1134 std::vector<double> SDC;
1135 success = (*tres_itr)->get_values(
"SDC", SDC);
1137 std::cout <<
"SDC Property failed in vil_nitf2_image_subheader\n";
1140 for (
int i = 0; i < 20; i++) {
1141 rpc_data[i+60] = SDC[i];
Functor vil_nitf2_field_value_one_of defines a predicate that sets its out parameter to true iff the ...
Functor vil_nitf2_max_field_value_plus_offset_and_threshold defines a function that sets its out para...
Functor vil_nitf2_field_value defines a function that sets its out parameter to a value of a field fr...
bool read(vil_nitf2_istream &input, const vil_nitf2_field_definitions *field_defs=nullptr, const vil_nitf2_index_vector &indexes=vil_nitf2_index_vector())
This class is responsible for parsing a NITF 2.1 data mask table.
std::vector< std::string > columns
#define NITF_STR_BCSA(LEN)
void end()
Declares that definition is finished, preventing further invocations of field() or repeat().
vil_nitf2_tagged_record_definition & field(std::string field_name, std::string pretty_name, vil_nitf2_field_formatter *formatter, bool blanks_ok=false, vil_nitf2_field_functor< int > *width_functor=nullptr, vil_nitf2_field_functor< bool > *condition_functor=nullptr, std::string units="", std::string description="")
Define a field. Assumes ownership of pointer arguments.
static void add_field_defs(vil_nitf2_field_definitions *defs, const file_version &version, std::string prefix, const std::string &pretty_name_prefix)
static vil_nitf2_tagged_record_definition & define(std::string name, std::string pretty_name)
Factory method. Assumes ownership of optional pointer argument.
Stream interface for VIL image loaders.
vil_nitf2: Written by Harry Voorhees (hlv@) and Rob Radtke (rob@) of Stellar Science Ltd.
vil_nitf2_tagged_record_definition defines a particular tagged record extension (TRE).
static tagged_record_definition_map & all_definitions()
All tagged record definitions.
static bool undefine(const std::string &name)
Undefines a TRE. Returns whether TRE with specified name was found.
bool parse(vil_stream *stream)
Functor vil_nitf2_choose_field_value defines a function that sets its out parameter to a value of one...
static vil_nitf2_tagged_record_definition * find(const std::string &name)
Look up a record definition.
vnl_decnum min(vnl_decnum const &x, vnl_decnum const &y)
bool get_value(std::string tag, int &out_value) const
Functors used by NITF classes.
vil_nitf2_tagged_record_definition & repeat(vil_nitf2_field_functor< int > *repeat_functor, vil_nitf2_field_definitions &field_definitions)
Define a repeat node. Assumes ownership of pointer argument.
virtual vil_nitf2_field::field_tree * get_tree(vil_nitf2_field::field_tree *tr=nullptr) const
Functor vil_nitf2_field_value_greater_than defines a comparison predicate that sets its out parameter...
#define NITF_STR_ECSA(LEN)
Functor vil_nitf2_field_specified defines a comparison predicate that sets its out parameter to true ...