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

agg_span_generator.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_SPAN_GENERATOR_INCLUDED
00017 #define AGG_SPAN_GENERATOR_INCLUDED
00018 
00019 #include "agg_basics.h"
00020 #include "agg_span_allocator.h"
00021 
00022 namespace agg
00023 {
00024 
00025     //==========================================================span_generator
00026     template<class ColorT, class Allocator> class span_generator
00027     {
00028     public:
00029         typedef ColorT color_type;
00030         typedef Allocator alloc_type;
00031 
00032         //--------------------------------------------------------------------
00033         span_generator(alloc_type& alloc) : m_alloc(&alloc) {}
00034 
00035         //--------------------------------------------------------------------
00036         void allocator(alloc_type& alloc) { m_alloc = &alloc; }
00037         alloc_type& allocator() { return *m_alloc; }
00038 
00039         //--------------------------------------------------------------------
00040         void prepare(unsigned max_span_len) 
00041         {
00042             m_alloc->allocate(max_span_len);
00043         }
00044 
00045     private:
00046         alloc_type* m_alloc;
00047     };
00048 }
00049 
00050 #endif

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