NAME
	/precompiled/gd - gif creation and manipulation program

DESCRIPTION
	/precompiled/gd is an LPC program written in C, which uses
	Thomas Boutell's GD 1.2, a library of C functions for playing
	with gis.  See http://www.boutell.com/ for more information.

	Here are descriptions of the functions in /precompiled/gd:
============================================================================
NAME
	create - initialize image

SYNTAX
	object clone((program) "/precompiled/gd")
	or
	object clone((program) "/precompiled/gd", x, y)

DESCRIPTION
	With no arguments, this creates an object ready to create a new
	image or load in an old image.

	With arguments, it makes an object containing a blank gif
	with dimensions x by y.  It contains no colors initially.


============================================================================
NAME
	destroy - remove an image from memory

SYNTAX
	void destroy();

DESCRIPTION
	This function removes an image in use by gd, free its memory for
	other usage.

	This function is not needed when loading or creating another image.
	The old image will automatically be destroyed.

============================================================================
NAME
	alloc_color - allocate a color

SYNTAX
	int alloc_color(int red, int green, int blue)

DESCRIPTION
	This function attempts to allocate a new color in the image.  If
	successful, it returns the index for that color.  If unsuccessful
	(in other words, if the maximum number of colors is in use) it will
	return -1.

	The first color allocated in a new image (index 0) is the background.

NOTE BENE
	It is not uncommon for loaded images to use all 256 colors allowed
	by the GIF standard, so when working with preexisting images,
	one will frequently get -1 returned from this function.

SEE ALSO
	free_color

============================================================================
NAME
	free_color - deallocate a color

SYNTAX
	void free_color(int color_index)

DESCRIPTION
	This function frees up a color index in use so that it may be
	reallocated later.

SEE ALSO
	alloc_color

============================================================================
NAME
	set_color - set a color for later use

SYNTAX
	void set_color(int color_index)

DESCRIPTION
	This sets the color that will be used by the next drawing function
	in gd.

============================================================================
NAME
	closest_color - find closest color in image to specified color

SYNTAX
	int closest_color(int red, int blue, int great)

DESCRIPTION
	This will scan all allocated colors in an image and attempt to
	find the closest matching the {red,blue,green} triple.

	This color will be also be set in gd as the next color to be used
	in a drawing function.

	This is useful if all colors have been allocated.

============================================================================
NAME
	exact_color - find a color in an image, if it exists

SYNTAX
	int exact_color(int red, int blue, int green)

DESCRIPTION
	This function looks at all colors allocated in an image, and if one
	of these colors exactly matches the specified color, that color's
	index will be returned.

	If no color is found, -1 is returned.

============================================================================
NAME
	create_image - create a new image

SYNTAX
	int create_image(int x, int y)

DESCRIPTION
	This function creates a new gif image with dimensions x by y.

	If a gd already contains a picture, it is destroyed first.

	If something goes wrong, 0 is returned.

SEE ALSO
	load_image

============================================================================
NAME
	load_image - read an image from a file

SYNTAX
	int read_image(string file, string imagetype)

DESCRIPTION
	This function reads an image in from a file.
	Supported image types are:
		gif 	GIF87 type
		xbm	Xbitmap
		gd	GD's native image format

	Type 'gd' is made for when very fast loading is necessary.  It is
	not a format for exporting pictures, and is used nowhere else other
	than in GD.

	Any picture already in memory in GD object is first destroyed.

============================================================================
NAME
	line - draw a line from one point to another point

SYNTAX
	void line(int x1, int y1, int x2, int y2[, int color])

DESCRIPTION
	This function draws a line from point (x1, y1) to (x2, y2).

	The color index is optional.  If left off, it uses the most recently
	set or allocated color.

============================================================================
NAME
	box - draw a box

SYNTAX
	void box(int x1, int y1, int x2, int y2[, int fill[, int color]])

DESCRIPTION
	This function draws a box with the upper left corner at (x1,y1)
	and the lower right corner at (x2,y2).  If the fifth argument, 'fill',
	is nonzero, the box will be drawn with a solid interior (filled).

	The color index is optional.  If left off, it uses the most recently
	set or allocated color.

============================================================================
NAME
	point - fill in a single pixel

SYNTAX
	void point(int x, int y[, int color]);

DESCRIPTION
	This function fills in a single pixel with the 'color' index, if
	specified, or else the most recently allocated or used color.

============================================================================
NAME
	arc - draw a partial or whole ellipse

SYNTAX
	void arc(int x, int y, int width, int height, int start, int end,
			int color);

	At least 3 arguments must be used.

DESCRIPTION
	x = horizontal component of center
	y = verticle component of center
	width = horizontal width of ellipse
	height = verticle height of ellipse
	start = degree of arc to start with (Requires: 0 <= start <= 360)
	end = degree of arc to end at (Requires: 0 <= end <= 360)
	color = color index to use.

NOTE BENE
	To draw a circle, just do: arc(int cx, int cy, int radius)

============================================================================
NAME
	polygon - draw a polygon of 3 or more points

SYNTAX
	int polygon(int *coordinates, int color)

DESCRIPTION
	coordinates should be in the form:
	({ x1, y1, x2, y2, ... , xn, yn })

	For the polygon to be closed, you should have xn=x1, yn=y1.

============================================================================
NAME
	fill - recursively fill an area with a color

SYNTAX
	int fill(int x, int y [, int color] )

============================================================================
NAME
	query_color - find {red,green,blue} breakdown of a color

SYNTAX
	int *query_color(int color_index)

DESCRIPTION
	Returns ({ red, green, blue }) of color

============================================================================
NAME
	query_pixel - find color of a pixel

DESCRIPTION
	int query_pixel(int x, int y)

DESCRIPTION
	Returns the color index used at pixel (x,y).

============================================================================
	
