MCPcopy Create free account
hub / github.com/MapServer/MapServer / agg2RenderLine

Function agg2RenderLine

mapagg.cpp:186–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186int agg2RenderLine(imageObj *img, shapeObj *p, strokeStyleObj *style) {
187
188 AGG2Renderer *r = AGG_RENDERER(img);
189 line_adaptor lines = line_adaptor(p);
190
191#ifdef AGG_ALIASED_ENABLED
192 r->m_rasterizer_primitives.reset();
193 r->m_renderer_primitives.line_color(aggColor(style->color));
194 r->m_rasterizer_primitives.add_path(lines);
195 return MS_SUCCESS;
196#endif
197
198 r->m_rasterizer_aa.reset();
199 r->m_rasterizer_aa.filling_rule(mapserver::fill_non_zero);
200 r->m_renderer_scanline.color(aggColor(style->color));
201
202 if (style->patternlength <= 0) {
203 mapserver::conv_stroke<line_adaptor> stroke(lines);
204 stroke.width(style->width);
205 if(style->width>1)
206 applyCJC(stroke, style->linecap, style->linejoin);
207 r->m_rasterizer_aa.add_path(stroke);
208 } else {
209 mapserver::conv_dash<line_adaptor> dash(lines);
210 mapserver::conv_stroke<mapserver::conv_dash<line_adaptor> > stroke_dash(dash);
211 for (int i = 0; i < style->patternlength; i += 2) {
212
213 if (i < style->patternlength - 1) {
214
215 dash.add_dash(MS_MAX(1,MS_NINT(style->pattern[i])),
216 MS_MAX(1,MS_NINT(style->pattern[i + 1])));
217 }
218 }
219 stroke_dash.width(style->width);
220 if(style->width>1)
221 applyCJC(stroke_dash, style->linecap, style->linejoin);
222 r->m_rasterizer_aa.add_path(stroke_dash);
223 }
224 mapserver::render_scanlines(r->m_rasterizer_aa, r->sl_line, r->m_renderer_scanline);
225 return MS_SUCCESS;
226}
227
228int agg2RenderLineTiled(imageObj *img, shapeObj *p, imageObj * tile) {
229

Callers

nothing calls this directly

Calls 11

applyCJCFunction · 0.85
MS_NINTFunction · 0.85
render_scanlinesFunction · 0.85
line_colorMethod · 0.80
line_adaptorClass · 0.70
resetMethod · 0.45
add_pathMethod · 0.45
filling_ruleMethod · 0.45
colorMethod · 0.45
widthMethod · 0.45
add_dashMethod · 0.45

Tested by

no test coverage detected