Add DCP calibration files for sensors

Read .dcp files stored in the same directory as the camera configuration
files and copy over the calibration curves into the DNG files after
taking a picture.
This commit is contained in:
Martijn Braam
2023-03-07 18:42:48 +01:00
parent 92f5270f87
commit b5161db18e
10 changed files with 397 additions and 3 deletions

30
src/dcp.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include <stdio.h>
struct MPCameraCalibration {
float color_matrix_1[9];
float color_matrix_2[9];
float forward_matrix_1[9];
float forward_matrix_2[9];
unsigned short illuminant_1;
unsigned short illuminant_2;
unsigned int hue_sat_map_dims[3];
size_t tone_curve_length;
float *tone_curve;
float *hue_sat_map_data_1;
float *hue_sat_map_data_2;
};
#define DCPTAG_COLOR_MATRIX_1 50721
#define DCPTAG_COLOR_MATRIX_2 50722
#define DCPTAG_PROFILE_HUE_SAT_MAP_DIMS 50937
#define DCPTAG_PROFILE_HUE_SAT_MAP_DATA_1 50938
#define DCPTAG_PROFILE_HUE_SAT_MAP_DATA_2 50939
#define DCPTAG_PROFILE_TONE_CURVE 50940
#define DCPTAG_CALIBRATION_ILLUMINANT_1 50778
#define DCPTAG_CALIBRATION_ILLUMINANT_2 50779
#define DCPTAG_FORWARD_MATRIX_1 50964
#define DCPTAG_FORWARD_MATRIX_2 50965
struct MPCameraCalibration parse_calibration_file(const char *path);