Add a switch between SRGB and linear colors in the debayer shader

This commit is contained in:
Martijn Braam
2023-07-22 16:29:23 +02:00
parent c62ac5950f
commit 128a3696c4
6 changed files with 20 additions and 13 deletions

View File

@@ -81,6 +81,7 @@ update_process_pipeline()
.preview_width = state_io.preview_width,
.preview_height = state_io.preview_height,
.device_rotation = state_io.device_rotation,
.colorspace = state_io.colorspace,
.gain.control = state_io.gain.control,
.gain.auto_control = state_io.gain.auto_control,
@@ -144,6 +145,7 @@ capture(MPPipeline *pipeline, const void *data)
mp_camera_stop_capture(mpcamera);
struct v4l2_format format = { 0 };
libmegapixels_select_mode(state_io.camera, state_io.mode_capture, &format);
state_io.colorspace = format.fmt.pix.colorspace;
state_io.flush_pipeline = true;
mp_camera_start_capture(mpcamera);
@@ -326,6 +328,7 @@ on_frame(MPBuffer buffer, void *_data)
struct v4l2_format format = { 0 };
libmegapixels_select_mode(
state_io.camera, state_io.mode_preview, &format);
state_io.colorspace = format.fmt.pix.colorspace;
state_io.flush_pipeline = true;
mp_camera_start_capture(mpcamera);
@@ -498,6 +501,7 @@ update_state(MPPipeline *pipeline, const mp_state_io *new_state)
libmegapixels_select_mode(state_io.camera,
state_io.mode_preview,
&format);
state_io.colorspace = format.fmt.pix.colorspace;
}
mp_camera_start_capture(mpcamera);