aboutsummaryrefslogtreecommitdiff
path: root/include/color_conversion.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/color_conversion.h')
-rw-r--r--include/color_conversion.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/include/color_conversion.h b/include/color_conversion.h
index 1fe488b..d05df6a 100644
--- a/include/color_conversion.h
+++ b/include/color_conversion.h
@@ -3,16 +3,29 @@
#include "shader.h"
#include "vec2.h"
+#include <stdbool.h>
typedef enum {
- GSR_SOURCE_COLOR_RGB
+ GSR_COLOR_RANGE_LIMITED,
+ GSR_COLOR_RANGE_FULL
+} gsr_color_range;
+
+typedef enum {
+ GSR_SOURCE_COLOR_RGB,
+ GSR_SOURCE_COLOR_BGR
} gsr_source_color;
typedef enum {
- GSR_DESTINATION_COLOR_NV12
+ GSR_DESTINATION_COLOR_NV12, /* YUV420, BT709, 8-bit */
+ GSR_DESTINATION_COLOR_P010 /* YUV420, BT2020, 10-bit */
} gsr_destination_color;
typedef struct {
+ int offset;
+ int rotation;
+} gsr_color_uniforms;
+
+typedef struct {
gsr_egl *egl;
gsr_source_color source_color;
@@ -20,12 +33,15 @@ typedef struct {
unsigned int destination_textures[2];
int num_destination_textures;
+
+ gsr_color_range color_range;
+ bool load_external_image_shader;
} gsr_color_conversion_params;
typedef struct {
gsr_color_conversion_params params;
- int rotation_uniforms[2];
- gsr_shader shaders[2];
+ gsr_color_uniforms uniforms[4];
+ gsr_shader shaders[4];
unsigned int framebuffers[2];
@@ -36,6 +52,7 @@ typedef struct {
int gsr_color_conversion_init(gsr_color_conversion *self, const gsr_color_conversion_params *params);
void gsr_color_conversion_deinit(gsr_color_conversion *self);
-int gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_id, vec2i source_pos, vec2i source_size, vec2i texture_pos, vec2i texture_size, float rotation);
+void gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_id, vec2i source_pos, vec2i source_size, vec2i texture_pos, vec2i texture_size, float rotation, bool external_texture);
+void gsr_color_conversion_clear(gsr_color_conversion *self);
#endif /* GSR_COLOR_CONVERSION_H */