update dev300-m58
[ooovba.git] / agg / inc / agg_span_solid.h
blob7df72ebc0e5913bb868c261bf89bc6e860b8f70a
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 // span_solid_rgba8
18 //----------------------------------------------------------------------------
20 #ifndef AGG_SPAN_SOLID_INCLUDED
21 #define AGG_SPAN_SOLID_INCLUDED
23 #include "agg_basics.h"
24 #include "agg_span_generator.h"
26 namespace agg
28 //--------------------------------------------------------------span_solid
29 template<class ColorT, class Allocator = span_allocator<ColorT> >
30 class span_solid : public span_generator<ColorT, Allocator>
32 public:
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();
50 *span++ = m_color;
52 while(--len);
53 return base_type::allocator().span();
56 private:
57 color_type m_color;
63 #endif