pike.git
/
src
/
modules
/
Image
/
togif.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Image/togif.c:1:
/* togif Pontus Hagland, law@infovav.se
-
$Id: togif.c,v 1.
4
1997/03/18 17:
30
:
54
mirar Exp $
+
$Id: togif.c,v 1.
5
1997/03/18 17:
36
:
23
mirar Exp $
*/ #include "global.h" #include <math.h> #include <ctype.h> #include "stralloc.h" #include "global.h"
pike.git/src/modules/Image/togif.c:619:
} static void img_gif_add(INT32 args,int fs,int lm) { INT32 x=0,y=0,i; struct lzw lzw; rgb_group *rgb; struct colortable *ct=NULL; dynamic_buffer buf; int colors,bpp;
-
int closest;
+
int closest
=0
;
CHRONO("gif add init"); buf.s.str=NULL; initialize_buf(&buf); if (args==0) x=y=0; else if (sp[-args].type!=T_INT || sp[1-args].type!=T_INT) error("Illegal argument(s) to image->gif_add()\n");
pike.git/src/modules/Image/togif.c:643:
y=sp[1-args].u.integer; } if (args>2 && sp[2-args].type==T_ARRAY) { ct=colortable_from_array(sp[2-args].u.array,"image->gif_add()\n"); closest=1; } else if (args>3 && sp[2-args].type==T_INT)
-
{
+
ct=colortable_quant(THIS,max(256,min(2,sp[2-args].u.integer)));
-
closest=0;
-
}
+
if (args>2+!!ct) { unsigned short delay=0; if (sp[2+!!ct-args].type==T_INT) delay=sp[2+!!ct-args].u.integer; else if (sp[2+!!ct-args].type==T_FLOAT) delay=(unsigned short)(sp[2+!!ct-args].u.float_number*100); else error("Illegal argument %d to image->gif_add()\n",3+!!ct);