/* cadres4.c ========= */ #include #include #include #include "../tthimage.h" /*::------------------------------------------------------------------::*/ /* * fonction en chantier -> coredump probable * je ne sais pas à quoi va servir le paramètre 'flags' ... * 7 nov 2007: * le flag a disparu, il contient maintenant la valeur de * la composante verte. lol. */ int Image_cadre_burp_0(Image_Desc *img, int p1, int p2, int gval) { int x, y, zz, v; #if DEBUG_LEVEL fprintf(stderr, "%s p1=%d p2=%d flg=0x%02x\n", __func__, p1, p2, gval); #endif for (x=0; xwidth; x++) { v = (x * 256) / img->width; for (zz=0; zzRpix[y])[x] = 0; (img->Gpix[y])[x] = gval; (img->Bpix[y])[x] = v; y = img->height-zz-1; (img->Rpix[y])[x] = 0; (img->Gpix[y])[x] = gval; (img->Bpix[y])[x] = 255-v; } } for (y=p1; yheight-p1; y++) { v = (y * 256) / img->height; for (zz=0; zzRpix[y])[x] = 0; (img->Gpix[y])[x] = gval; (img->Bpix[y])[x] = v; x = img->width-zz-1; (img->Rpix[y])[x] = 0; (img->Gpix[y])[x] = gval; (img->Bpix[y])[x] = 255-v; } } img->modified = 1; return FUNC_IS_BETA; } /*::------------------------------------------------------------------::*/ /* * 13 Juin 2002: grosse colère, je vais faire du codage à la Gruuik. */ int Image_cadre_burp_1(Image_Desc *img, int p1, int p2, int flags) { int x, xx, y, yy, v; #if DEBUG_LEVEL fprintf(stderr, "%s ( %p %d %d $%x )\n", __func__, img, p1, p2, flags); #endif for (x=0; xwidth; x++) { v = (x * 256) / img->width; #if DEBUG_LEVEL > 1 printf("%s : debug %d %d\n", __func__, x, v); #endif for (yy=0; yyRpix[y])[x] = 255-v; (img->Gpix[y])[x] = 255; (img->Bpix[y])[x] = v; y = img->height-yy-1; (img->Rpix[y])[x] = v; (img->Gpix[y])[x] = 255; (img->Bpix[y])[x] = 255-v; } } for (y=p1; yheight-p1; y++) { v = (y * 256) / img->height; for (xx=0; xxRpix[y])[x] = 0; (img->Gpix[y])[x] = 255; (img->Bpix[y])[x] = v; x = img->width-xx-1; (img->Rpix[y])[x] = 0; (img->Gpix[y])[x] = 255; (img->Bpix[y])[x] = 255-v; } } if (flags & 1) { fprintf(stderr, "plop from %s\n", __func__); } return OLL_KORRECT; } /*::------------------------------------------------------------------::*/ /* * new 10 decembre 2007 - ave St Exupery - fait pour l'affichage web * des exemples des objets POV de tTh */ int Image_cadre_burp_2(Image_Desc *img, int taille, int pr, int pg, int pb) { int x, y, zz; #if DEBUG_LEVEL fprintf(stderr, "%s: sz %d, rgb %d %d %d\n", __func__, taille, pr, pg, pb); #endif for (x=0; xwidth; x++) { for (zz=0; zzRpix[y])[x] |= pr; (img->Gpix[y])[x] ^= pg; (img->Bpix[y])[x] &= pb; y = img->height-zz-1; (img->Rpix[y])[x] |= pr; (img->Gpix[y])[x] ^= pg; (img->Bpix[y])[x] &= pb; } } for (y=taille; yheight-taille; y++) { for (zz=0; zzRpix[y])[x] |= pr; (img->Gpix[y])[x] ^= pg; (img->Bpix[y])[x] &= pb; x = img->width-zz-1; (img->Rpix[y])[x] |= pr; (img->Gpix[y])[x] ^= pg; (img->Bpix[y])[x] &= pb; } } return OLL_KORRECT; } /*::------------------------------------------------------------------::*/ int Image_cadre_burp_3(Image_Desc *img, int taille, int pr, int pg, int pb) { int foo; #if DEBUG_LEVEL fprintf(stderr, "Cadre burp3 on %p\n", img); #endif foo = Image_cadre_burp_2(img, taille, pr, pg, pb); foo = Image_cadre_burp_2(img, taille/2, pr/2, pg/2, pb/2); img->modified = 2; return FUNC_IS_BETA; } /*::------------------------------------------------------------------::*/ int Image_cadre_rasta_0(Image_Desc *img, int taille) { Image_Rect rect; int foo; int r, g, b; #if DEBUG_LEVEL fprintf(stderr, "%s : img at %p, taille=%d\n", __func__, img, taille); #endif #define RASTA_RAND 2 rect.x = rect.y = 0; rect.w = img->width; rect.h = img->height; for (foo=0; foomodified = 1; return FUNC_IS_BETA; } /*::------------------------------------------------------------------::*/