1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
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.
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"
25 //==========================================================span_generator
26 template<class ColorT
, class Allocator
> class span_generator
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
);