00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef AGG_RENDER_SCANLINES_INCLUDED
00017 #define AGG_RENDER_SCANLINES_INCLUDED
00018
00019 #include "agg_basics.h"
00020
00021 namespace agg
00022 {
00023
00024 template<class Rasterizer, class Scanline, class Renderer>
00025 void render_scanlines(Rasterizer& ras, Scanline& sl, Renderer& ren)
00026 {
00027 if(ras.rewind_scanlines())
00028 {
00029 sl.reset(ras.min_x(), ras.max_x());
00030 ren.prepare(unsigned(ras.max_x() - ras.min_x() + 2));
00031
00032 while(ras.sweep_scanline(sl))
00033 {
00034 ren.render(sl);
00035 }
00036 }
00037 }
00038
00039
00040
00041 template<class Rasterizer, class Scanline, class Renderer,
00042 class VertexSource, class ColorStorage, class PathId>
00043 void render_all_paths(Rasterizer& ras,
00044 Scanline& sl,
00045 Renderer& r,
00046 VertexSource& vs,
00047 const ColorStorage& as,
00048 const PathId& id,
00049 unsigned num_paths)
00050 {
00051 for(unsigned i = 0; i < num_paths; i++)
00052 {
00053 ras.reset();
00054 ras.add_path(vs, id[i]);
00055 r.color(as[i]);
00056 render_scanlines(ras, sl, r);
00057 }
00058 }
00059
00060
00061 }
00062
00063 #endif
00064
00065
00066