22 ImageCalibrator(
ImageProduct *p, nlohmann::json c) : d_pro(p), d_cfg(c) {}
24 inline double compute(
int idx,
int x,
int y)
26 auto &i = d_pro->images[idx];
27 if (0 <= x && x < i.image.width() && 0 <= y && y < i.image.height())
29 val = d_pro->get_raw_channel_val(idx, x, y);
30 return compute(i.abs_index, x, y, val);
33 return CALIBRATION_INVALID_VALUE;
37 virtual double compute(
int abs_idx,
int x,
int y, uint32_t val) = 0;
49 image::Image generate_calibrated_product_channel(
ImageProduct *product, std::string channel_name,
double range_min,
double range_max, std::string output_unit =
"",
float *progess =
nullptr);