lib/vGfx.c File Reference

#include "common.h"
#include "vGfx.h"

Include dependency graph for vGfx.c:

Go to the source code of this file.

Functions

void vgClose (struct vGfx **pVg)
vGfxvgHalfInit (int width, int height)
int vgFindRgb (struct vGfx *vg, struct rgbColor *rgb)
Color vgContrastingColor (struct vGfx *vg, int backgroundIx)

Variables

static char const rcsid [] = "$Id: vGfx.c,v 1.6 2006/06/23 23:45:02 kent Exp $"


Function Documentation

void vgClose ( struct vGfx **  pVg  ) 

Definition at line 13 of file vGfx.c.

References vGfx::close, vGfx::data, and freez().

00015 {
00016 struct vGfx *vg = *pVg;
00017 if (vg != NULL)
00018     {
00019     vg->close(&vg->data);
00020     freez(pVg);
00021     }
00022 }

Here is the call graph for this function:

Color vgContrastingColor ( struct vGfx vg,
int  backgroundIx 
)

Definition at line 40 of file vGfx.c.

References rgbColor::b, rgbColor::g, MG_BLACK, MG_WHITE, rgbColor::r, and vgColorIxToRgb.

00043 {
00044 struct rgbColor c = vgColorIxToRgb(vg, backgroundIx);
00045 int val = (int)c.r + c.g + c.g + c.b;
00046 if (val > 512)
00047     return MG_BLACK;
00048 else
00049     return MG_WHITE;
00050 }

int vgFindRgb ( struct vGfx vg,
struct rgbColor rgb 
)

Definition at line 34 of file vGfx.c.

References rgbColor::b, rgbColor::g, rgbColor::r, and vgFindColorIx.

00036 {
00037 return vgFindColorIx(vg, rgb->r, rgb->g, rgb->b);
00038 }

struct vGfx* vgHalfInit ( int  width,
int  height 
) [read]

Definition at line 24 of file vGfx.c.

References AllocVar, vGfx::height, and vGfx::width.

Referenced by vgOpenGif(), and vgOpenPostScript().

00026 {
00027 struct vGfx *vg;
00028 AllocVar(vg);
00029 vg->width = width;
00030 vg->height = height;
00031 return vg;
00032 }

Here is the caller graph for this function:


Variable Documentation

char const rcsid[] = "$Id: vGfx.c,v 1.6 2006/06/23 23:45:02 kent Exp $" [static]

Definition at line 8 of file vGfx.c.


Generated on Tue Dec 25 20:21:06 2007 for blat by  doxygen 1.5.2