LibGd 2.4.0-dev
GD Graphics library
Loading...
Searching...
No Matches
gd_path_dash.h
1#ifndef GD_PATH_DASH_H
2#define GD_PATH_DASH_H
3
4#include "gd_vector2d_private.h"
5
6#define _dash_init(dash) \
7 do { \
8 dash.data = NULL; \
9 dash.size = 0; \
10 dash.capacity = 0; \
11 } while (0)
12
13#define _dash_allocate(dash, count) \
14 do { \
15 if (dash.size + count > dash.capacity) { \
16 int capacity = dash.size + count; \
17 int newcapacity = dash.capacity == 0 ? 8 : dash.capacity; \
18 while (newcapacity < capacity) { \
19 newcapacity *= 2; \
20 } \
21 dash.data = gdRealloc(dash.data, (size_t)newcapacity * sizeof(dash.data[0])); \
22 dash.capacity = newcapacity; \
23 } \
24 } while (0)
25
26gdPathDashPtr gdPathDashCreate(const double *data, int size, double offset);
27gdPathDashPtr gdPathDashClone(const gdPathDashPtr dash);
28void gdPathDashDestroy(gdPathDashPtr dash);
29gdPathPtr gdPathApplyDash(const gdPathDashPtr dash, const gdPathPtr path);
30#endif // GD_PATH_DASH_H