1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.4
3 // Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
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.
10 //----------------------------------------------------------------------------
11 // Contact: mcseem@antigrain.com
12 // mcseemagg@yahoo.com
13 // http://www.antigrain.com
14 //----------------------------------------------------------------------------
16 #ifndef AGG_SPAN_INTERPOLATOR_ADAPTOR_INCLUDED
17 #define AGG_SPAN_INTERPOLATOR_ADAPTOR_INCLUDED
19 #include "agg_basics.h"
24 //===============================================span_interpolator_adaptor
25 template<class Interpolator
, class Distortion
>
26 class span_interpolator_adaptor
: public Interpolator
29 typedef Interpolator base_type
;
30 typedef typename
base_type::trans_type trans_type
;
31 typedef Distortion distortion_type
;
33 //--------------------------------------------------------------------
34 span_interpolator_adaptor() {}
35 span_interpolator_adaptor(const trans_type
& trans
,
36 const distortion_type
& dist
) :
42 //--------------------------------------------------------------------
43 span_interpolator_adaptor(const trans_type
& trans
,
44 const distortion_type
& dist
,
45 double x
, double y
, unsigned len
) :
46 base_type(trans
, x
, y
, len
),
51 //--------------------------------------------------------------------
52 const distortion_type
& distortion() const
57 //--------------------------------------------------------------------
58 void distortion(const distortion_type
& dist
)
63 //--------------------------------------------------------------------
64 void coordinates(int* x
, int* y
) const
66 base_type::coordinates(x
, y
);
67 m_distortion
->calculate(x
, y
);
71 //--------------------------------------------------------------------
72 const distortion_type
* m_distortion
;