vfs: check userland buffers before reading them.
[haiku.git] / headers / libs / agg / agg_vcgen_bspline.h
bloba2944548c026f90581b71c3ff36645347d93127c
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 #ifndef AGG_VCGEN_BSPLINE_INCLUDED
17 #define AGG_VCGEN_BSPLINE_INCLUDED
19 #include "agg_basics.h"
20 #include "agg_array.h"
21 #include "agg_bspline.h"
24 namespace agg
27 //==========================================================vcgen_bspline
28 class vcgen_bspline
30 enum status_e
32 initial,
33 ready,
34 polygon,
35 end_poly,
36 stop
39 public:
40 typedef pod_bvector<point_d, 6> vertex_storage;
42 vcgen_bspline();
44 void interpolation_step(double v) { m_interpolation_step = v; }
45 double interpolation_step() const { return m_interpolation_step; }
47 // Vertex Generator Interface
48 void remove_all();
49 void add_vertex(double x, double y, unsigned cmd);
51 // Vertex Source Interface
52 void rewind(unsigned path_id);
53 unsigned vertex(double* x, double* y);
55 private:
56 vcgen_bspline(const vcgen_bspline&);
57 const vcgen_bspline& operator = (const vcgen_bspline&);
59 vertex_storage m_src_vertices;
60 bspline m_spline_x;
61 bspline m_spline_y;
62 double m_interpolation_step;
63 unsigned m_closed;
64 status_e m_status;
65 unsigned m_src_vertex;
66 double m_cur_abscissa;
67 double m_max_abscissa;
73 #endif