update dev300-m57
[ooovba.git] / agg / inc / agg_span_generator.h
blob2be965512e75dfadc3164ee521b4b9f591dc8aeb
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_SPAN_GENERATOR_INCLUDED
17 #define AGG_SPAN_GENERATOR_INCLUDED
19 #include "agg_basics.h"
20 #include "agg_span_allocator.h"
22 namespace agg
25 //==========================================================span_generator
26 template<class ColorT, class Allocator> class span_generator
28 public:
29 typedef ColorT color_type;
30 typedef Allocator alloc_type;
32 //--------------------------------------------------------------------
33 span_generator(alloc_type& alloc) : m_alloc(&alloc) {}
35 //--------------------------------------------------------------------
36 void allocator(alloc_type& alloc) { m_alloc = &alloc; }
37 alloc_type& allocator() { return *m_alloc; }
39 //--------------------------------------------------------------------
40 void prepare(unsigned max_span_len)
42 m_alloc->allocate(max_span_len);
45 private:
46 alloc_type* m_alloc;
50 #endif