update dev300-m58
[ooovba.git] / agg / inc / agg_render_scanlines.h
blob376729bb7ae107a4b053d68c90ab117ba63962a2
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
4 //
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.
9 //
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"
21 namespace agg
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))
34 ren.render(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,
44 Scanline& sl,
45 Renderer& r,
46 VertexSource& vs,
47 const ColorStorage& as,
48 const PathId& id,
49 unsigned num_paths)
51 for(unsigned i = 0; i < num_paths; i++)
53 ras.reset();
54 ras.add_path(vs, id[i]);
55 r.color(as[i]);
56 render_scanlines(ras, sl, r);
63 #endif