Added documention for gdImageCreate() and type gdImage.

This change adds naturaldoc comments for the above function and type.
Text was adapted from the 2.0.36 manual.

It also fixes the formatting of the comment for gdInterpolationMethod
so that naturaldoc will extract it.
master
Chris Reuter 2013-11-15 23:55:28 -05:00
parent 3c1202e5bb
commit bb1d4a044e
2 changed files with 51 additions and 1 deletions

View File

@ -129,6 +129,34 @@ static void gdImageBrushApply (gdImagePtr im, int x, int y);
static void gdImageTileApply (gdImagePtr im, int x, int y);
BGD_DECLARE(int) gdImageGetTrueColorPixel (gdImagePtr im, int x, int y);
/*
Function: gdImageCreate
gdImageCreate is called to create palette-based images, with no
more than 256 colors. The image must eventually be destroyed using
gdImageDestroy().
> ... inside a function ...
> gdImagePtr im;
> im = gdImageCreate(64, 64);
> // ... Use the image ...
> gdImageDestroy(im);
Parameters:
sx - The image width.
sy - The image height.
Returns:
A pointer to the new image or NULL if an error occurred.
See Also:
<gdImageCreateTrueColor>
*/
BGD_DECLARE(gdImagePtr) gdImageCreate (int sx, int sy)
{
int i;

View File

@ -2,6 +2,7 @@
extern "C" {
#endif
#ifndef GD_H
#define GD_H 1
@ -165,7 +166,7 @@ enum gdPaletteQuantizationMethod {
* Group: Transform
*
* Constants: gdInterpolationMethod
*
* GD_BELL - Bell
* GD_BESSEL - Bessel
* GD_BILINEAR_FIXED - fixed point bilinear
@ -222,6 +223,27 @@ typedef enum {
/* Interpolation function ptr */
typedef double (* interpolation_method )(double);
/*
Group: Types
typedef: gdImage
typedef: gdImagePtr
The data structure in which gd stores images. <gdImageCreate>,
<gdImageCreateTrueColor> and the various image file-loading functions
return a pointer to this type, and the other functions expect to
receive a pointer to this type as their first argument.
*gdImagePtr* is a pointer to *gdImage*.
(Previous versions of this library encouraged directly manipulating
the contents ofthe struct but we are attempting to move away from
this practice so the fields are no longer documented here. If you
need to poke at the internals of this struct, feel free to look at
*gd.h*.)
*/
typedef struct gdImageStruct {
/* Palette-based image pixels */
unsigned char **pixels;