From d6877097d06c8330a746947a8c3906a9fe9caed4 Mon Sep 17 00:00:00 2001 From: tTh Date: Thu, 15 Aug 2024 15:18:10 +0200 Subject: [PATCH] + rgb decomp --- Contribs/ExplodeVidz.md | 11 ++++++ Contribs/rgb_decomp.c | 87 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 98 insertions(+) create mode 100644 Contribs/rgb_decomp.c diff --git a/Contribs/ExplodeVidz.md b/Contribs/ExplodeVidz.md index ed3d6ef..b47b7ab 100644 --- a/Contribs/ExplodeVidz.md +++ b/Contribs/ExplodeVidz.md @@ -3,3 +3,14 @@ But du jeu : traiter la séquence d'image complète d'une vidéo live, sans devoir attendre 107 ans que le job soit fait. + +## Current status + +- [rgb_decomp.c](rgb_decomp.c) + +## Film at 11. + +See you soon. + + + diff --git a/Contribs/rgb_decomp.c b/Contribs/rgb_decomp.c new file mode 100644 index 0000000..5e8c6a6 --- /dev/null +++ b/Contribs/rgb_decomp.c @@ -0,0 +1,87 @@ + + +#include +#include +#include +#include + +#include + +/* -------------------------------------------------------- */ + + +/* -------------------------------------------------------- */ + +int rgb_process_by_filename(char *inf, char *outf) +{ +Image_Desc *src, *dst; +int foo; +int x, y, larg, offs; +int r, g, b; + +if ( (src=Image_TGA_alloc_load(inf)) == NULL ) + { + fprintf(stderr, "%s: err load %s\n", __func__, inf); + exit(5); + } + +printf("source '%s' %dx%d\n", inf, src->width, src->height); + +if ( (dst=Image_clone(src, 0)) == NULL ) + { + fprintf(stderr, "%s: no mem for image cloning\n", __func__); + exit(5); + } + +Image_clear(dst, 160, 60, 60); + +/* + * calcul de la zone à traiter + */ +larg = src->width / 3; +offs = (src->width - larg) / 2; +printf("largeur %d offset %d\n", larg, offs); + + +for (y=0; yheight; y++) { + for (x=0; x %d\n", foo); + } + +return 0; +} + +/* -------------------------------------------------------- */