2 * Hic Est Leo -- Symbolizers
4 * (c) 2014 Martin Mares <mj@ucw.cz>
14 enum symbolizer_type {
26 enum symbolizer_type type;
28 // Symbolizer-dependent data follow
33 void (*draw)(struct symbol *sym, struct svg *svg);
34 void (*gen)(struct osm_object *o, struct style_info *si, struct svg *svg);
38 extern struct mempool *sym_mp;
41 * Default values for major-z-index:
45 * 2.1 left/right casing
52 typedef u32 z_index_t;
55 void *sym_new(enum symbolizer_type type, struct osm_object *o, size_t size);
56 void sym_plan(struct symbol *sym, z_index_t zindex);
57 void sym_draw_all(struct svg *svg);
58 void sym_from_style(struct osm_object *o, struct style_results *sr, struct svg *svg);
59 z_index_t sym_zindex(struct osm_object *o, struct style_info *si, double default_mzi);
61 /* sym-point.c handles point symbols and icons */
69 double stroke_opacity;
76 // FIXME: Make sym_*_new() and symbolizer structs internal
77 extern struct symbolizer symbolizer_point;
78 struct sym_point *sym_point_new(struct osm_object *o);
82 struct svg_icon_request sir;
85 extern struct symbolizer symbolizer_icon;
86 struct sym_icon *sym_icon_new(struct osm_object *o);
88 /* sym-line.c handles lines and areas */
98 double *dash_pattern; // Growing array
102 extern struct symbolizer symbolizer_line;
103 struct sym_line *sym_line_new(struct osm_object *o);
109 struct svg_pattern *fill_pattern;
112 extern struct symbolizer symbolizer_area;
113 struct sym_area *sym_area_new(struct osm_object *o);
115 struct sym_lineimg { // Images along line
117 struct svg_icon_request sir;
124 extern struct symbolizer symbolizer_lineimg;
125 struct sym_lineimg *sym_lineimg_new(struct osm_object *o);
135 double rotate; // Rotation in degrees CCW
136 struct text_font *font;
141 struct sym_text *next_in_tile; // See text_by_tile[]
142 struct sym_text *next_duplicate;
146 extern struct symbolizer symbolizer_text;
147 struct sym_text *sym_text_new(struct osm_object *o);
149 void scale_text(struct svg *svg, double x, double y, osm_val_t text);