|
|
|
@ -51,4 +51,55 @@ for (idx=0; idx<number; idx++) {
@@ -51,4 +51,55 @@ for (idx=0; idx<number; idx++) {
|
|
|
|
|
return foo; |
|
|
|
|
} |
|
|
|
|
/* -------------------------------------------------------------- */ |
|
|
|
|
int un_petit_flou_8x8(FloatImg *picture, int xpos, int ypos) |
|
|
|
|
{ |
|
|
|
|
float sr, sg, sb; |
|
|
|
|
int x, y, off; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* please add boundary check ? |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
sr = sg = sb = 0.0; |
|
|
|
|
for (y=0; y<8; y++) { |
|
|
|
|
off = xpos + (picture->width * (y+ypos)); |
|
|
|
|
for (x=0; x<8; x++) { |
|
|
|
|
sr += picture->R[off]; |
|
|
|
|
sg += picture->G[off]; |
|
|
|
|
sb += picture->B[off]; |
|
|
|
|
off++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
sr /= 64.0; sg /= 64.0; sb /= 64.0; |
|
|
|
|
for (y=0; y<8; y++) { |
|
|
|
|
off = xpos + (picture->width * (y+ypos)); |
|
|
|
|
for (x=0; x<8; x++) { |
|
|
|
|
picture->R[off] = sr; |
|
|
|
|
picture->G[off] = sg; |
|
|
|
|
picture->B[off] = sb; |
|
|
|
|
off++; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
/* -------------------------------------------------------------- */ |
|
|
|
|
int un_moyen_flou_8x8(FloatImg *picture, int xpos, int ypos) |
|
|
|
|
{ |
|
|
|
|
int i, j, x, y; |
|
|
|
|
|
|
|
|
|
for (i=y=0; i<8; i++, y+=8) { |
|
|
|
|
for (j=x=0; j<8; j++, x+=8 ) { |
|
|
|
|
un_petit_flou_8x8(picture, x+xpos, y+ypos); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
/* -------------------------------------------------------------- */ |
|
|
|
|
int poke_a_random_pixel(FloatImg *picz, float fval, int kaboo) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
/* -------------------------------------------------------------- */ |
|
|
|
|
|
|
|
|
|