gdc.h File Reference

#include <math.h>
#include "gd.h"
#include "gdfonts.h"
#include "gdfontt.h"
#include "gdfontmb.h"
#include "gdfontg.h"
#include "gdfontl.h"

Go to the source code of this file.

Defines

#define TRUE   1
#define FALSE   0
#define GDC_NOVALUE   -MAXFLOAT
#define GDC_NULL   GDC_NOVALUE
#define ABS(x)   ( (x)<0.0? -(x): (x) )
#define MAX(x, y)   ( (x)>(y)?(x):(y) )
#define MIN(x, y)   ( (x)<(y)?(x):(y) )
#define GDC_NOCOLOR   0x1000000L
#define GDC_DFLTCOLOR   0x2000000L
#define PVRED   0x00FF0000
#define PVGRN   0x0000FF00
#define PVBLU   0x000000FF
#define l2gdcal(c)   ((c)&PVRED)>>16 , ((c)&PVGRN)>>8 , ((c)&0x000000FF)
#define l2gdshd(c)   (((c)&PVRED)>>16)/2 , (((c)&PVGRN)>>8)/2 , (((c)&0x000000FF))/2
#define _gdcntrst(bg)
#define _clrallocate(im, rawclr, bgc)
#define _clrshdallocate(im, rawclr, bgc)
#define EXTERND   extern
#define DEFAULTO(val)
#define EXTERND   extern

Enumerations

enum  GDC_font_size {
  GDC_pad = 0, GDC_TINY = 1, GDC_SMALL = 2, GDC_MEDBOLD = 3,
  GDC_LARGE = 4, GDC_GIANT = 5, GDC_numfonts = 6
}
enum  GDC_HOLD_IMAGE_T { GDC_DESTROY_IMAGE = 0, GDC_EXPOSE_IMAGE = 1, GDC_REUSE_IMAGE = 2 }

Functions

void GDC_destroy_image (void *)
void out_err (int GIFWIDTH, int GIFHEIGHT, FILE *, unsigned long BGColor, unsigned long LineColor, char *str)

Variables

static int _gdccfoo1
static unsigned long _gdccfoo2
char GDC_generate_gif
GDC_HOLD_IMAGE_T GDC_hold_img
void * GDC_image


Define Documentation

#define _clrallocate ( im,
rawclr,
bgc   ) 

Value:

Definition at line 44 of file gdc.h.

#define _clrshdallocate ( im,
rawclr,
bgc   ) 

Value:

Definition at line 51 of file gdc.h.

#define _gdcntrst ( bg   ) 

Value:

( ((bg)&0x800000?0x000000:0xFF0000)|    \
                                                          ((bg)&0x008000?0x000000:0x00FF00)|    \
                                                          ((bg)&0x000080?0x000000:0x0000FF) )

Definition at line 41 of file gdc.h.

#define ABS (  )     ( (x)<0.0? -(x): (x) )

Definition at line 28 of file gdc.h.

Referenced by draw_3d_area(), out_graph(), and pie_gif().

#define DEFAULTO ( val   ) 

Definition at line 96 of file gdc.h.

#define EXTERND   extern

Definition at line 103 of file gdc.h.

#define EXTERND   extern

Definition at line 103 of file gdc.h.

#define FALSE   0

Definition at line 22 of file gdc.h.

#define GDC_DFLTCOLOR   0x2000000L

Definition at line 33 of file gdc.h.

#define GDC_NOCOLOR   0x1000000L

Definition at line 32 of file gdc.h.

Referenced by pie_gif().

#define GDC_NOVALUE   -MAXFLOAT

Definition at line 25 of file gdc.h.

Referenced by main(), and out_graph().

#define GDC_NULL   GDC_NOVALUE

Definition at line 26 of file gdc.h.

#define l2gdcal (  )     ((c)&PVRED)>>16 , ((c)&PVGRN)>>8 , ((c)&0x000000FF)

Definition at line 37 of file gdc.h.

Referenced by out_err(), and out_graph().

#define l2gdshd (  )     (((c)&PVRED)>>16)/2 , (((c)&PVGRN)>>8)/2 , (((c)&0x000000FF))/2

Definition at line 38 of file gdc.h.

#define MAX ( x,
 )     ( (x)>(y)?(x):(y) )

Definition at line 29 of file gdc.h.

Referenced by cnt_nl(), out_graph(), and pie_gif().

#define MIN ( x,
 )     ( (x)<(y)?(x):(y) )

Definition at line 30 of file gdc.h.

Referenced by draw_3d_bar(), out_graph(), and pie_gif().

#define PVBLU   0x000000FF

Definition at line 36 of file gdc.h.

#define PVGRN   0x0000FF00

Definition at line 35 of file gdc.h.

#define PVRED   0x00FF0000

Definition at line 34 of file gdc.h.

#define TRUE   1

Definition at line 21 of file gdc.h.


Enumeration Type Documentation

enum GDC_font_size

Enumerator:
GDC_pad 
GDC_TINY 
GDC_SMALL 
GDC_MEDBOLD 
GDC_LARGE 
GDC_GIANT 
GDC_numfonts 

Definition at line 60 of file gdc.h.

00060                    { GDC_pad     = 0,
00061                                          GDC_TINY    = 1,
00062                                          GDC_SMALL   = 2,
00063                                          GDC_MEDBOLD = 3,
00064                                          GDC_LARGE   = 4,
00065                                          GDC_GIANT   = 5,
00066                                          GDC_numfonts= 6 };             /* GDC[PIE]_fontc depends on this */

enum GDC_HOLD_IMAGE_T

Enumerator:
GDC_DESTROY_IMAGE 
GDC_EXPOSE_IMAGE 
GDC_REUSE_IMAGE 

Definition at line 68 of file gdc.h.

00068              {
00069                          GDC_DESTROY_IMAGE = 0,                 /* default */
00070                          GDC_EXPOSE_IMAGE  = 1,                 /* user must call GDC_destroy_image() */
00071                          GDC_REUSE_IMAGE   = 2                  /* i.e., paint on top of */
00072                          } GDC_HOLD_IMAGE_T;                    /* EXPOSE & REUSE */


Function Documentation

void GDC_destroy_image ( void *   ) 

Definition at line 128 of file gdc.cpp.

References gdImageDestroy().

00129 {
00130         if( im )
00131                 gdImageDestroy( (gdImagePtr)im );
00132 }

void out_err ( int  GIFWIDTH,
int  GIFHEIGHT,
FILE *  ,
unsigned long  BGColor,
unsigned long  LineColor,
char *  str 
)

Definition at line 136 of file gdc.cpp.

References GDC_EXPOSE_IMAGE, GDC_fontc, GDC_generate_gif, GDC_hold_img, GDC_image, GDC_MEDBOLD, GDC_REUSE_IMAGE, gdFontMediumBold, gdImageColorAllocate(), gdImageCreate(), gdImageDestroy(), gdImageGif(), gdImageString(), and l2gdcal.

Referenced by out_graph().

00142 {
00143 
00144         gdImagePtr      im;
00145         int                     lineclr;
00146         int                     bgclr;
00147 
00148 
00149         if( (GDC_hold_img & GDC_REUSE_IMAGE) &&
00150                 GDC_image != (void*)NULL )
00151                 im = (gdImage *) GDC_image;
00152         else
00153                 im = gdImageCreate( GIFWIDTH, GIFHEIGHT );
00154 
00155         bgclr    = gdImageColorAllocate( im, l2gdcal(BGColor) );
00156         lineclr  = gdImageColorAllocate( im, l2gdcal(LineColor) );
00157 
00158         gdImageString( im,
00159                                    gdFontMediumBold,
00160                                    GIFWIDTH/2 - GDC_fontc[GDC_MEDBOLD].w*strlen((const char *)err_str)/2,
00161                                    GIFHEIGHT/3,
00162                                    (unsigned char *) err_str,
00163                                    lineclr );
00164 
00165         /* usually GDC_generate_gif is used in conjunction with hard or hold options */
00166         if( GDC_generate_gif )
00167                 {
00168                 fflush(fptr);                   // clear anything buffered 
00169                 gdImageGif(im, fptr);
00170                 }
00171 
00172         if( GDC_hold_img & GDC_EXPOSE_IMAGE )
00173                 GDC_image = (void*)im;
00174         else
00175                 gdImageDestroy(im);
00176         return;
00177 }


Variable Documentation

int _gdccfoo1 [static]

Definition at line 39 of file gdc.h.

unsigned long _gdccfoo2 [static]

Definition at line 40 of file gdc.h.

char GDC_generate_gif

Referenced by out_err(), and out_graph().

GDC_HOLD_IMAGE_T GDC_hold_img

Referenced by out_err(), and out_graph().

void* GDC_image

Referenced by out_err(), and out_graph().


Generated on Sat Dec 15 00:01:27 2007 for BulmaGes by  doxygen 1.5.1