diff --git a/src/modules/Image/colortable.c b/src/modules/Image/colortable.c index af6a9c8d55f3c9f4d6af4d8a4f810fa330df461f..2cb21154aac686dee0f5307fb46c38a23ad1934f 100644 --- a/src/modules/Image/colortable.c +++ b/src/modules/Image/colortable.c @@ -1,11 +1,11 @@ #include <config.h> -/* $Id: colortable.c,v 1.19 1997/11/03 00:34:45 mirar Exp $ */ +/* $Id: colortable.c,v 1.20 1997/11/03 01:40:34 mirar Exp $ */ /* **! module Image **! note -**! $Id: colortable.c,v 1.19 1997/11/03 00:34:45 mirar Exp $ +**! $Id: colortable.c,v 1.20 1997/11/03 01:40:34 mirar Exp $ **! class colortable **! **! This object keeps colortable information, @@ -21,7 +21,7 @@ #undef COLORTABLE_REDUCE_DEBUG #include "global.h" -RCSID("$Id: colortable.c,v 1.19 1997/11/03 00:34:45 mirar Exp $"); +RCSID("$Id: colortable.c,v 1.20 1997/11/03 01:40:34 mirar Exp $"); #include <sys/types.h> #include <sys/stat.h> @@ -3147,6 +3147,17 @@ void image_colortable_floyd_steinberg(INT32 args) push_object(THISOBJ); THISOBJ->refs++; } +/* called by GIF encoder */ +void image_colortable_internal_floyd_steinberg(struct neo_colortable *nct) +{ + nct->du.floyd_steinberg.forward=0.95*(7.0/16); + nct->du.floyd_steinberg.downforward=0.95*(1.0/16); + nct->du.floyd_steinberg.down=0.95*(5.0/16); + nct->du.floyd_steinberg.downback=0.95*(3.0/16); + + nct->dither_type=NCTD_FLOYD_STEINBERG; +} + /* **! method object nodither() **! Set no dithering (default). diff --git a/src/modules/Image/colortable.h b/src/modules/Image/colortable.h index b9559bff346a904cd09032569aeb51dcf62a4afb..002f582355c2b8f95ddc7883f0d56b4fb0d6b761 100644 --- a/src/modules/Image/colortable.h +++ b/src/modules/Image/colortable.h @@ -1,7 +1,7 @@ /* **! module Image **! note -**! $Id: colortable.h,v 1.5 1997/11/02 03:44:47 mirar Exp $ +**! $Id: colortable.h,v 1.6 1997/11/03 01:40:35 mirar Exp $ */ #define COLORLOOKUPCACHEHASHSIZE 207 @@ -185,3 +185,5 @@ int image_colortable_index_8bit_image(struct neo_colortable *nct, unsigned char *d, int len, int rowlen); + +void image_colortable_internal_floyd_steinberg(struct neo_colortable *nct); diff --git a/src/modules/Image/colortable_lookup.h b/src/modules/Image/colortable_lookup.h index d4899646b04b25aca2a3daf8d632e1db8a36bfe7..83911c8c24764a253977f457a7656a42d5009f21 100644 --- a/src/modules/Image/colortable_lookup.h +++ b/src/modules/Image/colortable_lookup.h @@ -1,10 +1,10 @@ -/* $Id: colortable_lookup.h,v 1.2 1997/11/02 20:03:18 mirar Exp $ */ +/* $Id: colortable_lookup.h,v 1.3 1997/11/03 01:40:36 mirar Exp $ */ /* included w/ defines in colortable.c */ /* **! module Image **! note -**! $Id: colortable_lookup.h,v 1.2 1997/11/02 20:03:18 mirar Exp $ +**! $Id: colortable_lookup.h,v 1.3 1997/11/03 01:40:36 mirar Exp $ **! class colortable */ @@ -34,15 +34,15 @@ static void NCTLU_FLAT_CUBICLES_NAME(rgb_group *s, cubs=&(nct->lu.cubicles); if (!(cubs->cubicles)) { - int n=cubs->r*cubs->g*cubs->b; + int n2=cubs->r*cubs->g*cubs->b; CHRONO("init flat/cubicles"); - cub=cubs->cubicles=malloc(sizeof(struct nctlu_cubicle)*n); + cub=cubs->cubicles=malloc(sizeof(struct nctlu_cubicle)*n2); if (!cub) error("out of memory\n"); - while (n--) /* initiate all to empty */ + while (n2--) /* initiate all to empty */ { cub->n=0; cub->index=NULL;