20 #ifndef AGG_RENDERING_BUFFER_DYNAROW_INCLUDED 21 #define AGG_RENDERING_BUFFER_DYNAROW_INCLUDED 24 #include "agg_array.h" 59 unsigned byte_width) :
63 m_byte_width(byte_width)
65 std::memset(&m_rows[0], 0,
sizeof(row_data) * height);
70 void init(
unsigned width,
unsigned height,
unsigned byte_width)
73 for(i = 0; i < m_height; ++i)
81 m_byte_width = byte_width;
82 m_rows.resize(height);
83 std::memset(&m_rows[0], 0,
sizeof(row_data) * height);
88 unsigned width()
const {
return m_width; }
89 unsigned height()
const {
return m_height; }
90 unsigned byte_width()
const {
return m_byte_width; }
95 int8u* row_ptr(
int x,
int y,
unsigned len)
97 row_data* r = &m_rows[y];
101 if(x < r->x1) { r->x1 = x; }
102 if(x2 > r->x2) { r->x2 = x2; }
110 std::memset(p, 0, m_byte_width);
112 return (int8u*)r->ptr;
116 const int8u* row_ptr(
int y)
const {
return m_rows[y].ptr; }
117 int8u* row_ptr(
int y) {
return row_ptr(0, y, m_width); }
118 row_data row (
int y)
const {
return m_rows[y]; }
131 unsigned m_byte_width;