From ccaee08e45d12935a5e41edb6102c1a6e21dca8a Mon Sep 17 00:00:00 2001
From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org>
Date: Mon, 3 Nov 1997 02:40:36 +0100
Subject: [PATCH] internal set to floyd_steinberg added some warnings fixed

Rev: src/modules/Image/colortable.c:1.20
Rev: src/modules/Image/colortable.h:1.6
Rev: src/modules/Image/colortable_lookup.h:1.3
---
 src/modules/Image/colortable.c        | 17 ++++++++++++++---
 src/modules/Image/colortable.h        |  4 +++-
 src/modules/Image/colortable_lookup.h | 10 +++++-----
 3 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/src/modules/Image/colortable.c b/src/modules/Image/colortable.c
index af6a9c8d55..2cb21154aa 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 b9559bff34..002f582355 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 d4899646b0..83911c8c24 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;
-- 
GitLab