From 72bec683d1c738a882e19fa91cd2c85f6a854cd9 Mon Sep 17 00:00:00 2001
From: pommicket <pommicket@gmail.com>
Date: Thu, 20 Feb 2025 13:33:20 -0500
Subject: add NV12/21 supoprt

---
 main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

(limited to 'main.c')

diff --git a/main.c b/main.c
index 9164b83..e29cb9a 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,5 @@
 /*
 TODO
--add support for more pixfmts
 -adjustable camera framerate
 -view previous pictures (thumbnails)
 -click in menus
@@ -440,6 +439,16 @@ void main() {\n\
 		float cr = texture2D(u_sampler3, tex_coord).x;\n\
 		color = ycbcr_ITU_R_601_to_rgb(vec3(y,cb,cr));\n\
 		} break;\n\
+	case 0x3231564e: {// YUV 4:2:0 with a Y plane and a UV plane\n\
+		float y = texture2D(u_sampler, tex_coord).x;\n\
+		vec2 cbcr = texture2D(u_sampler2, tex_coord).xy;\n\
+		color = ycbcr_ITU_R_601_to_rgb(vec3(y,cbcr));\n\
+		} break;\n\
+	case 0x3132564e: {// YVU 4:2:0 with a Y plane and a VU plane\n\
+		float y = texture2D(u_sampler, tex_coord).x;\n\
+		vec2 cbcr = texture2D(u_sampler2, tex_coord).yx;\n\
+		color = ycbcr_ITU_R_601_to_rgb(vec3(y,cbcr));\n\
+		} break;\n\
 	default:\n\
 		color = texture2D(u_sampler, tex_coord).xyz;\n\
 		break;\n\
-- 
cgit v1.2.3