Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
agg::scanline_p8 Class Reference

#include <src/agg/agg_scanline_p.h>

+ Collaboration diagram for agg::scanline_p8:

Classes

struct  span
 

Public Types

typedef scanline_p8 self_type
 
typedef int8u cover_type
 
typedef int16 coord_type
 
typedef spaniterator
 
typedef const spanconst_iterator
 

Public Member Functions

 scanline_p8 ()
 
void reset (int min_x, int max_x)
 
void add_cell (int x, unsigned cover)
 
void add_cells (int x, unsigned len, const cover_type *covers)
 
void add_span (int x, unsigned len, unsigned cover)
 
void finalize (int y)
 
void reset_spans ()
 
int y () const
 
unsigned num_spans () const
 
const_iterator begin () const
 

Private Member Functions

 scanline_p8 (const self_type &)
 
const self_typeoperator= (const self_type &)
 

Private Attributes

int m_last_x
 
int m_y
 
pod_array< cover_typem_covers
 
cover_typem_cover_ptr
 
pod_array< spanm_spans
 
spanm_cur_span
 

Detailed Description


Class Documentation

◆ agg::scanline_p8::span

struct agg::scanline_p8::span
Class Members
const cover_type * covers
coord_type len
coord_type x

Member Typedef Documentation

◆ const_iterator

◆ coord_type

◆ cover_type

◆ iterator

◆ self_type

Constructor & Destructor Documentation

◆ scanline_p8() [1/2]

agg::scanline_p8::scanline_p8 ( )
inline
60 :
61 m_last_x(0x7FFFFFF0),
62 m_covers(),
63 m_cover_ptr(0),
64 m_spans(),
65 m_cur_span(0)
66 {
67 }
pod_array< span > m_spans
Definition agg_scanline_p.h:170
pod_array< cover_type > m_covers
Definition agg_scanline_p.h:168
span * m_cur_span
Definition agg_scanline_p.h:171
cover_type * m_cover_ptr
Definition agg_scanline_p.h:169
int m_last_x
Definition agg_scanline_p.h:166

◆ scanline_p8() [2/2]

agg::scanline_p8::scanline_p8 ( const self_type )
private

Member Function Documentation

◆ add_cell()

void agg::scanline_p8::add_cell ( int  x,
unsigned  cover 
)
inline
86 {
87 *m_cover_ptr = (cover_type)cover;
88 if(x == m_last_x+1 && m_cur_span->len > 0)
89 {
90 m_cur_span->len++;
91 }
92 else
93 {
94 m_cur_span++;
96 m_cur_span->x = (int16)x;
97 m_cur_span->len = 1;
98 }
99 m_last_x = x;
100 m_cover_ptr++;
101 }
coord_type x
Definition agg_scanline_p.h:52
coord_type len
Definition agg_scanline_p.h:53
const cover_type * covers
Definition agg_scanline_p.h:54
int8u cover_type
Definition agg_scanline_p.h:46
AGG_INT16 int16
Definition agg_basics.h:121
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References agg::scanline_p8::span::covers, agg::scanline_p8::span::len, m_cover_ptr, m_cur_span, m_last_x, and agg::scanline_p8::span::x.

◆ add_cells()

void agg::scanline_p8::add_cells ( int  x,
unsigned  len,
const cover_type covers 
)
inline
105 {
106 memcpy(m_cover_ptr, covers, len * sizeof(cover_type));
107 if(x == m_last_x+1 && m_cur_span->len > 0)
108 {
109 m_cur_span->len += (int16)len;
110 }
111 else
112 {
113 m_cur_span++;
115 m_cur_span->x = (int16)x;
116 m_cur_span->len = (int16)len;
117 }
118 m_cover_ptr += len;
119 m_last_x = x + len - 1;
120 }

References agg::scanline_p8::span::covers, agg::scanline_p8::span::len, m_cover_ptr, m_cur_span, m_last_x, and agg::scanline_p8::span::x.

◆ add_span()

void agg::scanline_p8::add_span ( int  x,
unsigned  len,
unsigned  cover 
)
inline
124 {
125 if(x == m_last_x+1 &&
126 m_cur_span->len < 0 &&
127 cover == *m_cur_span->covers)
128 {
129 m_cur_span->len -= (int16)len;
130 }
131 else
132 {
133 *m_cover_ptr = (cover_type)cover;
134 m_cur_span++;
136 m_cur_span->x = (int16)x;
137 m_cur_span->len = (int16)(-int(len));
138 }
139 m_last_x = x + len - 1;
140 }

References agg::scanline_p8::span::covers, agg::scanline_p8::span::len, m_cover_ptr, m_cur_span, m_last_x, and agg::scanline_p8::span::x.

◆ begin()

const_iterator agg::scanline_p8::begin ( ) const
inline
160{ return &m_spans[1]; }

References m_spans.

◆ finalize()

void agg::scanline_p8::finalize ( int  y)
inline
144 {
145 m_y = y;
146 }
int y() const
Definition agg_scanline_p.h:158
int m_y
Definition agg_scanline_p.h:167

References m_y, and y().

+ Here is the call graph for this function:

◆ num_spans()

unsigned agg::scanline_p8::num_spans ( ) const
inline
159{ return unsigned(m_cur_span - &m_spans[0]); }

References m_cur_span, and m_spans.

◆ operator=()

const self_type & agg::scanline_p8::operator= ( const self_type )
private

◆ reset()

void agg::scanline_p8::reset ( int  min_x,
int  max_x 
)
inline
71 {
72 unsigned max_len = max_x - min_x + 3;
73 if(max_len > m_spans.size())
74 {
75 m_spans.resize(max_len);
76 m_covers.resize(max_len);
77 }
78 m_last_x = 0x7FFFFFF0;
80 m_cur_span = &m_spans[0];
81 m_cur_span->len = 0;
82 }
void resize(unsigned size)
Definition agg_array.h:127

References agg::scanline_p8::span::len, m_cover_ptr, m_covers, m_cur_span, m_last_x, m_spans, and agg::pod_array< T >::resize().

+ Here is the call graph for this function:

◆ reset_spans()

void agg::scanline_p8::reset_spans ( )
inline
150 {
151 m_last_x = 0x7FFFFFF0;
152 m_cover_ptr = &m_covers[0];
153 m_cur_span = &m_spans[0];
154 m_cur_span->len = 0;
155 }

References agg::scanline_p8::span::len, m_cover_ptr, m_covers, m_cur_span, m_last_x, and m_spans.

◆ y()

int agg::scanline_p8::y ( ) const
inline
158{ return m_y; }

References m_y.

Referenced by finalize().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cover_ptr

cover_type* agg::scanline_p8::m_cover_ptr
private

◆ m_covers

pod_array<cover_type> agg::scanline_p8::m_covers
private

Referenced by reset(), and reset_spans().

◆ m_cur_span

span* agg::scanline_p8::m_cur_span
private

◆ m_last_x

int agg::scanline_p8::m_last_x
private

◆ m_spans

pod_array<span> agg::scanline_p8::m_spans
private

Referenced by begin(), num_spans(), reset(), and reset_spans().

◆ m_y

int agg::scanline_p8::m_y
private

Referenced by finalize(), and y().


The documentation for this class was generated from the following file: