37#include "common/scummsys.h"
44#define art_new(type, n) ((type *)malloc ((n) * sizeof(type)))
46#define art_renew(p, type, n) ((type *)realloc (p, (n) * sizeof(type)))
50#define art_expand(p, type, max) \
53 type *tmp = art_renew(p, type, max <<= 1); \
54 if (!tmp) error("Cannot reallocate memory for art data"); \
58 p = art_new(type, 1); \
59 if (!p) error("Cannot allocate memory for art data"); \
65 double x0, y0, x1, y1;
87void art_svp_free(
ArtSVP *svp);
121void art_vpath_add_point(
ArtVpath **p_vpath,
int *pn_points,
int *pn_points_max,
122 ArtPathcode code,
double x,
double y);
128#ifndef ART_WIND_RULE_DEFINED
129#define ART_WIND_RULE_DEFINED
131 ART_WIND_RULE_NONZERO,
132 ART_WIND_RULE_INTERSECT,
133 ART_WIND_RULE_ODDEVEN,
134 ART_WIND_RULE_POSITIVE
139 int (*add_segment)(
ArtSvpWriter *self,
int wind_left,
int delta_wind,
141 void (*add_point)(
ArtSvpWriter *self,
int seg_id,
double x,
double y);
145ArtSvpWriter *art_svp_writer_rewind_new(ArtWindRule rule);
149int art_svp_seg_compare(
const void *s1,
const void *s2);
160enum ArtPathStrokeJoinType {
161 ART_PATH_STROKE_JOIN_MITER,
162 ART_PATH_STROKE_JOIN_ROUND,
163 ART_PATH_STROKE_JOIN_BEVEL
166enum ArtPathStrokeCapType {
167 ART_PATH_STROKE_CAP_BUTT,
168 ART_PATH_STROKE_CAP_ROUND,
169 ART_PATH_STROKE_CAP_SQUARE
172ArtSVP *art_svp_vpath_stroke(ArtVpath *vpath,
173 ArtPathStrokeJoinType join,
174 ArtPathStrokeCapType cap,
180ArtVpath *art_svp_vpath_stroke_raw(ArtVpath *vpath,
181 ArtPathStrokeJoinType join,
182 ArtPathStrokeCapType cap,
195struct ArtSVPRenderAAIter;
197ArtSVPRenderAAIter *art_svp_render_aa_iter(
const ArtSVP *svp,
198 int x0,
int y0,
int x1,
int y1);
200void art_svp_render_aa_iter_step(ArtSVPRenderAAIter *iter,
int *p_start,
203void art_svp_render_aa_iter_done(ArtSVPRenderAAIter *iter);
205void art_svp_render_aa(
const ArtSVP *svp,
206 int x0,
int y0,
int x1,
int y1,
207 void (*callback)(
void *callback_data,
211 void *callback_data);