Set some initial calibration matrices if no DCP file is found, used for AWB
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "pipeline.h"
|
#include "pipeline.h"
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
|
#include "matrix.h"
|
||||||
#include "zbar_pipeline.h"
|
#include "zbar_pipeline.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
@@ -1317,22 +1318,27 @@ update_state(MPPipeline *pipeline, const mp_state_proc *new_state)
|
|||||||
|
|
||||||
state_proc.flash_enabled = new_state->flash_enabled;
|
state_proc.flash_enabled = new_state->flash_enabled;
|
||||||
|
|
||||||
if (output_changed) {
|
|
||||||
state_proc.camera_rotation = mod(
|
|
||||||
state_proc.mode->rotation - state_proc.device_rotation, 360);
|
|
||||||
|
|
||||||
on_output_changed(format_changed);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (camera_changed) {
|
if (camera_changed) {
|
||||||
char cf[PATH_MAX];
|
char cf[PATH_MAX];
|
||||||
if (find_calibration(cf, state_proc.camera->name)) {
|
if (find_calibration(cf, state_proc.camera->name)) {
|
||||||
state_proc.calibration = parse_calibration_file(cf);
|
state_proc.calibration = parse_calibration_file(cf);
|
||||||
} else {
|
} else {
|
||||||
printf("No calibration for %s\n", state_proc.camera->name);
|
fprintf(stderr, "No calibration for %s\n", state_proc.camera->name);
|
||||||
|
memcpy(state_proc.calibration.forward_matrix_1, sRGB_to_XYZD65, 9 * sizeof(float));
|
||||||
|
// The below is the same as calling libmegapixels' libmegapixels_aaa_init, but as we call
|
||||||
|
// libmegapixels_aaa_set_matrix, we need it to be in the calibration
|
||||||
|
memcpy(state_proc.calibration.color_matrix_1, IDENTITY, 9 * sizeof(float));
|
||||||
|
memcpy(state_proc.calibration.color_matrix_2, IDENTITY, 9 * sizeof(float));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (output_changed) {
|
||||||
|
state_proc.camera_rotation = mod(
|
||||||
|
state_proc.mode->rotation - state_proc.device_rotation, 360);
|
||||||
|
|
||||||
|
on_output_changed(format_changed);
|
||||||
|
}
|
||||||
|
|
||||||
mp_state_main new_main = {
|
mp_state_main new_main = {
|
||||||
.camera = pr_camera,
|
.camera = pr_camera,
|
||||||
.has_auto_focus_continuous = false,
|
.has_auto_focus_continuous = false,
|
||||||
|
Reference in New Issue
Block a user