25 #ifndef AGG_SPAN_PATTERN_RGB_INCLUDED 26 #define AGG_SPAN_PATTERN_RGB_INCLUDED 28 #include "agg_basics.h" 37 typedef Source source_type;
38 typedef typename source_type::color_type color_type;
39 typedef typename source_type::order_type order_type;
40 typedef typename color_type::value_type value_type;
41 typedef typename color_type::calc_type calc_type;
46 unsigned offset_x,
unsigned offset_y) :
50 m_alpha(color_type::base_mask)
54 void attach(source_type& v) { m_src = &v; }
55 source_type& source() {
return *m_src; }
56 const source_type& source()
const {
return *m_src; }
59 void offset_x(
unsigned v) { m_offset_x = v; }
60 void offset_y(
unsigned v) { m_offset_y = v; }
61 unsigned offset_x()
const {
return m_offset_x; }
62 unsigned offset_y()
const {
return m_offset_y; }
63 void alpha(value_type v) { m_alpha = v; }
64 value_type alpha()
const {
return m_alpha; }
68 void generate(color_type* span,
int x,
int y,
unsigned len)
72 const value_type* p = (
const value_type*)m_src->span(x, y, len);
75 span->r = p[order_type::R];
76 span->g = p[order_type::G];
77 span->b = p[order_type::B];