osgEarth 2.1.1
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends

agg::scanline Class Reference

#include <AGG.h>

List of all members.

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 scanlineoperator= (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
int8um_covers
int8u ** m_start_ptrs
int16um_counts
unsigned m_num_spans
int8u ** m_cur_start_ptr
int16um_cur_count

Friends

class iterator

Detailed Description

Definition at line 276 of file AGG.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
aa_shift 

Definition at line 279 of file AGG.h.

{ aa_shift = 8 };

Constructor & Destructor Documentation

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]

Member Function Documentation

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;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

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;
    }

Here is the call graph for this function:

Here is the caller graph for this function:

int agg::scanline::base_x ( ) const [inline]

Definition at line 318 of file AGG.h.

{ return m_min_x + m_dx;  }

Here is the caller graph for this function:

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);
    }

Here is the caller graph for this function:

unsigned agg::scanline::num_spans ( ) const [inline]

Definition at line 320 of file AGG.h.

{ return m_num_spans;     }

Here is the caller graph for this function:

const scanline& agg::scanline::operator= ( const scanline ) [private]
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;
    }

Here is the caller graph for this function:

void agg::scanline::reset_spans ( ) [inline]

Definition at line 343 of file AGG.h.

Here is the caller graph for this function:

int agg::scanline::y ( ) const [inline]

Definition at line 319 of file AGG.h.

{ return m_last_y + m_dy; }

Here is the caller graph for this function:


Friends And Related Function Documentation

friend class iterator [friend]

Definition at line 307 of file AGG.h.


Member Data Documentation

Definition at line 335 of file AGG.h.

Definition at line 333 of file AGG.h.

Definition at line 338 of file AGG.h.

Definition at line 337 of file AGG.h.

int agg::scanline::m_dx [private]

Definition at line 329 of file AGG.h.

int agg::scanline::m_dy [private]

Definition at line 330 of file AGG.h.

int agg::scanline::m_last_x [private]

Definition at line 331 of file AGG.h.

int agg::scanline::m_last_y [private]

Definition at line 332 of file AGG.h.

unsigned agg::scanline::m_max_len [private]

Definition at line 328 of file AGG.h.

int agg::scanline::m_min_x [private]

Definition at line 327 of file AGG.h.

unsigned agg::scanline::m_num_spans [private]

Definition at line 336 of file AGG.h.

Definition at line 334 of file AGG.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines