MIDAS
Loading...
Searching...
No Matches
mgd.h
Go to the documentation of this file.
1#ifndef GD_H
2#define GD_H 1
3
7/* gd.h: declarations file for the gifdraw module.
8
9 Written by Tom Boutell, 5/94.
10 Copyright 1994, Cold Spring Harbor Labs.
11 Permission granted to use this code in any fashion provided
12 that this notice is retained and any alterations are
13 labeled as such. It is requested, but not required, that
14 you share extensions to this module with us so that we
15 can incorporate them into new versions. */
16
17/* stdio is needed for file I/O. */
18#include <stdio.h>
19
20/* This can't be changed, it's part of the GIF specification. */
21
22#define gdMaxColors 256
23
24/* Image type. See functions below; you will not need to change
25 the elements directly. Use the provided macros to
26 access sx, sy, the color table, and colorsTotal for
27 read-only purposes. */
28
50
52
53typedef struct gdGifBufferStruct {
54 char *data;
55 int size;
57
58typedef struct {
59 /* # of characters in font */
60 int nchars;
61 /* First character is numbered... (usually 32 = space) */
62 int offset;
63 /* Character width and height */
64 int w;
65 int h;
66 /* Font data; array of characters, one row after another.
67 Easily included in code, also easily loaded from
68 data files. */
69 int *data;
70} gdFont;
71
72/* Text functions take these. */
74
75/* Fonts defined in mgd.c */
79
80/* For backwards compatibility only. Use gdImageSetStyle()
81 for MUCH more flexible line drawing. Also see
82 gdImageSetBrush(). */
83#define gdDashSize 4
84
85/* Special colors. */
86
87#define gdStyled (-2)
88#define gdBrushed (-3)
89#define gdStyledBrushed (-4)
90#define gdTiled (-5)
91
92/* NOT the same as the transparent color index.
93 This is used in line styles only. */
94#define gdTransparent (-6)
95
96/* Functions to manipulate images. */
97
98gdImagePtr gdImageCreate(int sx, int sy);
101void gdImageSetPixel(gdImagePtr im, int x, int y, int color);
102int gdImageGetPixel(gdImagePtr im, int x, int y);
103void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
104/* For backwards compatibility only. Use gdImageSetStyle()
105 for much more flexible line drawing. */
106void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
107/* Corners specified (not width and height). Upper left first, lower right
108 second. */
109void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
110/* Solid bar. Upper left corner first, lower right corner second. */
111void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color);
112int gdImageBoundsSafe(gdImagePtr im, int x, int y);
113void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color);
114void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, char c, int color);
115void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, const char *s, int color);
116void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, const char *s, int color);
117
118/* Point type for use in polygon drawing. */
119
120typedef struct {
121 int x, y;
123
124void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c);
126
127int gdImageColorAllocate(gdImagePtr im, int r, int g, int b);
128int gdImageColorClosest(gdImagePtr im, int r, int g, int b);
129int gdImageColorExact(gdImagePtr im, int r, int g, int b);
132void gdImageGif(gdImagePtr im, gdGifBuffer * buffer);
133void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color);
134void gdImageFill(gdImagePtr im, int x, int y, int color);
135void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY,
136 int w, int h);
137/* Stretches or shrinks to fit, as needed */
138void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX,
139 int srcY, int dstW, int dstH, int srcW, int srcH);
142void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels);
143/* On or off (1 or 0) */
145
146/* Macros to access information about images. READ ONLY. Changing
147 these values will NOT have the desired result. */
148#define gdImageSX(im) ((im)->sx)
149#define gdImageSY(im) ((im)->sy)
150#define gdImageColorsTotal(im) ((im)->colorsTotal)
151#define gdImageRed(im, c) ((im)->red[(c)])
152#define gdImageGreen(im, c) ((im)->green[(c)])
153#define gdImageBlue(im, c) ((im)->blue[(c)])
154#define gdImageGetTransparent(im) ((im)->transparent)
155#define gdImageGetInterlaced(im) ((im)->interlace)
156#endif
int offset
Definition mgd.h:62
void gdImageSetTile(gdImagePtr im, gdImagePtr tile)
void gdImageFilledPolygon(gdImagePtr im, gdPointPtr p, int n, int c)
Definition mgd.cxx:2471
void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition mgd.cxx:2299
void gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int dstW, int dstH, int srcW, int srcH)
Definition mgd.cxx:2366
gdImagePtr gdImageCreate(int sx, int sy)
Definition mgd.cxx:417
void gdImageCharUp(gdImagePtr im, gdFontPtr f, int x, int y, char c, int color)
Definition mgd.cxx:854
struct gdImageStruct * brush
Definition mgd.h:41
void gdImageString(gdImagePtr im, gdFontPtr f, int x, int y, const char *s, int color)
Definition mgd.cxx:877
void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition mgd.cxx:2307
void gdImageSetBrush(gdImagePtr im, gdImagePtr brush)
Definition mgd.cxx:2596
void gdImageLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition mgd.cxx:638
int red[gdMaxColors]
Definition mgd.h:34
gdImagePtr gdImageCreateFromGif(FILE *fd)
Definition mgd.cxx:1888
int * style
Definition mgd.h:47
int x
Definition mgd.h:121
void gdImageColorDeallocate(gdImagePtr im, int color)
Definition mgd.cxx:527
char * data
Definition mgd.h:54
int w
Definition mgd.h:64
void gdImageStringUp(gdImagePtr im, gdFontPtr f, int x, int y, const char *s, int color)
Definition mgd.cxx:888
int gdImageGetPixel(gdImagePtr im, int x, int y)
Definition mgd.cxx:627
#define gdMaxColors
Definition mgd.h:22
int nchars
Definition mgd.h:60
unsigned char ** pixels
Definition mgd.h:30
int blue[gdMaxColors]
Definition mgd.h:36
void gdImageDestroy(gdImagePtr im)
Definition mgd.cxx:439
gdFontPtr gdFontMediumBold
Definition mgd.cxx:408
int open[gdMaxColors]
Definition mgd.h:37
int h
Definition mgd.h:65
int stylePos
Definition mgd.h:46
gdFont * gdFontPtr
Definition mgd.h:73
int tileColorMap[gdMaxColors]
Definition mgd.h:44
int polyAllocated
Definition mgd.h:40
int interlace
Definition mgd.h:48
void gdImageFillToBorder(gdImagePtr im, int x, int y, int border, int color)
Definition mgd.cxx:899
gdFontPtr gdFontGiant
Definition mgd.cxx:409
int gdImageColorExact(gdImagePtr im, int r, int g, int b)
Definition mgd.cxx:478
int gdImageColorClosest(gdImagePtr im, int r, int g, int b)
Definition mgd.cxx:455
struct gdImageStruct * tile
Definition mgd.h:42
int sy
Definition mgd.h:32
int gdImageBoundsSafe(gdImagePtr im, int x, int y)
Definition mgd.cxx:826
struct gdGifBufferStruct gdGifBuffer
void gdImagePolygon(gdImagePtr im, gdPointPtr p, int n, int c)
Definition mgd.cxx:2451
int styleLength
Definition mgd.h:45
void gdImageGif(gdImagePtr im, gdGifBuffer *buffer)
Definition mgd.cxx:1118
void gdImageDashedLine(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Definition mgd.cxx:738
void gdImageSetStyle(gdImagePtr im, int *style, int noOfPixels)
Definition mgd.cxx:2584
struct gdImageStruct gdImage
struct gdPoint * gdPointPtr
int gdImageColorAllocate(gdImagePtr im, int r, int g, int b)
Definition mgd.cxx:492
int * polyInts
Definition mgd.h:39
int sx
Definition mgd.h:31
void gdImageCopy(gdImagePtr dst, gdImagePtr src, int dstX, int dstY, int srcX, int srcY, int w, int h)
Definition mgd.cxx:2317
void gdImageInterlace(gdImagePtr im, int interlaceArg)
Definition mgd.cxx:2619
int brushColorMap[gdMaxColors]
Definition mgd.h:43
int green[gdMaxColors]
Definition mgd.h:35
gdFontPtr gdFontSmall
Definition mgd.cxx:410
int transparent
Definition mgd.h:38
void gdImageFill(gdImagePtr im, int x, int y, int color)
Definition mgd.cxx:964
int colorsTotal
Definition mgd.h:33
void gdImageColorTransparent(gdImagePtr im, int color)
Definition mgd.cxx:533
void gdImageChar(gdImagePtr im, gdFontPtr f, int x, int y, int c, int color)
Definition mgd.cxx:831
void gdImageSetPixel(gdImagePtr im, int x, int y, int color)
Definition mgd.cxx:538
int * data
Definition mgd.h:69
gdImage * gdImagePtr
Definition mgd.h:51
DWORD n[4]
Definition mana.cxx:247
char color[][16]
Definition mchart.cxx:32
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
Definition mgd.h:58
Definition mgd.h:120
char c
Definition system.cxx:1310