25 std::vector<bool> segments_done;
26 int seg_height = 0, seg_width = 0;
29 void init(
int bit_depth,
int max_seg,
int segment_width,
int segment_height)
32 segments_done.resize(seg_count,
false);
34 image =
image::Image(bit_depth, segment_width, segment_height * max_seg, 1);
35 seg_height = segment_height;
36 seg_width = segment_width;
41 HimawariSegmentedImageDecoder(
XRITFile &file)
45 init(image_structure_record.bit_per_pixel > 8 ? 16 : 8,
47 image_structure_record.columns_count,
48 image_structure_record.lines_count);
53 if (segc >= seg_count || segc < 0)
55 if (data.
size() != seg_height * seg_width)
57 logger->error(
"Image of the wrong size! (%s) %dx%d Got %dx%d", info.channel.c_str(), seg_width, seg_height, data.
width(), data.
height());
60 image::imemcpy(image, (seg_height * seg_width) * segc, data, 0, seg_height * seg_width);
61 segments_done[segc] =
true;
68 std::vector<std::string> header_parts = splitString(file.filename,
'_');
70 int segment = std::stoi(file.filename.substr(file.filename.size() - 3, file.filename.size())) - 1;
72 pushSegment(img, segment);
78 for (
int i = 0; i < seg_count; i++)
79 complete = complete && segments_done[i];
85 for (
int i = 0; i < seg_count; i++)
86 segments_done[i] =
false;
92 for (
int i = 0; i < seg_count; i++)
image::Image getImageFromXRITFile(xrit_file_type_t type, XRITFile &file)
This converts a xRIT file (given its type) into an image object handling missing-specific details and...
Definition get_img.h:28