Add color correction to the gles shader

This commit is contained in:
Martijn Braam
2023-07-26 23:40:51 +02:00
parent 10103a2834
commit d13cdd5dcb
7 changed files with 143 additions and 86 deletions

View File

@@ -4,7 +4,23 @@
#include <assert.h>
#include <stdio.h>
typedef struct _GLES2Debayer GLES2Debayer;
typedef struct {
int format;
float forward_matrix[9];
GLuint frame_buffer;
GLuint program;
GLint uniform_transform;
GLint uniform_pixel_size;
GLint uniform_padding_ratio;
GLint uniform_texture;
GLint uniform_color_matrix;
GLint uniform_row_length;
GLint uniform_inv_gamma;
GLint uniform_blacklevel;
GLuint quad;
} GLES2Debayer;
GLES2Debayer *gles2_debayer_new(int format);
@@ -13,12 +29,17 @@ void gles2_debayer_free(GLES2Debayer *self);
void gles2_debayer_use(GLES2Debayer *self);
void gles2_debayer_configure(GLES2Debayer *self,
const uint32_t dst_width,
const uint32_t dst_height,
const uint32_t src_width,
const uint32_t src_height,
const uint32_t rotation,
const bool mirrored,
uint32_t dst_width,
uint32_t dst_height,
uint32_t src_width,
uint32_t src_height,
uint32_t rotation,
bool mirrored,
struct MPCameraCalibration calibration);
void gles2_debayer_set_shading(GLES2Debayer *self,
float red,
float blue,
float blacklevel);
void gles2_debayer_process(GLES2Debayer *self, GLuint dst_id, GLuint source_id);