1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
5 // Permission to copy, use, modify, sell and distribute this software
6 // is granted provided this copyright notice appears in all copies.
7 // This software is provided "as is" without express or implied
8 // warranty, and with no claim as to its suitability for any purpose.
10 //----------------------------------------------------------------------------
11 // Contact: mcseem@antigrain.com
12 // mcseemagg@yahoo.com
13 // http://www.antigrain.com
14 //----------------------------------------------------------------------------
16 #ifndef AGG_RENDER_SCANLINES_INCLUDED
17 #define AGG_RENDER_SCANLINES_INCLUDED
19 #include "agg_basics.h"
23 //========================================================render_scanlines
24 template<class Rasterizer
, class Scanline
, class Renderer
>
25 void render_scanlines(Rasterizer
& ras
, Scanline
& sl
, Renderer
& ren
)
27 if(ras
.rewind_scanlines())
29 sl
.reset(ras
.min_x(), ras
.max_x());
30 ren
.prepare(unsigned(ras
.max_x() - ras
.min_x() + 2));
32 while(ras
.sweep_scanline(sl
))
40 //========================================================render_all_paths
41 template<class Rasterizer
, class Scanline
, class Renderer
,
42 class VertexSource
, class ColorStorage
, class PathId
>
43 void render_all_paths(Rasterizer
& ras
,
47 const ColorStorage
& as
,
51 for(unsigned i
= 0; i
< num_paths
; i
++)
54 ras
.add_path(vs
, id
[i
]);
56 render_scanlines(ras
, sl
, r
);