Compare commits
4 Commits
cdeeb9d92d
...
1a185d05c5
Author | SHA1 | Date | |
---|---|---|---|
1a185d05c5 | |||
bef5954b93 | |||
2460d622b1 | |||
8f6d80da12 |
@ -98,23 +98,6 @@ fimg_destroy(&img);
|
||||
return retval;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
static int desaturate(FloatImg *pimg)
|
||||
{
|
||||
FloatImg img;
|
||||
int retval;
|
||||
fimg_clone(pimg, &img, 0);
|
||||
retval = fimg_desaturate(pimg, &img, 0);
|
||||
if (retval) {
|
||||
fprintf(stderr, "%s : err desaturate %d\n",
|
||||
__func__, retval);
|
||||
exit(1);
|
||||
}
|
||||
fimg_copy_data(&img, pimg);
|
||||
fimg_destroy(&img);
|
||||
|
||||
return 0;
|
||||
}
|
||||
/* -------------------------------------------------------------- */
|
||||
/*
|
||||
* This is the main filter engine used both for input and
|
||||
* output processing. It can be called by the filterstack
|
||||
@ -193,7 +176,7 @@ switch (idFx) {
|
||||
retval = insitu_filtre3x3(image, 0);
|
||||
break;
|
||||
case 14:
|
||||
retval = desaturate(image);
|
||||
retval = fimg_desaturate(image, image, 0);
|
||||
break;
|
||||
case 15:
|
||||
retval = kill_a_few_lines(image, fval,
|
||||
@ -223,7 +206,7 @@ switch (idFx) {
|
||||
break;
|
||||
|
||||
case 26:
|
||||
retval = random_blocks(image, 80);
|
||||
retval = random_blocks(image, 70);
|
||||
break;
|
||||
|
||||
default :
|
||||
|
@ -188,6 +188,10 @@ if (foo) {
|
||||
string...
|
||||
*/
|
||||
tmparg = alloca(strlen(argument) + 1);
|
||||
if (NULL==tmparg) {
|
||||
fprintf(stderr, "memory panic in %s:%s\n", __FILE__, __func__);
|
||||
exit(1);
|
||||
}
|
||||
strcpy(tmparg, argument);
|
||||
|
||||
for (;;) {
|
||||
@ -209,3 +213,5 @@ if (verbosity) filterstack_list(numid, __func__);
|
||||
return 0;
|
||||
}
|
||||
/* ----------------------------------------------------------- */
|
||||
|
||||
|
||||
|
@ -100,13 +100,19 @@ int random_blocks(FloatImg *picture, int percent)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
for (y=0; y<picture->height; y+=8) {
|
||||
for (x=0; x<picture->width; x+=8) {
|
||||
if ( (picture->width%16) || (picture->height%8) )
|
||||
{
|
||||
fprintf(stderr, "%s: %d%d bad dims\n", __func__,
|
||||
picture->width, picture->height);
|
||||
}
|
||||
|
||||
for (y=0; y<picture->height; y+=16) {
|
||||
for (x=0; x<picture->width; x+=16) {
|
||||
if (percent < (rand()%100) ) {
|
||||
|
||||
un_petit_flou_8x8(picture, x, y);
|
||||
|
||||
un_petit_flou_8x8(picture, x+8, y);
|
||||
un_petit_flou_8x8(picture, x, y+8);
|
||||
un_petit_flou_8x8(picture, x+8, y+8);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ for (foo=0; foo<nbb; foo++) {
|
||||
return 0;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
/* this function can work 'in place' */
|
||||
int fimg_desaturate(FloatImg *src, FloatImg *dst, int notused)
|
||||
{
|
||||
int foo, nbb;
|
||||
|
Loading…
Reference in New Issue
Block a user