vfs: check userland buffers before reading them.
[haiku.git] / headers / libs / agg / agg_span_solid.h
blobee46df9991346132f36256877e31573f4edc6f54
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 //----------------------------------------------------------------------------
16 // span_solid_rgba8
18 //----------------------------------------------------------------------------
20 #ifndef AGG_SPAN_SOLID_INCLUDED
21 #define AGG_SPAN_SOLID_INCLUDED
23 #include "agg_basics.h"
25 namespace agg
27 //--------------------------------------------------------------span_solid
28 template<class ColorT> class span_solid
30 public:
31 typedef ColorT color_type;
33 //--------------------------------------------------------------------
34 void color(const color_type& c) { m_color = c; }
35 const color_type& color() const { return m_color; }
37 //--------------------------------------------------------------------
38 void prepare() {}
40 //--------------------------------------------------------------------
41 void generate(color_type* span, int x, int y, unsigned len)
43 do { *span++ = m_color; } while(--len);
46 private:
47 color_type m_color;
53 #endif