1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
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 Conv
> class span_converter
27 typedef typename
SpanGenerator::color_type color_type
;
29 span_converter(SpanGenerator
& span_gen
, Conv
& conv
) :
30 m_span_gen(&span_gen
), m_conv(&conv
) {}
32 //--------------------------------------------------------------------
33 void prepare(unsigned max_span_len
)
35 m_span_gen
->prepare(max_span_len
);
38 //--------------------------------------------------------------------
39 color_type
* generate(int x
, int y
, unsigned len
)
41 color_type
* span
= m_span_gen
->generate(x
, y
, len
);
42 m_conv
->convert(span
, x
, y
, len
);
47 SpanGenerator
* m_span_gen
;