LibGd 2.4.0-dev
GD Graphics library
Loading...
Searching...
No Matches
gd_vector2d_private.h
1#ifndef GD_VECTOR2D_PRIVATE_H
2#define GD_VECTOR2D_PRIVATE_H
3
4#include "gd_array.h"
5#include "gd_vector2d.h"
6
7#if defined(__GNUC__) && !defined(_WIN32)
8#define GD_VECTOR2D_INTERNAL __attribute__((visibility("hidden")))
9#else
10#define GD_VECTOR2D_INTERNAL
11#endif
12
13typedef enum {
14 GD_SURFACE_NONE,
15 GD_SURFACE_ARGB32,
16 GD_SURFACE_XRGB32,
17 GD_SURFACE_A8,
18 GD_SURFACE_COUNT
19} gdSurfaceType;
20typedef struct gdSurfaceStruct {
21 int ref;
22 unsigned char *data;
23 gdSurfaceType type;
24 int gdOwned;
25 int width, height, stride;
26} gdSurface;
27typedef gdSurface *gdSurfacePtr;
28
29typedef struct gdSpanStruct {
30 short x, y;
31 unsigned short len;
32 unsigned char coverage;
33} gdSpan;
34typedef gdSpan *gdSpanPtr;
35typedef struct gdSpanRleStruct {
36 int ref;
37 struct {
38 gdSpanPtr data;
39 int size, capacity;
40 } spans;
41 int x, y, w, h;
42} gdSpanRle;
43typedef gdSpanRle *gdSpanRlePtr;
44
45typedef enum {
46 gdPaintTypeColor,
47 gdPaintTypeGradient,
48 gdPaintTypeSurface,
49 gdPaintTypePattern
50} gdPaintType;
51typedef struct gdColorStruct {
52 double r, g, b, a;
53} gdColor;
54typedef gdColor *gdColorPtr;
55struct gdPathPatternStruct {
56 int ref;
57 gdExtendMode extend;
58 gdPatternFilter filter;
59 gdSurfacePtr surface;
60 gdPathMatrix matrix;
61 double opacity;
62};
63typedef struct gdGradientStruct gdGradient;
64struct gdPaintStruct {
65 int ref;
66 gdPaintType type;
67 union {
68 gdColorPtr color;
69 gdSurfacePtr surface;
70 gdPathPatternPtr pattern;
71 gdGradient *gradient;
72 };
73};
74typedef struct gdPathDashStruct {
75 double *data;
76 int size;
77 double offset;
78} gdPathDash;
79typedef gdPathDash *gdPathDashPtr;
80typedef struct gdStrokeStruct {
81 double width, miterlimit;
82 gdLineCap cap;
83 gdLineJoin join;
84 gdPathDashPtr dash;
85} gdStroke;
86typedef gdStroke *gdStrokePtr;
87typedef struct gdStateStruct {
88 gdSpanRlePtr clippath;
89 gdPaintPtr source;
90 gdFontFacePtr font_face;
91 gdPathMatrix matrix;
92 gdFillRule winding;
93 gdStroke stroke;
95 gdPatternFilter pattern_filter;
96 double opacity;
97 double font_size;
98 struct gdStateStruct *next;
99} gdState;
100typedef gdState *gdStatePtr;
101typedef enum {
102 gdPathOpsMoveTo,
103 gdPathOpsLineTo,
104 gdPathOpsCubicTo,
105 gdPathOpsQuadTo,
106 gdPathOpsClose
107} gdPathOps;
108typedef gdPathOps *gdPathOpsPtr;
109struct gdPathStruct {
110 int ref, contours;
111 gdPointF start;
112 gdArray elements;
113 gdArray points;
114};
115struct gdContextStruct {
116 int ref;
117 gdSurfacePtr surface;
118 gdPathPtr path;
119 gdStatePtr state;
120 gdSpanRlePtr rle, clippath;
121 gdRectF clip;
122 gdImagePtr image;
123 int imageOwned;
124};
125
126GD_VECTOR2D_INTERNAL gdSurfacePtr gdSurfaceCreate(int width, int height, unsigned int type);
127GD_VECTOR2D_INTERNAL gdSurfacePtr gdSurfaceCreateForData(unsigned char *data, int width, int height,
128 int stride, unsigned int type);
129GD_VECTOR2D_INTERNAL gdSurfacePtr gdSurfaceAddRef(gdSurfacePtr surface);
130GD_VECTOR2D_INTERNAL void gdSurfaceDestroy(gdSurfacePtr surface);
131GD_VECTOR2D_INTERNAL gdContextPtr gdContextCreate(gdSurfacePtr surface);
132GD_VECTOR2D_INTERNAL gdPathPatternPtr gdPathPatternCreate(gdSurfacePtr surface);
133GD_VECTOR2D_INTERNAL void gdContextSetSourceSurface(gdContextPtr context, gdSurfacePtr surface,
134 double x, double y);
135GD_VECTOR2D_INTERNAL gdPathPtr gdPathStrokeToPath(const gdPathPtr path, const gdStrokePtr stroke,
136 const gdPathMatrixPtr matrix);
137
138#endif
gdContext * gdContextPtr
Opaque 2D drawing context pointer.
Definition gd_vector2d.h:44
gdPaint * gdPaintPtr
Opaque paint source pointer.
Definition gd_vector2d.h:86
gdLineJoin
Definition gd_vector2d.h:210
gdCompositeOperator
Definition gd_vector2d.h:255
gdPathPattern * gdPathPatternPtr
Opaque image pattern pointer.
Definition gd_vector2d.h:106
gdPatternFilter
Definition gd_vector2d.h:241
gdLineCap
Definition gd_vector2d.h:196
gdFontFace * gdFontFacePtr
Opaque font face pointer.
Definition gd_vector2d.h:126
gdFillRule
Definition gd_vector2d.h:224
gdExtendMode
Definition gd_vector2d.h:181
Affine transformation matrix.
Definition gd_vector2d.h:139
Defines a point in a 2D coordinate system using floating point values.
Definition gd.h:518
Floating-point rectangle.
Definition gd_vector2d.h:160