LibGd 2.4.0-dev
GD Graphics library
Loading...
Searching...
No Matches
gd_vector2d.h
1#ifndef GD_VECTOR2D_H
2#define GD_VECTOR2D_H
3
4#include "gd.h"
5#include <stddef.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/* Experimental API: source and ABI compatibility are not yet guaranteed. */
12#define GD_VECTOR2D_EXPERIMENTAL 1
13#define GD_VECTOR2D_VERSION 1
14
34typedef struct gdContextStruct gdContext;
35
45
54typedef struct gdPathStruct gdPath;
55
66
75typedef struct gdPaintStruct gdPaint;
76
87
96typedef struct gdPathPatternStruct gdPathPattern;
97
107
116typedef struct gdFontFaceStruct gdFontFace;
117
127
139typedef struct gdPathMatrixStruct {
140 double m00, m10, m01, m11, m02, m12;
142
147
160typedef struct gdRectFStruct {
161 double x, y, w, h;
163
172
181typedef enum {
182 GD_EXTEND_NONE, /*< Outside samples are transparent. */
183 GD_EXTEND_REPEAT, /*< Repeat the source. */
184 GD_EXTEND_REFLECT, /*< Repeat the source with alternating mirrored copies. */
185 GD_EXTEND_PAD /*< Clamp to the nearest edge sample. */
187
201
215
228
246
288#define gdImageOpsSrc GD_OP_SOURCE
289#define gdImageOpsSrcOver GD_OP_OVER
290#define gdImageOpsDstIn GD_OP_DEST_IN
291#define gdImageOpsDstOut GD_OP_DEST_OUT
292
306BGD_DECLARE(int)
307gdImageComposite(gdImagePtr dst, const gdImagePtr src, int dst_x, int dst_y,
308 gdCompositeOperator op, double opacity, gdRectPtr src_region,
309 gdRectPtr clip);
310
326
327#define GD_TEXT_ERROR_MESSAGE_SIZE 128
328
332typedef struct {
335 char message[GD_TEXT_ERROR_MESSAGE_SIZE];
337
343typedef struct {
344 double x_bearing, y_bearing;
345 double width, height;
346 double x_advance, y_advance;
348
361
375
383BGD_DECLARE(void) gdTextOptionsInit(gdTextOptions *options);
384
401BGD_DECLARE(gdContextPtr) gdContextCreateForImage(gdImagePtr image);
402
410BGD_DECLARE(void) gdContextFlushImage(gdContextPtr context);
411
423BGD_DECLARE(int) gdContextReloadImage(gdContextPtr context);
424
432BGD_DECLARE(gdImagePtr) gdContextGetImage(gdContextPtr context);
433
443BGD_DECLARE(void) gdContextDestroy(gdContextPtr context);
444
454BGD_DECLARE(void) gdContextDestroyNoFlush(gdContextPtr context);
455
468BGD_DECLARE(int) gdContextSave(gdContextPtr context);
469
479BGD_DECLARE(int) gdContextRestore(gdContextPtr context);
480
489BGD_DECLARE(int) gdContextClip(gdContextPtr context);
490
498BGD_DECLARE(int) gdContextClipPreserve(gdContextPtr context);
499
503BGD_DECLARE(void) gdContextNewPath(gdContextPtr context);
504
511BGD_DECLARE(void) gdContextAppendPath(gdContextPtr context, gdPathPtr path);
512
524BGD_DECLARE(void)
525gdContextSetSourceRgba(gdContextPtr context, double r, double g, double b, double a);
526
537BGD_DECLARE(void) gdContextSetSourceRgb(gdContextPtr context, double r, double g, double b);
538
558BGD_DECLARE(void)
559gdContextSetSourceImage(gdContextPtr context, gdImagePtr image, double x, double y);
560
570BGD_DECLARE(void) gdContextSetSource(gdContextPtr context, gdPaintPtr source);
571
580BGD_DECLARE(void) gdContextSetOperator(gdContextPtr context, gdCompositeOperator op);
581
588BGD_DECLARE(void) gdContextSetOpacity(gdContextPtr context, double opacity);
589
604BGD_DECLARE(void) gdContextSetPatternFilter(gdContextPtr context, gdPatternFilter filter);
605
616
628BGD_DECLARE(void) gdContextSetFontFace(gdContextPtr context, gdFontFacePtr face);
629
637BGD_DECLARE(void) gdContextSetFontSize(gdContextPtr context, double size);
638
656BGD_DECLARE(gdTextStatus)
657gdContextTextPath(gdContextPtr context, const char *utf8, double x, double y,
658 const gdTextOptions *options, gdTextError *err);
659
675BGD_DECLARE(gdTextStatus)
676gdContextShowText(gdContextPtr context, const char *utf8, double x, double y,
677 const gdTextOptions *options, gdTextError *err);
678
690BGD_DECLARE(gdTextStatus)
691gdContextTextExtents(gdContextPtr context, const char *utf8, const gdTextOptions *options,
692 gdTextExtents *extents, gdTextError *err);
693
697BGD_DECLARE(void) gdContextMoveTo(gdContextPtr context, double x, double y);
698
702BGD_DECLARE(void) gdContextRelMoveTo(gdContextPtr context, double dx, double dy);
703
707BGD_DECLARE(void) gdContextLineTo(gdContextPtr context, double x, double y);
708
712BGD_DECLARE(void) gdContextRelLineTo(gdContextPtr context, double dx, double dy);
713
717BGD_DECLARE(void)
718gdContextCurveTo(gdContextPtr context, double x1, double y1, double x2, double y2, double x3,
719 double y3);
720
724BGD_DECLARE(void)
725gdContextRelCurveTo(gdContextPtr context, double dx1, double dy1, double dx2, double dy2,
726 double dx3, double dy3);
727
731BGD_DECLARE(void) gdContextQuadTo(gdContextPtr context, double x1, double y1, double x2, double y2);
732
736BGD_DECLARE(void)
737gdContextRelQuadTo(gdContextPtr context, double dx1, double dy1, double dx2, double dy2);
738
742BGD_DECLARE(void)
743gdContextArc(gdContextPtr context, double cx, double cy, double radius, double a0, double a1);
744
748BGD_DECLARE(void)
749gdContextNegativeArc(gdContextPtr context, double cx, double cy, double radius, double a0,
750 double a1);
751
755BGD_DECLARE(void)
756gdContextRectangle(gdContextPtr context, double x, double y, double width, double height);
757
761BGD_DECLARE(void) gdContextClosePath(gdContextPtr context);
762
766BGD_DECLARE(void) gdContextScale(gdContextPtr context, double x, double y);
767
771BGD_DECLARE(void) gdContextTranslate(gdContextPtr context, double x, double y);
772
779BGD_DECLARE(void) gdContextRotate(gdContextPtr context, double radians);
780
787BGD_DECLARE(void) gdContextTransform(gdContextPtr context, const gdPathMatrixPtr matrix);
788
792BGD_DECLARE(void) gdContextSetLineWidth(gdContextPtr context, double width);
793
797BGD_DECLARE(void) gdContextSetLineCap(gdContextPtr context, gdLineCap cap);
798
802BGD_DECLARE(void) gdContextSetLineJoin(gdContextPtr context, gdLineJoin join);
803
812BGD_DECLARE(void)
813gdContextSetDash(gdContextPtr context, double offset, const double *data, int size);
814
818BGD_DECLARE(void) gdContextSetFillRule(gdContextPtr context, gdFillRule rule);
819
825BGD_DECLARE(void) gdContextStroke(gdContextPtr context);
826
830BGD_DECLARE(void) gdContextStrokePreserve(gdContextPtr context);
831
837BGD_DECLARE(void) gdContextFill(gdContextPtr context);
838
842BGD_DECLARE(void) gdContextFillPreserve(gdContextPtr context);
843
847BGD_DECLARE(void) gdContextPaint(gdContextPtr context);
848
858BGD_DECLARE(gdFontFacePtr)
859gdFontFaceCreateFromFile(const char *path, int face_index, gdTextError *err);
860
873BGD_DECLARE(gdFontFacePtr)
874gdFontFaceCreateFromData(const unsigned char *data, size_t size, int face_index, gdTextError *err);
875
884
888BGD_DECLARE(void) gdFontFaceDestroy(gdFontFacePtr face);
889
905
919BGD_DECLARE(gdPaintPtr) gdPaintCreateLinear(double x0, double y0, double x1, double y1);
920
938BGD_DECLARE(gdPaintPtr)
939gdPaintCreateRadial(double x0, double y0, double r0, double x1, double y1, double r1);
940
955BGD_DECLARE(int)
956gdPaintAddColorStopRgb(gdPaintPtr paint, double offset, double r, double g, double b);
957
977BGD_DECLARE(int)
978gdPaintAddColorStopRgba(gdPaintPtr paint, double offset, double r, double g, double b, double a);
979
991BGD_DECLARE(int) gdPaintSetExtend(gdPaintPtr paint, gdExtendMode extend);
992
1003BGD_DECLARE(int) gdPaintSetMatrix(gdPaintPtr paint, const gdPathMatrixPtr matrix);
1004
1008BGD_DECLARE(void) gdPaintDestroy(gdPaintPtr paint);
1009
1024BGD_DECLARE(gdPathPatternPtr) gdPathPatternCreateForImage(gdImagePtr image);
1025
1029BGD_DECLARE(void) gdPathPatternDestroy(gdPathPatternPtr pattern);
1030
1041BGD_DECLARE(void) gdPathPatternSetExtend(gdPathPatternPtr pattern, gdExtendMode extend);
1042
1056BGD_DECLARE(void) gdPathPatternSetMatrix(gdPathPatternPtr pattern, gdPathMatrixPtr matrix);
1057
1066BGD_DECLARE(void) gdPathPatternSetOpacity(gdPathPatternPtr pattern, double opacity);
1067
1083BGD_DECLARE(void) gdPathPatternSetFilter(gdPathPatternPtr pattern, gdPatternFilter filter);
1084
1097
1114BGD_DECLARE(void)
1115gdPathMatrixInit(gdPathMatrixPtr matrix, double m00, double m10, double m01, double m11, double m02,
1116 double m12);
1122BGD_DECLARE(void) gdPathMatrixInitIdentity(gdPathMatrixPtr matrix);
1123
1131BGD_DECLARE(void) gdPathMatrixInitTranslate(gdPathMatrixPtr matrix, double x, double y);
1132
1140BGD_DECLARE(void) gdPathMatrixInitScale(gdPathMatrixPtr matrix, double x, double y);
1141
1150BGD_DECLARE(void) gdPathMatrixInitShear(gdPathMatrixPtr matrix, double x, double y);
1151
1158BGD_DECLARE(void) gdPathMatrixInitRotate(gdPathMatrixPtr matrix, double radians);
1159
1169BGD_DECLARE(void)
1170gdPathMatrixInitRotateTranslate(gdPathMatrixPtr matrix, double radians, double x, double y);
1171
1179BGD_DECLARE(void) gdPathMatrixTranslate(gdPathMatrixPtr matrix, double x, double y);
1180
1188BGD_DECLARE(void) gdPathMatrixScale(gdPathMatrixPtr matrix, double x, double y);
1189
1197BGD_DECLARE(void) gdPathMatrixShear(gdPathMatrixPtr matrix, double x, double y);
1198
1206 BGD_DECLARE(void) gdPathMatrixRotate(gdPathMatrixPtr matrix, double radians);
1207
1217BGD_DECLARE(void)
1218gdPathMatrixRotateTranslate(gdPathMatrixPtr matrix, double radians, double x, double y);
1219
1228BGD_DECLARE(void)
1230
1239BGD_DECLARE(int) gdPathMatrixInvert(gdPathMatrixPtr matrix);
1240
1250BGD_DECLARE(void)
1251gdPathMatrixMap(const gdPathMatrixPtr matrix, double x, double y, double *result_x,
1252 double *result_y);
1253
1263BGD_DECLARE(void)
1264gdPathMatrixMapPoint(const gdPathMatrixPtr matrix, const gdPointFPtr src, gdPointFPtr dst);
1265
1274BGD_DECLARE(void)
1275gdPathMatrixMapRect(const gdPathMatrixPtr matrix, const gdRectFPtr src, gdRectFPtr dst);
1276
1282 BGD_DECLARE(gdPathPtr) gdPathCreate(void);
1283
1291BGD_DECLARE(gdPathPtr) gdPathDuplicate(const gdPathPtr path);
1292
1298BGD_DECLARE(void) gdPathDestroy(gdPathPtr path);
1299
1306BGD_DECLARE(void) gdPathAppendPath(gdPathPtr path, const gdPathPtr source);
1307
1314BGD_DECLARE(void) gdPathTransform(gdPathPtr path, const gdPathMatrixPtr matrix);
1315
1323BGD_DECLARE(void) gdPathMoveTo(gdPathPtr path, double x, double y);
1324
1333BGD_DECLARE(void) gdPathRelMoveTo(gdPathPtr path, double dx, double dy);
1334
1342BGD_DECLARE(void) gdPathLineTo(gdPathPtr path, double x, double y);
1343
1351BGD_DECLARE(void) gdPathRelLineTo(gdPathPtr path, double dx, double dy);
1352
1362BGD_DECLARE(void) gdPathQuadTo(gdPathPtr path, double x1, double y1, double x2, double y2);
1363
1375BGD_DECLARE(void) gdPathRelQuadTo(gdPathPtr path, double dx1, double dy1, double dx2, double dy2);
1376
1388BGD_DECLARE(void)
1389gdPathCurveTo(gdPathPtr path, double x1, double y1, double x2, double y2, double x3, double y3);
1390
1402BGD_DECLARE(void)
1403gdPathRelCurveTo(gdPathPtr path, double dx1, double dy1, double dx2, double dy2, double dx3,
1404 double dy3);
1405
1418BGD_DECLARE(void)
1419gdPathArc(gdPathPtr path, double cx, double cy, double radius, double angle1, double angle2);
1420
1433BGD_DECLARE(void)
1434gdPathNegativeArc(gdPathPtr path, double cx, double cy, double radius, double angle1,
1435 double angle2);
1436
1449BGD_DECLARE(void)
1450gdPathArcTo(gdPathPtr path, double x1, double y1, double x2, double y2, double radius);
1451
1461BGD_DECLARE(void) gdPathRectangle(gdPathPtr path, double x, double y, double width, double height);
1462
1469BGD_DECLARE(void) gdPathClose(gdPathPtr path);
1470
1473#ifdef __cplusplus
1474}
1475#endif
1476#endif
gdTextStatus gdContextTextExtents(gdContextPtr context, const char *utf8, const gdTextOptions *options, gdTextExtents *extents, gdTextError *err)
Measure UTF-8 text using the current font face and font size.
Definition gd_text.c:740
void gdPathPatternSetMatrix(gdPathPatternPtr pattern, gdPathMatrixPtr matrix)
Set the pattern-to-user-space transform for an image pattern.
Definition gd_path.c:169
struct gdPathMatrixStruct gdPathMatrix
Affine transformation matrix.
void gdContextDestroyNoFlush(gdContextPtr context)
Destroy a context without flushing drawing changes to the backing image.
Definition gd_draw.c:428
void gdContextTransform(gdContextPtr context, const gdPathMatrixPtr matrix)
Apply an affine transformation to the current transformation matrix.
Definition gd_draw.c:538
void gdContextPaint(gdContextPtr context)
Paint the current source over the entire current clip.
Definition gd_draw.c:319
void gdContextDestroy(gdContextPtr context)
Destroy a context and flush drawing changes to the backing image.
Definition gd_draw.c:422
int gdContextSave(gdContextPtr context)
Save the current graphics state.
Definition gd_draw.c:345
void gdPathPatternSetExtend(gdPathPatternPtr pattern, gdExtendMode extend)
Set how an image pattern is sampled outside its image bounds.
Definition gd_path.c:164
gdPaintPtr gdPaintCreateLinear(double x0, double y0, double x1, double y1)
Create a linear gradient paint.
Definition gd_gradient.c:42
void gdPathMatrixInitIdentity(gdPathMatrixPtr matrix)
Initialize a matrix to the identity transformation.
Definition gd_path_matrix.c:22
gdPaintPtr gdPaintCreateFromPattern(gdPathPatternPtr pattern)
Create a paint object from an image pattern.
Definition gd_path.c:144
void gdPathMoveTo(gdPathPtr path, double x, double y)
Start a new contour at an absolute position.
Definition gd_path.c:579
gdContext * gdContextPtr
Opaque 2D drawing context pointer.
Definition gd_vector2d.h:44
void gdContextAppendPath(gdContextPtr context, gdPathPtr path)
Append a path to the context's current path.
Definition gd_draw.c:144
void gdPathMatrixInit(gdPathMatrixPtr matrix, double m00, double m10, double m01, double m11, double m02, double m12)
Initialize an affine transformation matrix from its six coefficients.
Definition gd_path_matrix.c:11
void gdContextCurveTo(gdContextPtr context, double x1, double y1, double x2, double y2, double x3, double y3)
Add a cubic Bezier curve to the context path.
Definition gd_draw.c:468
void gdContextRelCurveTo(gdContextPtr context, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
Add a relative cubic Bezier curve to the context path.
Definition gd_draw.c:475
gdPaint * gdPaintPtr
Opaque paint source pointer.
Definition gd_vector2d.h:86
void gdPathMatrixTranslate(gdPathMatrixPtr matrix, double x, double y)
Apply a translation before the transformation already in a matrix.
Definition gd_path_matrix.c:67
void gdContextClosePath(gdContextPtr context)
Close the current contour in the context path.
Definition gd_draw.c:512
int gdContextClip(gdContextPtr context)
Intersect the current clip with the current path and clear the path.
Definition gd_draw.c:336
void gdContextScale(gdContextPtr context, double x, double y)
Apply scaling to the current transformation matrix.
Definition gd_draw.c:520
void gdPathClose(gdPathPtr path)
Close the current contour with a line to its starting point. An empty path or an already closed conto...
Definition gd_path.c:740
struct gdContextStruct gdContext
Opaque 2D drawing context.
Definition gd_vector2d.h:34
void gdContextArc(gdContextPtr context, double cx, double cy, double radius, double a0, double a1)
Add a positive-direction circular arc to the context path.
Definition gd_draw.c:494
void gdPathRelQuadTo(gdPathPtr path, double dx1, double dy1, double dx2, double dy2)
Add a quadratic Bezier curve using offsets from the current point.
Definition gd_path.c:655
void gdContextRectangle(gdContextPtr context, double x, double y, double width, double height)
Add a rectangle to the context path.
Definition gd_draw.c:506
gdPathPatternPtr gdPathPatternCreateForImage(gdImagePtr image)
Create an image pattern from a gd image.
Definition gd_path.c:114
gdLineJoin
Definition gd_vector2d.h:210
struct gdFontFaceStruct gdFontFace
Opaque font face.
Definition gd_vector2d.h:116
void gdContextRelMoveTo(gdContextPtr context, double dx, double dy)
Move the current point by an offset in the context path.
Definition gd_draw.c:437
gdPath * gdPathPtr
Opaque vector path pointer.
Definition gd_vector2d.h:65
void gdContextSetDash(gdContextPtr context, double offset, const double *data, int size)
Set the stroke dash pattern.
Definition gd_draw.c:455
gdCompositeOperator
Definition gd_vector2d.h:255
gdPatternFilter gdPathPatternGetFilter(gdPathPatternPtr pattern)
Get the sampling quality for an image pattern.
Definition gd_path.c:192
void gdPathLineTo(gdPathPtr path, double x, double y)
Add a straight line to an absolute position.
Definition gd_path.c:600
void gdPathMatrixInitTranslate(gdPathMatrixPtr matrix, double x, double y)
Initialize a translation matrix.
Definition gd_path_matrix.c:32
void gdContextQuadTo(gdContextPtr context, double x1, double y1, double x2, double y2)
Add a quadratic Bezier curve to the context path.
Definition gd_draw.c:482
gdTextStatus gdContextTextPath(gdContextPtr context, const char *utf8, double x, double y, const gdTextOptions *options, gdTextError *err)
Convert UTF-8 text to path contours and append them to the current path.
Definition gd_text.c:716
struct gdPaintStruct gdPaint
Opaque paint source.
Definition gd_vector2d.h:75
void gdPathMatrixMapPoint(const gdPathMatrixPtr matrix, const gdPointFPtr src, gdPointFPtr dst)
Transform a point. src and dst may point to the same object.
Definition gd_path_matrix.c:143
void gdContextSetFontFace(gdContextPtr context, gdFontFacePtr face)
Set the current font face for text operations.
Definition gd_text.c:703
struct gdRectFStruct gdRectF
Floating-point rectangle.
gdPathPattern * gdPathPatternPtr
Opaque image pattern pointer.
Definition gd_vector2d.h:106
void gdContextTranslate(gdContextPtr context, double x, double y)
Apply translation to the current transformation matrix.
Definition gd_draw.c:526
void gdPathArcTo(gdPathPtr path, double x1, double y1, double x2, double y2, double radius)
Connect the current point to (x1, y1) and (x2, y2) with a circular arc tangent to both line segments....
Definition gd_path.c:687
gdTextStatus gdContextShowText(gdContextPtr context, const char *utf8, double x, double y, const gdTextOptions *options, gdTextError *err)
Draw UTF-8 text using the current source paint.
Definition gd_text.c:728
void gdPathRelCurveTo(gdPathPtr path, double dx1, double dy1, double dx2, double dy2, double dx3, double dy3)
Add a cubic Bezier curve using offsets from the current point.
Definition gd_path.c:636
void gdContextFill(gdContextPtr context)
Fill the current path and then clear it.
Definition gd_draw.c:276
void gdContextSetLineWidth(gdContextPtr context, double width)
Set the stroke line width.
Definition gd_draw.c:452
gdImagePtr gdContextGetImage(gdContextPtr context)
Get the image associated with a context.
Definition gd_draw.c:248
gdPatternFilter gdContextGetPatternFilter(gdContextPtr context)
Get the current default image-pattern filter from a context.
Definition gd_draw.c:134
void gdContextSetSource(gdContextPtr context, gdPaintPtr source)
Set the current source paint.
Definition gd_path.c:236
void gdPathMatrixInitScale(gdPathMatrixPtr matrix, double x, double y)
Initialize a scaling matrix.
Definition gd_path_matrix.c:37
void gdContextSetSourceRgba(gdContextPtr context, double r, double g, double b, double a)
Set the current source paint to a solid RGBA color.
Definition gd_draw.c:56
gdTextShaping
Definition gd_vector2d.h:357
void gdContextSetLineJoin(gdContextPtr context, gdLineJoin join)
Set the stroke line join style.
Definition gd_draw.c:465
gdContextPtr gdContextCreateForImage(gdImagePtr image)
Create a 2D drawing context for a truecolor image.
Definition gd_draw.c:186
void gdContextRelLineTo(gdContextPtr context, double dx, double dy)
Add a relative line to the context path.
Definition gd_draw.c:446
gdPatternFilter
Definition gd_vector2d.h:241
gdTextStatus
Definition gd_vector2d.h:318
int gdPaintAddColorStopRgb(gdPaintPtr paint, double offset, double r, double g, double b)
Add an opaque color stop to a gradient paint.
Definition gd_gradient.c:183
void gdContextSetFillRule(gdContextPtr context, gdFillRule rule)
Set the fill rule used by subsequent fill and clip operations.
Definition gd_draw.c:544
gdPaintPtr gdPaintCreateRadial(double x0, double y0, double r0, double x1, double y1, double r1)
Create a radial gradient paint between two circles.
Definition gd_gradient.c:68
void gdContextSetFontSize(gdContextPtr context, double size)
Set the current font size for text operations.
Definition gd_text.c:709
void gdPathMatrixShear(gdPathMatrixPtr matrix, double x, double y)
Apply a shear before the transformation already in a matrix.
Definition gd_path_matrix.c:81
void gdContextLineTo(gdContextPtr context, double x, double y)
Add a line to the context path.
Definition gd_draw.c:443
int gdContextRestore(gdContextPtr context)
Restore the most recently saved graphics state.
Definition gd_draw.c:379
struct gdPathPatternStruct gdPathPattern
Opaque image pattern.
Definition gd_vector2d.h:96
int gdPaintAddColorStopRgba(gdPaintPtr paint, double offset, double r, double g, double b, double a)
Add a color stop with opacity to a gradient paint.
Definition gd_gradient.c:138
int gdContextClipPreserve(gdContextPtr context)
Intersect the current clip with the current path without clearing the path.
Definition gd_draw.c:283
void gdPathRelLineTo(gdPathPtr path, double dx, double dy)
Add a straight line using an offset from the current point.
Definition gd_path.c:611
void gdPathMatrixInitRotate(gdPathMatrixPtr matrix, double radians)
Initialize a rotation matrix about the origin.
Definition gd_path_matrix.c:47
void gdPathMatrixInitRotateTranslate(gdPathMatrixPtr matrix, double radians, double x, double y)
Initialize a rotation matrix about a specified point. The point (x, y) remains unchanged by the resul...
Definition gd_path_matrix.c:56
void gdContextSetOpacity(gdContextPtr context, double opacity)
Set a global opacity multiplier for subsequent drawing.
Definition gd_draw.c:113
void gdPathMatrixScale(gdPathMatrixPtr matrix, double x, double y)
Apply scaling before the transformation already in a matrix.
Definition gd_path_matrix.c:74
int gdPathMatrixInvert(gdPathMatrixPtr matrix)
Invert an affine transformation in place. A singular matrix is left unchanged.
Definition gd_path_matrix.c:116
void gdPathMatrixInitShear(gdPathMatrixPtr matrix, double x, double y)
Initialize a shear matrix. The shear factors are the tangents of the supplied angles.
Definition gd_path_matrix.c:42
void gdContextFillPreserve(gdContextPtr context)
Fill the current path without clearing it.
Definition gd_draw.c:263
gdLineCap
Definition gd_vector2d.h:196
void gdPathMatrixRotate(gdPathMatrixPtr matrix, double radians)
Apply a rotation about the origin before the transformation already in a matrix.
Definition gd_path_matrix.c:88
void gdContextSetLineCap(gdContextPtr context, gdLineCap cap)
Set the stroke line cap style.
Definition gd_draw.c:462
void gdContextStroke(gdContextPtr context)
Stroke the current path and then clear it.
Definition gd_draw.c:550
gdFontFace * gdFontFacePtr
Opaque font face pointer.
Definition gd_vector2d.h:126
void gdPathMatrixMultiply(gdPathMatrixPtr matrix, const gdPathMatrixPtr a, const gdPathMatrixPtr b)
Compose two affine transformations. The result maps through a first and then through b....
Definition gd_path_matrix.c:104
void gdContextMoveTo(gdContextPtr context, double x, double y)
Move the current point in the context path.
Definition gd_draw.c:434
void gdPathNegativeArc(gdPathPtr path, double cx, double cy, double radius, double angle1, double angle2)
Add a circular arc in the negative-angle direction. Angles are in radians. A line is added from the c...
Definition gd_path.c:681
void gdTextOptionsInit(gdTextOptions *options)
Initialize text options to defaults.
Definition gd_text.c:658
int gdPaintSetExtend(gdPaintPtr paint, gdExtendMode extend)
Set the extend mode for a gradient or pattern paint.
Definition gd_gradient.c:188
void gdPaintDestroy(gdPaintPtr paint)
Release a paint object. Passing NULL has no effect.
Definition gd_path.c:57
gdFontFacePtr gdFontFaceCreateFromFile(const char *path, int face_index, gdTextError *err)
Load a font face from a file.
Definition gd_text.c:681
gdFontFacePtr gdFontFaceAddRef(gdFontFacePtr face)
Add a reference to a font face.
Definition gd_text.c:699
void gdPathMatrixRotateTranslate(gdPathMatrixPtr matrix, double radians, double x, double y)
Apply a rotation about a specified point before the transformation already in a matrix.
Definition gd_path_matrix.c:96
gdFontFacePtr gdFontFaceCreateFromData(const unsigned char *data, size_t size, int face_index, gdTextError *err)
Load a font face from memory.
Definition gd_text.c:690
void gdContextNegativeArc(gdContextPtr context, double cx, double cy, double radius, double a0, double a1)
Add a negative-direction circular arc to the context path.
Definition gd_draw.c:500
void gdPathTransform(gdPathPtr path, const gdPathMatrixPtr matrix)
Transform every point in a path in place.
Definition gd_path.c:341
int gdContextReloadImage(gdContextPtr context)
Reload the context drawing surface from its backing image.
Definition gd_draw.c:239
void gdPathRectangle(gdPathPtr path, double x, double y, double width, double height)
Add a closed rectangular contour.
Definition gd_path.c:730
void gdContextSetPatternFilter(gdContextPtr context, gdPatternFilter filter)
Set the default image-pattern filter for patterns created by context source helpers such as gdContext...
Definition gd_draw.c:121
void gdPathArc(gdPathPtr path, double cx, double cy, double radius, double angle1, double angle2)
Add a circular arc in the positive-angle direction. Angles are in radians. A line is added from the c...
Definition gd_path.c:675
void gdContextNewPath(gdContextPtr context)
Clear the current path.
Definition gd_draw.c:142
gdPathMatrix * gdPathMatrixPtr
Affine transformation matrix pointer.
Definition gd_vector2d.h:146
gdFillRule
Definition gd_vector2d.h:224
void gdContextFlushImage(gdContextPtr context)
Copy the context's drawing surface back into its image.
Definition gd_draw.c:217
gdRectF * gdRectFPtr
Floating-point rectangle pointer.
Definition gd_vector2d.h:171
void gdContextStrokePreserve(gdContextPtr context)
Stroke the current path without clearing it.
Definition gd_draw.c:251
void gdPathRelMoveTo(gdPathPtr path, double dx, double dy)
Start a new contour at an offset from the current point. For an empty path, the offset is relative to...
Definition gd_path.c:594
void gdPathPatternSetFilter(gdPathPatternPtr pattern, gdPatternFilter filter)
Set the sampling quality for an image pattern.
Definition gd_path.c:181
void gdPathQuadTo(gdPathPtr path, double x1, double y1, double x2, double y2)
Add a quadratic Bezier curve.
Definition gd_path.c:645
void gdPathAppendPath(gdPathPtr path, const gdPathPtr source)
Append all contours from one path to another.
Definition gd_path.c:327
void gdContextRelQuadTo(gdContextPtr context, double dx1, double dy1, double dx2, double dy2)
Add a relative quadratic Bezier curve to the context path.
Definition gd_draw.c:488
struct gdPathStruct gdPath
Opaque text shaping options.
Definition gd_vector2d.h:54
void gdPathMatrixMapRect(const gdPathMatrixPtr matrix, const gdRectFPtr src, gdRectFPtr dst)
Transform all four corners of a rectangle and calculate their axis-aligned bounding box....
Definition gd_path_matrix.c:149
void gdContextRotate(gdContextPtr context, double radians)
Apply rotation to the current transformation matrix.
Definition gd_draw.c:532
int gdPaintSetMatrix(gdPaintPtr paint, const gdPathMatrixPtr matrix)
Set the paint's pattern or gradient transform.
Definition gd_gradient.c:203
gdExtendMode
Definition gd_vector2d.h:181
gdPathPtr gdPathDuplicate(const gdPathPtr path)
Create an independent copy of a path.
Definition gd_path.c:299
void gdFontFaceDestroy(gdFontFacePtr face)
Release a font face reference. Passing NULL has no effect.
Definition gd_text.c:701
void gdPathPatternSetOpacity(gdPathPatternPtr pattern, double opacity)
Set the opacity multiplier for an image pattern.
Definition gd_path.c:174
void gdContextSetSourceImage(gdContextPtr context, gdImagePtr image, double x, double y)
Set the current source paint to an image pattern.
Definition gd_draw.c:78
void gdPathDestroy(gdPathPtr path)
Release a path. Passing NULL has no effect.
Definition gd_path.c:491
gdPathPtr gdPathCreate(void)
Create an empty path.
Definition gd_path.c:285
int gdImageComposite(gdImagePtr dst, const gdImagePtr src, int dst_x, int dst_y, gdCompositeOperator op, double opacity, gdRectPtr src_region, gdRectPtr clip)
Composite a source image into a truecolor destination image.
Definition gd_compositor.c:390
void gdPathCurveTo(gdPathPtr path, double x1, double y1, double x2, double y2, double x3, double y3)
Add a cubic Bezier curve.
Definition gd_path.c:618
void gdContextSetOperator(gdContextPtr context, gdCompositeOperator op)
Set the compositing operator used for subsequent drawing.
Definition gd_draw.c:101
void gdPathMatrixMap(const gdPathMatrixPtr matrix, double x, double y, double *result_x, double *result_y)
Transform a pair of coordinates.
Definition gd_path_matrix.c:135
void gdPathPatternDestroy(gdPathPatternPtr pattern)
Release a pattern object. Passing NULL has no effect.
Definition gd_path.c:126
void gdContextSetSourceRgb(gdContextPtr context, double r, double g, double b)
Set the current source paint to an opaque RGB color.
Definition gd_draw.c:64
@ gdLineJoinRound
Definition gd_vector2d.h:212
@ gdLineJoinMiter
Definition gd_vector2d.h:211
@ gdLineJoinBevel
Definition gd_vector2d.h:213
@ GD_OP_MULTIPLY
Definition gd_vector2d.h:270
@ GD_OP_OUT
Definition gd_vector2d.h:260
@ GD_OP_DARKEN
Definition gd_vector2d.h:273
@ GD_OP_SOFT_LIGHT
Definition gd_vector2d.h:278
@ GD_OP_DIFFERENCE
Definition gd_vector2d.h:279
@ GD_OP_HSL_LUMINOSITY
Definition gd_vector2d.h:284
@ GD_OP_HSL_COLOR
Definition gd_vector2d.h:283
@ GD_OP_ATOP
Definition gd_vector2d.h:261
@ GD_OP_DEST_OVER
Definition gd_vector2d.h:263
@ GD_OP_ADD
Definition gd_vector2d.h:268
@ GD_OP_XOR
Definition gd_vector2d.h:267
@ GD_OP_SATURATE
Definition gd_vector2d.h:269
@ GD_OP_DEST_ATOP
Definition gd_vector2d.h:266
@ GD_OP_HSL_SATURATION
Definition gd_vector2d.h:282
@ GD_OP_CLEAR
Definition gd_vector2d.h:256
@ GD_OP_DEST_IN
Definition gd_vector2d.h:264
@ GD_OP_OVER
Definition gd_vector2d.h:258
@ GD_OP_LIGHTEN
Definition gd_vector2d.h:274
@ GD_OP_IN
Definition gd_vector2d.h:259
@ GD_OP_SOURCE
Definition gd_vector2d.h:257
@ GD_OP_EXCLUSION
Definition gd_vector2d.h:280
@ GD_OP_HARD_LIGHT
Definition gd_vector2d.h:277
@ GD_OP_COLOR_DODGE
Definition gd_vector2d.h:275
@ GD_OP_OVERLAY
Definition gd_vector2d.h:272
@ GD_OP_DEST
Definition gd_vector2d.h:262
@ GD_OP_SCREEN
Definition gd_vector2d.h:271
@ GD_OP_COLOR_BURN
Definition gd_vector2d.h:276
@ GD_OP_DEST_OUT
Definition gd_vector2d.h:265
@ GD_OP_HSL_HUE
Definition gd_vector2d.h:281
@ GD_TEXT_SHAPING_NONE
Definition gd_vector2d.h:358
@ GD_TEXT_SHAPING_RAQM
Definition gd_vector2d.h:359
@ GD_PATTERN_FILTER_GOOD
Definition gd_vector2d.h:243
@ GD_PATTERN_FILTER_BEST
Definition gd_vector2d.h:244
@ GD_PATTERN_FILTER_FAST
Definition gd_vector2d.h:242
@ GD_TEXT_E_MEMORY
Definition gd_vector2d.h:324
@ GD_TEXT_E_FONT
Definition gd_vector2d.h:322
@ GD_TEXT_E_UNAVAILABLE
Definition gd_vector2d.h:321
@ GD_TEXT_E_INVALID_ARGUMENT
Definition gd_vector2d.h:320
@ GD_TEXT_OK
Definition gd_vector2d.h:319
@ GD_TEXT_E_LAYOUT
Definition gd_vector2d.h:323
@ gdLineCapRound
Definition gd_vector2d.h:198
@ gdLineCapSquare
Definition gd_vector2d.h:199
@ gdLineCapButt
Definition gd_vector2d.h:197
@ gdFillRuleNonZero
Definition gd_vector2d.h:225
@ gdFillRuleEvenOdd
Definition gd_vector2d.h:226
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
A rectangle in the coordinate space of the image.
Definition gd.h:6621
Optional detailed error information for 2D text APIs.
Definition gd_vector2d.h:332
gdTextStatus code
Definition gd_vector2d.h:333
int provider_code
Definition gd_vector2d.h:334
Definition gd_vector2d.h:343
double y_bearing
Definition gd_vector2d.h:344
double height
Definition gd_vector2d.h:345
double y_advance
Definition gd_vector2d.h:346
Definition gd_vector2d.h:369
gdTextShaping shaping
Definition gd_vector2d.h:370
double reserved_double
Definition gd_vector2d.h:373
double line_spacing
Definition gd_vector2d.h:371
unsigned int reserved_flags
Definition gd_vector2d.h:372