osgEarth 2.1.1
|
#include <AGG.h>
Classes | |
class | iterator |
Public Types | |
enum | { aa_shift = 8 } |
Public Member Functions | |
~scanline () | |
scanline () | |
void | reset (int min_x, int max_x, int dx=0, int dy=0) |
void | reset_spans () |
void | add_cell (int x, int y, unsigned cover) |
void | add_span (int x, int y, unsigned len, unsigned cover) |
int | is_ready (int y) const |
int | base_x () const |
int | y () const |
unsigned | num_spans () const |
Private Member Functions | |
scanline (const scanline &) | |
const scanline & | operator= (const scanline &) |
Private Attributes | |
int | m_min_x |
unsigned | m_max_len |
int | m_dx |
int | m_dy |
int | m_last_x |
int | m_last_y |
int8u * | m_covers |
int8u ** | m_start_ptrs |
int16u * | m_counts |
unsigned | m_num_spans |
int8u ** | m_cur_start_ptr |
int16u * | m_cur_count |
Friends | |
class | iterator |
agg::scanline::~scanline | ( | ) |
Definition at line 1330 of file AGG.h.
{ if ( m_counts ) delete [] m_counts; if ( m_start_ptrs ) delete [] m_start_ptrs; if ( m_covers ) delete [] m_covers; }
agg::scanline::scanline | ( | ) |
Definition at line 1339 of file AGG.h.
: m_min_x(0), m_max_len(0), m_dx(0), m_dy(0), m_last_x(0x7FFF), m_last_y(0x7FFF), m_covers(0), m_start_ptrs(0), m_counts(0), m_num_spans(0), m_cur_start_ptr(0), m_cur_count(0) { }
agg::scanline::scanline | ( | const scanline & | ) | [private] |
void agg::scanline::add_cell | ( | int | x, |
int | y, | ||
unsigned | cover | ||
) | [inline] |
Definition at line 354 of file AGG.h.
{ x -= m_min_x; m_covers[x] = (unsigned char)cover; if(x == m_last_x+1) { (*m_cur_count)++; } else { *++m_cur_count = 1; *++m_cur_start_ptr = m_covers + x; m_num_spans++; } m_last_x = x; m_last_y = y; }
void agg::scanline::add_span | ( | int | x, |
int | y, | ||
unsigned | len, | ||
unsigned | cover | ||
) |
Definition at line 1382 of file AGG.h.
{ x -= m_min_x; memset(m_covers + x, cover, num); if(x == m_last_x+1) { (*m_cur_count) += (int16u)num; } else { *++m_cur_count = (int16u)num; *++m_cur_start_ptr = m_covers + x; m_num_spans++; } m_last_x = x + num - 1; m_last_y = y; }
int agg::scanline::base_x | ( | ) | const [inline] |
int agg::scanline::is_ready | ( | int | y | ) | const [inline] |
Definition at line 374 of file AGG.h.
{ return m_num_spans && (y ^ m_last_y); }
unsigned agg::scanline::num_spans | ( | ) | const [inline] |
Definition at line 320 of file AGG.h.
{ return m_num_spans; }
void agg::scanline::reset | ( | int | min_x, |
int | max_x, | ||
int | dx = 0 , |
||
int | dy = 0 |
||
) |
Definition at line 1357 of file AGG.h.
{ unsigned max_len = max_x - min_x + 2; if(max_len > m_max_len) { if ( m_counts ) delete [] m_counts; if ( m_start_ptrs ) delete [] m_start_ptrs; if ( m_covers ) delete [] m_covers; m_covers = new unsigned char [max_len]; m_start_ptrs = new unsigned char* [max_len]; m_counts = new int16u[max_len]; m_max_len = max_len; } m_dx = dx; m_dy = dy; m_last_x = 0x7FFF; m_last_y = 0x7FFF; m_min_x = min_x; m_cur_count = m_counts; m_cur_start_ptr = m_start_ptrs; m_num_spans = 0; }
void agg::scanline::reset_spans | ( | ) | [inline] |
Definition at line 343 of file AGG.h.
{ m_last_x = 0x7FFF; m_last_y = 0x7FFF; m_cur_count = m_counts; m_cur_start_ptr = m_start_ptrs; m_num_spans = 0; }
int agg::scanline::y | ( | ) | const [inline] |
int16u* agg::scanline::m_counts [private] |
int8u* agg::scanline::m_covers [private] |
int16u* agg::scanline::m_cur_count [private] |
int8u** agg::scanline::m_cur_start_ptr [private] |
int agg::scanline::m_dx [private] |
int agg::scanline::m_dy [private] |
int agg::scanline::m_last_x [private] |
int agg::scanline::m_last_y [private] |
unsigned agg::scanline::m_max_len [private] |
int agg::scanline::m_min_x [private] |
unsigned agg::scanline::m_num_spans [private] |
int8u** agg::scanline::m_start_ptrs [private] |