Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages | Examples

agg_render_scanlines.h

00001 //----------------------------------------------------------------------------
00002 // Anti-Grain Geometry - Version 2.2
00003 // Copyright (C) 2002-2004 Maxim Shemanarev (http://www.antigrain.com)
00004 //
00005 // Permission to copy, use, modify, sell and distribute this software 
00006 // is granted provided this copyright notice appears in all copies. 
00007 // This software is provided "as is" without express or implied
00008 // warranty, and with no claim as to its suitability for any purpose.
00009 //
00010 //----------------------------------------------------------------------------
00011 // Contact: mcseem@antigrain.com
00012 //          mcseemagg@yahoo.com
00013 //          http://www.antigrain.com
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     //========================================================render_scanlines
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     //========================================================render_all_paths
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 

Generated on Wed Feb 9 11:31:35 2005 for OpenGUI by  doxygen 1.4.0