xref: /haiku/headers/libs/agg/agg_span_solid.h (revision 7749d0bb0c358a3279b1b9cc76d8376e900130a5)
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.4
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 //----------------------------------------------------------------------------
15 //
16 // span_solid_rgba8
17 //
18 //----------------------------------------------------------------------------
19 
20 #ifndef AGG_SPAN_SOLID_INCLUDED
21 #define AGG_SPAN_SOLID_INCLUDED
22 
23 #include "agg_basics.h"
24 
25 namespace agg
26 {
27     //--------------------------------------------------------------span_solid
28     template<class ColorT> class span_solid
29     {
30     public:
31         typedef ColorT color_type;
32 
33         //--------------------------------------------------------------------
34         void color(const color_type& c) { m_color = c; }
35         const color_type& color() const { return m_color; }
36 
37         //--------------------------------------------------------------------
38         void prepare() {}
39 
40         //--------------------------------------------------------------------
41         void generate(color_type* span, int x, int y, unsigned len)
42         {
43             do { *span++ = m_color; } while(--len);
44         }
45 
46     private:
47         color_type m_color;
48     };
49 
50 
51 }
52 
53 #endif
54