osgEarth 2.1.1
Public Member Functions | Private Attributes

agg::renderer< Span > Class Template Reference

#include <AGG.h>

Collaboration diagram for agg::renderer< Span >:

List of all members.

Public Member Functions

 renderer (rendering_buffer &rbuf)
void clear (const rgba8 &c)
void pixel (int x, int y, const rgba8 &c)
rgba8 pixel (int x, int y) const
void render (const scanline &sl, const rgba8 &c)
rendering_bufferrbuf ()

Private Attributes

rendering_bufferm_rbuf
Span m_span

Detailed Description

template<class Span>
class agg::renderer< Span >

Definition at line 406 of file AGG.h.


Constructor & Destructor Documentation

template<class Span>
agg::renderer< Span >::renderer ( rendering_buffer rbuf) [inline]

Definition at line 410 of file AGG.h.

                                         : m_rbuf(&rbuf)
        {
        }

Member Function Documentation

template<class Span>
void agg::renderer< Span >::clear ( const rgba8 c) [inline]

Definition at line 415 of file AGG.h.

        {
            unsigned y;
            for(y = 0; y < m_rbuf->height(); y++)
            {
                m_span.hline(m_rbuf->row(y), 0, m_rbuf->width(), c);
            }
        }
template<class Span>
void agg::renderer< Span >::pixel ( int  x,
int  y,
const rgba8 c 
) [inline]

Definition at line 425 of file AGG.h.

        {
            if(m_rbuf->inbox(x, y))
            {
                m_span.hline(m_rbuf->row(y), x, 1, c);
            }
        }
template<class Span>
rgba8 agg::renderer< Span >::pixel ( int  x,
int  y 
) const [inline]

Definition at line 434 of file AGG.h.

        {
            if(m_rbuf->inbox(x, y))
            {
                return m_span.get(m_rbuf->row(y), x);
            }
            return rgba8(0,0,0);
        }
template<class Span>
rendering_buffer& agg::renderer< Span >::rbuf ( ) [inline]

Definition at line 479 of file AGG.h.

{ return *m_rbuf; }
template<class Span>
void agg::renderer< Span >::render ( const scanline sl,
const rgba8 c 
) [inline]

Definition at line 444 of file AGG.h.

        {
            if(sl.y() < 0 || sl.y() >= int(m_rbuf->height()))
            {
                return;
            }

            unsigned num_spans = sl.num_spans();
            int base_x = sl.base_x();
            unsigned char* row = m_rbuf->row(sl.y());
            scanline::iterator span(sl);

            do
            {
                int x = span.next() + base_x;
                const int8u* covers = span.covers();
                int num_pix = span.num_pix();
                if(x < 0)
                {
                    num_pix += x;
                    if(num_pix <= 0) continue;
                    covers -= x;
                    x = 0;
                }
                if(x + num_pix >= int(m_rbuf->width()))
                {
                    num_pix = m_rbuf->width() - x;
                    if(num_pix <= 0) continue;
                }
                m_span.render(row, x, num_pix, covers, c);
            }
            while(--num_spans);
        }

Member Data Documentation

template<class Span>
rendering_buffer* agg::renderer< Span >::m_rbuf [private]

Definition at line 482 of file AGG.h.

template<class Span>
Span agg::renderer< Span >::m_span [private]

Definition at line 483 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