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 //----------------------------------------------------------------------------
18 //----------------------------------------------------------------------------
20 #ifndef AGG_SPAN_SOLID_INCLUDED
21 #define AGG_SPAN_SOLID_INCLUDED
23 #include "agg_basics.h"
24 #include "agg_span_generator.h"
28 //--------------------------------------------------------------span_solid
29 template<class ColorT
, class Allocator
= span_allocator
<ColorT
> >
30 class span_solid
: public span_generator
<ColorT
, Allocator
>
33 typedef Allocator alloc_type
;
34 typedef ColorT color_type
;
35 typedef span_generator
<color_type
, alloc_type
> base_type
;
37 //--------------------------------------------------------------------
38 span_solid(alloc_type
& alloc
) : base_type(alloc
) {}
40 //--------------------------------------------------------------------
41 void color(const color_type
& c
) { m_color
= c
; }
42 const color_type
& color() const { return m_color
; }
44 //--------------------------------------------------------------------
45 color_type
* generate(int x
, int y
, unsigned len
)
47 color_type
* span
= base_type::allocator().span();
53 return base_type::allocator().span();