update dev300-m58
[ooovba.git] / agg / inc / agg_span_converter.h
blob26bf587d0c9e3c647e9c78a893ced5c9d6948e88
1 //----------------------------------------------------------------------------
2 // Anti-Grain Geometry - Version 2.3
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_SPAN_CONVERTER_INCLUDED
17 #define AGG_SPAN_CONVERTER_INCLUDED
19 #include "agg_basics.h"
21 namespace agg
23 //----------------------------------------------------------span_converter
24 template<class SpanGenerator, class Conv> class span_converter
26 public:
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);
43 return span;
46 private:
47 SpanGenerator* m_span_gen;
48 Conv* m_conv;
53 #endif