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_CONVERTER_INCLUDED
17 #define AGG_SPAN_CONVERTER_INCLUDED
19 #include "agg_basics.h"
23 //----------------------------------------------------------span_converter
24 template<class SpanGenerator
, class SpanConverter
> class span_converter
27 typedef typename
SpanGenerator::color_type color_type
;
29 span_converter(SpanGenerator
& span_gen
, SpanConverter
& span_cnv
) :
30 m_span_gen(&span_gen
), m_span_cnv(&span_cnv
) {}
32 void attach_generator(SpanGenerator
& span_gen
) { m_span_gen
= &span_gen
; }
33 void attach_converter(SpanConverter
& span_cnv
) { m_span_cnv
= &span_cnv
; }
35 //--------------------------------------------------------------------
38 m_span_gen
->prepare();
39 m_span_cnv
->prepare();
42 //--------------------------------------------------------------------
43 void generate(color_type
* span
, int x
, int y
, unsigned len
)
45 m_span_gen
->generate(span
, x
, y
, len
);
46 m_span_cnv
->generate(span
, x
, y
, len
);
50 SpanGenerator
* m_span_gen
;
51 SpanConverter
* m_span_cnv
;