#include "memgfx.h"#include "hash.h"Include dependency graph for vGfx.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Data Structures | |
| struct | vGfx |
Defines | |
| #define | vgDot(v, x, y, color) v->dot(v->data,x,y,color) |
| #define | vgGetDot(v, x, y) v->getDot(v->data,x,y) |
| #define | vgBox(v, x, y, width, height, color) v->box(v->data,x,y,width,height,color) |
| #define | vgLine(v, x1, y1, x2, y2, color) v->line(v->data,x1,y1,x2,y2,color) |
| #define | vgText(v, x, y, color, font, string) v->text(v->data,x,y,color,font,string) |
| #define | vgTextRight(v, x, y, width, height, color, font, string) v->textRight(v->data,x,y,width,height,color,font,string) |
| #define | vgTextCentered(v, x, y, width, height, color, font, string) v->textCentered(v->data,x,y,width,height,color,font,string) |
| #define | vgFindColorIx(v, r, g, b) v->findColorIx(v->data, r, g, b) |
| #define | vgColorIxToRgb(v, colorIx) v->colorIxToRgb(v->data, colorIx) |
| #define | vgSetClip(v, x, y, width, height) v->setClip(v->data, x, y, width, height) |
| #define | vgUnclip(v) v->unclip(v->data); |
| #define | vgVerticalSmear(v, x, y, w, h, dots, zeroClear) v->verticalSmear(v->data,x,y,w,h,dots,zeroClear) |
| #define | vgFillUnder(v, x1, y1, x2, y2, bottom, color) v->fillUnder(v->data,x1,y1,x2,y2,bottom,color) |
| #define | vgDrawPoly(v, poly, color, filled) v->drawPoly(v->data,poly,color,filled) |
| #define | vgSetHint(v, hint, value) v->setHint(v->data,hint,value) |
| #define | vgGetHint(v, hint) v->getHint(v->data,hint) |
Functions | |
| vGfx * | vgOpenGif (int width, int height, char *fileName) |
| vGfx * | vgOpenPostScript (int width, int height, char *fileName) |
| void | vgClose (struct vGfx **pVg) |
| int | vgFindRgb (struct vGfx *vg, struct rgbColor *rgb) |
| Color | vgContrastingColor (struct vGfx *vg, int backgroundIx) |
| #define vgBox | ( | v, | |||
| x, | |||||
| y, | |||||
| width, | |||||
| height, | |||||
| color | ) | v->box(v->data,x,y,width,height,color) |
| #define vgColorIxToRgb | ( | v, | |||
| colorIx | ) | v->colorIxToRgb(v->data, colorIx) |
| #define vgDrawPoly | ( | v, | |||
| poly, | |||||
| color, | |||||
| filled | ) | v->drawPoly(v->data,poly,color,filled) |
| #define vgFillUnder | ( | v, | |||
| x1, | |||||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| bottom, | |||||
| color | ) | v->fillUnder(v->data,x1,y1,x2,y2,bottom,color) |
| #define vgFindColorIx | ( | v, | |||
| r, | |||||
| g, | |||||
| b | ) | v->findColorIx(v->data, r, g, b) |
| #define vgLine | ( | v, | |||
| x1, | |||||
| y1, | |||||
| x2, | |||||
| y2, | |||||
| color | ) | v->line(v->data,x1,y1,x2,y2,color) |
| #define vgSetClip | ( | v, | |||
| x, | |||||
| y, | |||||
| width, | |||||
| height | ) | v->setClip(v->data, x, y, width, height) |
| #define vgSetHint | ( | v, | |||
| hint, | |||||
| value | ) | v->setHint(v->data,hint,value) |
| #define vgText | ( | v, | |||
| x, | |||||
| y, | |||||
| color, | |||||
| font, | |||||
| string | ) | v->text(v->data,x,y,color,font,string) |
| #define vgTextCentered | ( | v, | |||
| x, | |||||
| y, | |||||
| width, | |||||
| height, | |||||
| color, | |||||
| font, | |||||
| string | ) | v->textCentered(v->data,x,y,width,height,color,font,string) |
| #define vgTextRight | ( | v, | |||
| x, | |||||
| y, | |||||
| width, | |||||
| height, | |||||
| color, | |||||
| font, | |||||
| string | ) | v->textRight(v->data,x,y,width,height,color,font,string) |
| 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:

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 }
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* vgOpenGif | ( | int | width, | |
| int | height, | |||
| char * | fileName | |||
| ) | [read] |
Definition at line 33 of file vGif.c.
References AllocVar, cloneString(), vGfx::close, vGfx::data, freez(), gif, memGifClose(), mgClearPixels(), mgNew(), vgHalfInit(), and vgMgMethods().
00035 { 00036 struct memGif *gif; 00037 struct memGfx *mg; 00038 struct vGfx *vg; 00039 00040 /* Set up virtual graphics with memory methods. */ 00041 vg = vgHalfInit(width, height); 00042 vgMgMethods(vg); 00043 vg->close = (vg_close)memGifClose; 00044 00045 /* Get our mg + fileName structure. We're forcing 00046 * inheritence from mg essentially. */ 00047 AllocVar(gif); 00048 gif->fileName = cloneString(fileName); 00049 00050 /* Fill in the mg part of this structure with normal memGfx. */ 00051 mg = mgNew(width, height); 00052 mgClearPixels(mg); 00053 gif->mg = *mg; 00054 freez(&mg); /* We don't need this copy any more. */ 00055 00056 vg->data = gif; 00057 return vg; 00058 }
Here is the call graph for this function:

| struct vGfx* vgOpenPostScript | ( | int | width, | |
| int | height, | |||
| char * | fileName | |||
| ) | [read] |
Definition at line 384 of file pscmGfx.c.
References vGfx::box, vGfx::close, vGfx::colorIxToRgb, vGfx::data, vGfx::dot, vGfx::drawPoly, vGfx::fillUnder, vGfx::findColorIx, vGfx::getHint, vGfx::line, pscmBox(), pscmClose(), pscmColorIxToRgb(), pscmDot(), pscmDrawPoly(), pscmFillUnder(), pscmFindColorIx(), pscmGetHint(), pscmLine(), pscmOpen(), pscmSetClip(), pscmSetHint(), pscmText(), pscmTextCentered(), pscmTextRight(), pscmUnclip(), pscmVerticalSmear(), vGfx::setClip, vGfx::setHint, vGfx::text, vGfx::textCentered, vGfx::textRight, vGfx::unclip, vGfx::verticalSmear, vg_colorIxToRgb, and vgHalfInit().
00386 { 00387 struct vGfx *vg = vgHalfInit(width, height); 00388 vg->data = pscmOpen(width, height, fileName); 00389 vg->close = (vg_close)pscmClose; 00390 vg->dot = (vg_dot)pscmDot; 00391 vg->box = (vg_box)pscmBox; 00392 vg->line = (vg_line)pscmLine; 00393 vg->text = (vg_text)pscmText; 00394 vg->textRight = (vg_textRight)pscmTextRight; 00395 vg->textCentered = (vg_textCentered)pscmTextCentered; 00396 vg->findColorIx = (vg_findColorIx)pscmFindColorIx; 00397 vg->colorIxToRgb = (vg_colorIxToRgb)pscmColorIxToRgb; 00398 vg->setClip = (vg_setClip)pscmSetClip; 00399 vg->unclip = (vg_unclip)pscmUnclip; 00400 vg->verticalSmear = (vg_verticalSmear)pscmVerticalSmear; 00401 vg->fillUnder = (vg_fillUnder)pscmFillUnder; 00402 vg->drawPoly = (vg_drawPoly)pscmDrawPoly; 00403 vg->setHint = (vg_setHint)pscmSetHint; 00404 vg->getHint = (vg_getHint)pscmGetHint; 00405 return vg; 00406 }
Here is the call graph for this function:

1.5.2