diff -ru old/GD-2.16/GD.pm GD-2.16/GD.pm --- old/GD-2.16/GD.pm 2004-07-27 03:47:45.000000000 +0300 +++ GD-2.16/GD.pm 2004-10-18 16:53:20.970854601 +0300 @@ -765,6 +765,40 @@ opposite meaning from compression (higher numbers give higher quality). +=item B<$gifdata = $image-Egifanimbegin([$GlobalCM [, $Loops]])> + +Returns the data that comprises animated gif image file header. You +can then print it, pipe it to a display program, or write it to a +file. The actual image data from used image object is not used, only +the image size, color resolution and color map. If argument $GlobalCM +is 1, the image color map is used as GIF89a global color map. If +$Loops is given and >= 0, the NETSCAPE2.0 application extension is +created, with looping count. Looping count 0 means forever. + +After this data, a complete animated GIF89a file needs image frames +created with gifanimadd() method. Finally, the file is terminated +with the data created with GD::Image::gifanimend() function. + +=item B<$gifdata = $image-Egifanimadd([$LocalCM [, $LeftOfs [, $TopOfs [, $Delay [, $Disposal [, $previm]]]]]])> + +Returns the data that comprises one animated gif image frame. You can +then print it, pipe it to a display program, or write it to a file. +With $LeftOfs and $TopOfs you can place this frame in different offset +than (0,0) inside the image screen. Delay between the previous frame +and this frame is in 1/100s units. Disposal is usually and by default +1. Compression is activated by giving the previous image as a +parameter. This function then compares the images and only writes the +changed pixels to the new frame in animation. The Disposal parameter +for optimized animations must be set to 1, also for the first frame. +$LeftOfs and $TopOfs parameters are ignored for optimized frames. + +=item B<$gifdata = $image-Egifanimend()> + +Returns the data for end segment of animated gif file. It always +returns string ';'. This string must be printed to an animated gif +file after all image frames to properly terminate it according to GIF +file syntax. Image object is not used at all in this method. + =item B<$jpegdata = $image-Ejpeg([$quality])> This returns the image data in JPEG format. You can then print it, @@ -1141,7 +1175,7 @@ # draw the rectangle, filling it with the pattern $myImage->filledRectangle(10,10,150,200,gdTiled); -=item B<$image-Epolygon($polygon,$color)> +=item B<$image-EopenPolygon($polygon,$color)> This draws a polygon with the specified color. The polygon must be created first (see below). The polygon must have at least three @@ -1155,7 +1189,23 @@ $poly->addPt(50,0); $poly->addPt(99,99); $poly->addPt(0,99); - $myImage->polygon($poly,$blue); + $myImage->openPolygon($poly,$blue); + +=item B<$image-EunclosedPolygon($polygon,$color)> + +This draws a sequence of connected lines with the specified color, +without connecting the first and last point to a closed polygon. The +polygon must be created first (see below). The polygon must have at +least three vertices. Both real color indexes and the special colors +gdBrushed, gdStyled and gdStyledBrushed can be specified. + +Example: + + $poly = new GD::Polygon; + $poly->addPt(50,0); + $poly->addPt(99,99); + $poly->addPt(0,99); + $myImage->unclosedPolygon($poly,$blue); =item B<$image-EfilledPolygon($poly,$color)> diff -ru old/GD-2.16/GD.xs GD-2.16/GD.xs --- old/GD-2.16/GD.xs 2004-07-27 03:47:45.000000000 +0300 +++ GD-2.16/GD.xs 2004-10-18 15:17:41.709927157 +0300 @@ -915,6 +915,59 @@ RETVAL SV* +gdgifanimbegin(image,globalcm=-1,loops=-1) + GD::Image image + int globalcm + int loops + PROTOTYPE: $$$ + CODE: + { + void* data; + int size; + data = (void *) gdImageGifAnimBeginPtr(image,&size,globalcm,loops); + RETVAL = newSVpv((char*) data,size); + gdFree(data); + } + OUTPUT: + RETVAL + +SV* +gdgifanimadd(image,localcm=-1,leftofs=-1,topofs=-1,delay=-1,disposal=-1,previm=0) + GD::Image image + int localcm + int leftofs + int topofs + int delay + int disposal + GD::Image previm + PROTOTYPE: $$$$$$$ + CODE: + { + void* data; + int size; + data = (void *) gdImageGifAnimAddPtr(image,&size,localcm,leftofs,topofs,delay,disposal,previm); + RETVAL = newSVpv((char*) data,size); + gdFree(data); + } + OUTPUT: + RETVAL + +SV* +gdgifanimend(image) + GD::Image image + PROTOTYPE: $ + CODE: + { + void* data; + int size; + data = (void *) gdImageGifAnimEndPtr(&size); + RETVAL = newSVpv((char*) data,size); + gdFree(data); + } + OUTPUT: + RETVAL + +SV* gdwbmp(image,fg) GD::Image image int fg @@ -1392,6 +1445,62 @@ } void +gdunclosedPolygon(image,poly,color) + GD::Image image + SV * poly + int color + PROTOTYPE: $$$ + CODE: + { + dSP ; + int length,count ; + int x,y,i ; + gdPointPtr polyptr; + + ENTER ; + SAVETMPS ; + PUSHMARK(sp) ; + XPUSHs(poly) ; + PUTBACK ; + count = perl_call_method("length",G_SCALAR) ; + SPAGAIN ; + if (count != 1) + croak("Didn't get a single result from GD::Poly::length() call.\n"); + length = POPi ; + PUTBACK ; + FREETMPS ; + LEAVE ; + + polyptr = (gdPointPtr)safemalloc(sizeof(gdPoint)*length); + if (polyptr == NULL) + croak("safemalloc() returned NULL in GD::Image::poly().\n"); + + for (i=0;i