Term-Gnuplot

 view release on metacpan or  search on metacpan

gnuterm/term/gif.trm  view on Meta::CPAN

 * Where an option is:
 *
 * transparent - generate transparent GIFs.  The first color will
 * be the transparent one.
 *
 * interlace - generate interlaced GIFs.
 *
 * size (in pixels)
 *
 * font (tiny,small,medium,large,giant)
 *
 * xrrggbb - sets the next color.  x is the literal character 'x',
 * rrggbb are the red green and blue components in hex.  For example
 * x00ff00 is green.  The background color is set first, then the
 * color borders, then the X & Y axis, then the plotting colors.
 * (The wierd color spec is in order to get around limitations
 * in gnuplot's scanner.)
 *
 * This driver is modeled after the PBM driver pbm.trm.
 *
 * AUTHORS
 *  Sam Shen <sls@mh1.lbl.gov>
 *  Alex Woo <woo@playfair.stanford.edu>
 *
 * CONTRIBUTORS
 *  Alfred Reibenschuh <alfred.reibenschuh@it-austria.com> or <fredo@blackbox.at>
 *  Ben Laurie <ben@algroup.co.uk>
 *
 * send your comments or suggestions to:
 *  info-gnuplot@cs.dartmouth.edu
 * 
 * This version outputs either color or monochrome GIFs.  The default
 * is 640x480 pixels.  
 *
 * link with -Lterm/gd -lgd if your directory structure is gnuplot/term/gd
 *
 * gd is not distributed with gnuplot, because of the UNISYS license thing.
 *
 * find out about gd from http://www.boutell.com/gd/
 *
 * We recommend to use gd library version 1.3 or 1.4 because it uses
 * Run Length Encoding (RLE) instead of LZW compression. LZW compression
 * is licensed by UNISYS.
 *
 * Gd library versions before 1.3, and gd library 1.5 are subject to
 * the Unisys license. Use at your own risk. From version 1.6 on, gd
 * library creates png files instead of gif.
 *
 * Petr Mikulik, Jan 1999: terminal entries for PM3D functionality
 */

/*
 * This definition is triggered by the configuration option --with-gif=png
 * It provides backwards compatibility with existing scripts that used the
 * old gif driver and libgd versions <1.6 by substituting creation of PNG 
 * images in response to * 'set term gif' using the PNG support in libgd
 * versions >= 1.8
 * Ethan A Merritt - Nov 2001
 */
#ifdef PNG_FOR_GIF
#define gdImageGif gdImagePng
#endif


#include "driver.h"

#ifdef TERM_REGISTER
register_term(gif)
#endif

#ifdef TERM_PROTO
TERM_PUBLIC void GIF_options __PROTO((void));
TERM_PUBLIC void GIF_init __PROTO((void));
TERM_PUBLIC void GIF_graphics __PROTO((void));
TERM_PUBLIC void GIF_text __PROTO((void));
TERM_PUBLIC void GIF_linetype __PROTO((int linetype));
TERM_PUBLIC void GIF_move __PROTO((unsigned int x, unsigned int y));
TERM_PUBLIC void GIF_vector __PROTO((unsigned int x, unsigned int y));
TERM_PUBLIC void GIF_put_text __PROTO((unsigned int x, unsigned int y, const char str[]));
TERM_PUBLIC int GIF_text_angle __PROTO((int ang));
TERM_PUBLIC void GIF_reset __PROTO((void));
TERM_PUBLIC int GIF_set_font __PROTO((const char *fontname));
TERM_PUBLIC void GIF_boxfill __PROTO((int style, unsigned int x, unsigned int y, unsigned int w, unsigned int h));
#ifdef PM3D
TERM_PUBLIC int GIF_make_palette (t_sm_palette *);
/* TERM_PUBLIC void GIF_previous_palette (void); */
TERM_PUBLIC void GIF_set_color (double);
TERM_PUBLIC void GIF_filled_polygon (int, gpiPoint *);
#endif

#include "gd.h"

extern gdFontPtr gdFontSmall;	/* 6x12 */
extern gdFontPtr gdFontLarge;	/* 8x16 */
extern gdFontPtr gdFontMediumBold;	/* 7x13 */
extern gdFontPtr gdFontGiant;  /* 9x15 */
extern gdFontPtr gdFontTiny;  /* 5x8 */


#define GREG_XMAX 640
#define GREG_YMAX 480


static int GIF_XMAX = GREG_XMAX;
static int GIF_YMAX = GREG_YMAX;


#define GIF_FONT_SMALL 1
#ifdef GIF_FONT_SMALL
# define gdfont gdFontSmall
# define GIF_VCHAR 12
# define GIF_HCHAR 6
#else
# define gdfont gdFontMediumBold
# define GIF_VCHAR 13
# define GIF_HCHAR 7
#endif

static gdFontPtr GIF_font;

#define GIF_VTIC (GREG_YMAX/100)



( run in 0.474 second using v1.01-cache-2.11-cpan-13bb782fe5a )