vfs: check userland buffers before reading them.
[haiku.git] / headers / libs / agg / agg_conv_smooth_poly1.h
blob4ac4e3d6e29f3460ca03e64f9a2c5cf9766be064
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 // Smooth polygon generator
18 //----------------------------------------------------------------------------
19 #ifndef AGG_CONV_SMOOTH_POLY1_INCLUDED
20 #define AGG_CONV_SMOOTH_POLY1_INCLUDED
22 #include "agg_basics.h"
23 #include "agg_vcgen_smooth_poly1.h"
24 #include "agg_conv_adaptor_vcgen.h"
25 #include "agg_conv_curve.h"
28 namespace agg
31 //-------------------------------------------------------conv_smooth_poly1
32 template<class VertexSource>
33 struct conv_smooth_poly1 :
34 public conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1>
36 typedef conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1> base_type;
38 conv_smooth_poly1(VertexSource& vs) :
39 conv_adaptor_vcgen<VertexSource, vcgen_smooth_poly1>(vs)
43 void smooth_value(double v) { base_type::generator().smooth_value(v); }
44 double smooth_value() const { return base_type::generator().smooth_value(); }
46 private:
47 conv_smooth_poly1(const conv_smooth_poly1<VertexSource>&);
48 const conv_smooth_poly1<VertexSource>&
49 operator = (const conv_smooth_poly1<VertexSource>&);
54 //-------------------------------------------------conv_smooth_poly1_curve
55 template<class VertexSource>
56 struct conv_smooth_poly1_curve :
57 public conv_curve<conv_smooth_poly1<VertexSource> >
59 conv_smooth_poly1_curve(VertexSource& vs) :
60 conv_curve<conv_smooth_poly1<VertexSource> >(m_smooth),
61 m_smooth(vs)
65 void smooth_value(double v) { m_smooth.generator().smooth_value(v); }
66 double smooth_value() const { return m_smooth.generator().smooth_value(); }
68 private:
69 conv_smooth_poly1_curve(const conv_smooth_poly1_curve<VertexSource>&);
70 const conv_smooth_poly1_curve<VertexSource>&
71 operator = (const conv_smooth_poly1_curve<VertexSource>&);
73 conv_smooth_poly1<VertexSource> m_smooth;
79 #endif