- Main Page
- Modules
- Files
- Related Pages

# g2_gd_P.h

    00001 /*****************************************************************************
    00002 **  Copyright (C) 1998-2001  Ljubomir Milanovic & Horst Wagner
    00003 **  This file is part of the g2 library
    00004 **
    00005 **  This library is free software; you can redistribute it and/or
    00006 **  modify it under the terms of the GNU Lesser General Public
    00007 **  License as published by the Free Software Foundation; either
    00008 **  version 2.1 of the License, or (at your option) any later version.
    00009 **
    00010 **  This library is distributed in the hope that it will be useful,
    00011 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 **  Lesser General Public License for more details.
    00014 **
    00015 **  You should have received a copy of the GNU Lesser General Public
    00016 **  License along with this library; if not, write to the Free Software
    00017 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 ******************************************************************************/
    00019 #ifndef _G2_GD_P_H
    00020 #define _G2_GD_P_H
    00021
    00022 #include <gd.h>
    00023 #include <gdfontt.h>
    00024 #include <gdfonts.h>
    00025 #include <gdfontmb.h>
    00026 #include <gdfontl.h>
    00027 #include <gdfontg.h>
    00028 #include "g2_config.h"
    00029 #include "g2_gd.h"
    00030
    00031  static unsigned short g2_Basic_Colors[32][3] = {
    00032  {65535,65535,65535},{0,0,0},
    00033  {44461,55512,59110},{0,65535,65535},{0,0,65535},
    00034  {0,0,32896},{61166,33410,61166},
    00035  {65535,0,65535},{41120,8224,61680},{65535,49344,52171},
    00036  {61680,59110,35980},{32639,65535,54484},
    00037  {39064,64507,39064},{0,65535,0},{12850,52685,12850},
    00038  {39578,52685,12850},{44461,65535,12079},{65535,65535,0},
    00039  {65535,55255,0},{61166,56797,33410},{56026,42405,8224},{47288,34438,2827},
    00040  {42405,10794,10794},{53970,26985,7710},
    00041  {52685,34181,16191},{65535,32639,20560},
    00042  {61680,32896,32896},{64250,32896,29298},
    00043  {65535,35980,0},{65535,42405,0},{65535,17733,0},
    00044  {65535,0,0}};
    00045
    00046
    00047 typedef struct g2_gd_STRUCT {
    00048         int height;
    00049         int width;
    00050         FILE *f;
    00051         gdImagePtr im;
    00052         gdImagePtr brush;
    00053         int LineWidth;
    00054         int NoOfInks;
    00055         int Inks[256];
    00056         int CurCol;
    00057         int OldCol;
    00058         int BackCol;
    00059         gdFontPtr FontSize;
    00060         enum g2_gd_type gd_type;
    00061         } g2_gd_STRUCT;
    00062
    00063
    00064
    00065 int g2_gd_init_gd(int pid, void *pdp, int vid, int width,int height);
    00066 int g2_gd_init_gdX(int pid, void *pdp,
    00067                      int width, int height,
    00068                      int xposition, int yposition,
    00069                      char *windowname, char *iconname,
    00070                      char *icondata, int iconwidth, int iconheight);
    00071 int g2_gd_Delete(int pid, void *pdp);
    00072 int g2_gd_Clear(int pid, void *pdp);
    00073 int g2_gd_Flush(int pid, void *pdp);
    00074 int g2_gd_Ink(int pid, void *pdp,
    00075                double red, double green, double blue);
    00076 int g2_gd_ClearPalette(int pid, void *pdp);
    00077 int g2_gd_ResetPalette(int pid, void *pdp);
    00078 int g2_gd_SetBackground(int pid, void *pdp, int color);
    00079 int g2_gd_Pen(int pid, void *pdp, int color);
    00080 int g2_gd_Paper(int pid, void *pdp, int color);
    00081 int g2_gd_SetLineWidth(int pid, void *pdp, int w);
    00082 int g2_gd_SetDash(int pid, void *pdp, int n, char *data);
    00083 int g2_gd_SetFontSize(int pid, void *pdp, int size);
    00084 int g2_gd_Plot(int pid, void *pdp, int x, int y);
    00085 int g2_gd_Line(int pid, void *pdp, int x1, int y1, int x2, int y2);
    00086 int g2_gd_PolyLine(int pid, void *pdp, int N, int *p);
    00087 int g2_gd_Polygon(int pid, void *pdp, int N, int *p);
    00088 int g2_gd_FilledPolygon(int pid, void *pdp, int N, int *p);
    00089 int g2_gd_Triangle(int pid, void *pdp,
    00090                     int x1, int y1,
    00091                     int x2, int y2,
    00092                     int x3, int y3);
    00093 int g2_gd_FilledTriangle(int pid, void *pdp, int x1, int y1,
    00094                            int x2, int y2,
    00095                            int x3, int y3);
    00096 int g2_gd_Rectangle(int pid, void *pdp, int x1, int y1, int x2, int y2);
    00097 int g2_gd_FilledRectangle(int pid, void *pdp,
    00098                             int x1, int y1, int x2, int y2);
    00099 int g2_gd_Circle(int pid, void *pdp, int x, int y, int r);
    00100 int g2_gd_FilledCircle(int pid, void *pdp, int x, int y, int r);
    00101 int g2_gd_Arc(int pid, void *pdp, int x, int y,
    00102                int r1, int r2, double a1, double a2);
    00103 int g2_gd_FilledArc(int pid, void *pdp, int x, int y,
    00104                       int r1, int r2, double a1, double a2);
    00105 int g2_gd_Ellipse(int pid, void *pdp, int x, int y, int r1, int r2);
    00106 int g2_gd_FilledEllipse(int pid, void *pdp, int x, int y, int r1, int r2);
    00107 int g2_gd_DrawString(int pid, void *pdp, int x, int y, const char *text);
    00108
    00109 int g2_gd_AllocateBasicColors(int pid, void *pdp);
    00110
    00111 #endif /* _G2_GD_P_H */