+ Image_cadre_std2

This commit is contained in:
tTh 2022-09-12 23:35:54 +02:00
parent 162e04e6fc
commit 8d9c91f1b7
2 changed files with 55 additions and 13 deletions

View File

@ -135,8 +135,7 @@ return foo;
* 3 octobre 2009 : il faudra la renommer pour etre XXX * 3 octobre 2009 : il faudra la renommer pour etre XXX
* en accord avec 'tga_cadre' qui la nomme "sweep". XXX * en accord avec 'tga_cadre' qui la nomme "sweep". XXX
*/ */
int int Image_cadre_C(Image_Desc *im, int r, int g, int b, int n)
Image_cadre_C(Image_Desc *im, int r, int g, int b, int n)
{ {
int x, y, x2, y2, ir, ig, ib; int x, y, x2, y2, ir, ig, ib;
float fx, fy; float fx, fy;
@ -150,8 +149,7 @@ fn = (float)(n*n);
x2 = im->width / 2; x2 = im->width / 2;
y2 = im->height / 2; y2 = im->height / 2;
for (y=0; y<im->height; y++) for (y=0; y<im->height; y++) {
{
/* /*
* distance au bord HAUT BAS le plus proche * distance au bord HAUT BAS le plus proche
*/ */
@ -159,8 +157,7 @@ for (y=0; y<im->height; y++)
else fy = (float)((im->height - y)-1); else fy = (float)((im->height - y)-1);
fy = fy*fy; fy = fy*fy;
for (x=0; x<im->width; x++) for (x=0; x<im->width; x++) {
{
/* /*
* distance au bord DROITE GAUCHE le plus proche * distance au bord DROITE GAUCHE le plus proche
*/ */
@ -172,8 +169,7 @@ for (y=0; y<im->height; y++)
if (fx < fy) d = fx; if (fx < fy) d = fx;
else d = fy; else d = fy;
if (d < fn) if (d < fn) {
{
coef = d / fn; coef = d / fn;
ir = (im->Rpix[y])[x]; ir = (im->Rpix[y])[x];
ig = (im->Gpix[y])[x]; ig = (im->Gpix[y])[x];
@ -470,5 +466,49 @@ for (y=0; y<im->height; y++)
return OLL_KORRECT; return OLL_KORRECT;
} }
/*::------------------------------------------------------------------::*/ /*::------------------------------------------------------------------::*/
/* nouveau : Mon 12 Sep 2022 10:47:18 PM CEST
*/
int Image_cadre_std2(Image_Desc *im, int r, int g, int b, int nh, int nv)
{
int x, y;
#if DEBUG_LEVEL
fprintf(stderr, ">>> %s ( %p %d %d %d %d %d )\n", __func__,
im, r, g, b, nh, nv);
#endif
for (y=0; y<im->height; y++)
{
for (x=0; x<nv; x++)
{
(im->Rpix[y])[x] = r;
(im->Gpix[y])[x] = g;
(im->Bpix[y])[x] = b;
}
for (x=0; x<nv; x++)
{
Image_plotRGB(im, x+im->width - nv, y, r, g, b);
}
}
for (x=0; x<im->width; x++)
{
for (y=0; y<nh; y++)
{
(im->Rpix[y])[x] = r;
(im->Gpix[y])[x] = g;
(im->Bpix[y])[x] = b;
}
for (y=0; y<nh; y++)
{
(im->Rpix[y+im->height-nh])[x] = r;
(im->Gpix[y+im->height-nh])[x] = g;
(im->Bpix[y+im->height-nh])[x] = b;
}
}
return FUNC_IS_BETA;
}
/*::------------------------------------------------------------------::*/
/* et maintenant ? on peut aller voir 'cadres2.c' ? */ /* et maintenant ? on peut aller voir 'cadres2.c' ? */
/*::------------------------------------------------------------------::*/ /*::------------------------------------------------------------------::*/

View File

@ -4,7 +4,7 @@
http:///la.buvette.org/devel/libimage/ http:///la.buvette.org/devel/libimage/
*/ */
#ifndef IMAGE_VERSION_STRING #ifndef IMAGE_VERSION_STRING
#define IMAGE_VERSION_STRING "0.4.51 pl 18" #define IMAGE_VERSION_STRING "0.4.51 pl 21"
/*::------------------------------------------------------------------::*/ /*::------------------------------------------------------------------::*/
/* /*
@ -481,10 +481,10 @@ typedef struct
* que Gcc grinke feroce dessus... * que Gcc grinke feroce dessus...
*/ */
int Image_mosaic_0(Image_Desc *src, Image_Desc *dst, int sx, int sy, int flg); int Image_mosaic_0(Image_Desc *src, Image_Desc *dst, int sx, int sy, int flg);
int Image_mosaic_simple(Image_Desc *src, Image_Desc *dst); int Image_mosaic_simple(Image_Desc *src, Image_Desc *dst);
void Image_mosaic_prctrl(IMAGE_MOSAIC_CTRL *ctrl, char *txt); void Image_mosaic_prctrl(IMAGE_MOSAIC_CTRL *ctrl, char *txt);
int Image_mosaic_iterateur(IMAGE_MOSAIC_CTRL *ctrl, int yo); int Image_mosaic_iterateur(IMAGE_MOSAIC_CTRL *ctrl, int yo);
/*::------------------------------------------------------------------::*/ /*::------------------------------------------------------------------::*/
/* module des vignettes (nex 15 mai 2007) */ /* module des vignettes (nex 15 mai 2007) */
@ -1113,10 +1113,12 @@ int Image_pix2ptl(Image_Desc *img, int seuil, Image_PtList *ptl);
int Image_cadre_A(Image_Desc *im); int Image_cadre_A(Image_Desc *im);
int Image_cadre_B(Image_Desc *im, int larg); int Image_cadre_B(Image_Desc *im, int larg);
int Image_cadre_cracra(Image_Desc *im, int larg, int k); int Image_cadre_cracra(Image_Desc *im, int larg, int k);
int Image_cadre_C(Image_Desc *, int, int, int, int); int Image_cadre_C(Image_Desc *, int r, int g, int b, int sz);
int Image_cadre_bruit(Image_Desc *, int, int, int, int); int Image_cadre_bruit(Image_Desc *, int, int, int, int);
int Image_cadre_E(Image_Desc *, int, int, int, int); int Image_cadre_E(Image_Desc *, int, int, int, int);
int Image_cadre_std2(Image_Desc *im, int r, int g, int b, int nh, int nv);
int Image_cadre_pattern_0(Image_Desc *, Image_Desc *, int); int Image_cadre_pattern_0(Image_Desc *, Image_Desc *, int);
int Image_cadre_pattern_1(Image_Desc *im, Image_Desc *pat, int n); int Image_cadre_pattern_1(Image_Desc *im, Image_Desc *pat, int n);
int Image_cadre_pattern_2(Image_Desc *im, Image_Desc *pat, int n); int Image_cadre_pattern_2(Image_Desc *im, Image_Desc *pat, int n);