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

#include <src/agg/agg_scanline_p.h>

+ Collaboration diagram for agg::scanline32_p8:

Classes

class  const_iterator
 
struct  span
 

Public Types

typedef scanline32_p8 self_type
 
typedef int8u cover_type
 
typedef int32 coord_type
 
typedef pod_bvector< span, 4 > span_array_type
 

Public Member Functions

 scanline32_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

 scanline32_p8 (const self_type &)
 
const self_typeoperator= (const self_type &)
 

Private Attributes

unsigned m_max_len
 
int m_last_x
 
int m_y
 
pod_array< cover_typem_covers
 
cover_typem_cover_ptr
 
span_array_type m_spans
 

Detailed Description

Member Typedef Documentation

◆ coord_type

◆ cover_type

◆ self_type

◆ span_array_type

Constructor & Destructor Documentation

◆ scanline32_p8() [1/2]

agg::scanline32_p8::scanline32_p8 ( )
inline
222 :
223 m_max_len(0),
224 m_last_x(0x7FFFFFF0),
225 m_covers(),
226 m_cover_ptr(0)
227 {
228 }
unsigned m_max_len
Definition agg_scanline_p.h:316
cover_type * m_cover_ptr
Definition agg_scanline_p.h:320
pod_array< cover_type > m_covers
Definition agg_scanline_p.h:319
int m_last_x
Definition agg_scanline_p.h:317

◆ scanline32_p8() [2/2]

agg::scanline32_p8::scanline32_p8 ( const self_type )
private

Member Function Documentation

◆ add_cell()

void agg::scanline32_p8::add_cell ( int  x,
unsigned  cover 
)
inline
245 {
246 *m_cover_ptr = cover_type(cover);
247 if(x == m_last_x+1 && m_spans.size() && m_spans.last().len > 0)
248 {
249 m_spans.last().len++;
250 }
251 else
252 {
253 m_spans.add(span(coord_type(x), 1, m_cover_ptr));
254 }
255 m_last_x = x;
256 m_cover_ptr++;
257 }
const T & last() const
Definition agg_array.h:436
void add(const T &val)
Definition agg_array.h:654
unsigned size() const
Definition agg_array.h:379
int8u cover_type
Definition agg_scanline_p.h:186
int32 coord_type
Definition agg_scanline_p.h:187
span_array_type m_spans
Definition agg_scanline_p.h:321
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297
coord_type len
Definition agg_scanline_p.h:196

References agg::pod_bvector< T, S >::add(), agg::pod_bvector< T, S >::last(), agg::scanline32_p8::span::len, m_cover_ptr, m_last_x, m_spans, and agg::pod_bvector< T, S >::size().

+ Here is the call graph for this function:

◆ add_cells()

void agg::scanline32_p8::add_cells ( int  x,
unsigned  len,
const cover_type covers 
)
inline
261 {
262 memcpy(m_cover_ptr, covers, len * sizeof(cover_type));
263 if(x == m_last_x+1 && m_spans.size() && m_spans.last().len > 0)
264 {
265 m_spans.last().len += coord_type(len);
266 }
267 else
268 {
270 }
271 m_cover_ptr += len;
272 m_last_x = x + len - 1;
273 }

References agg::pod_bvector< T, S >::add(), agg::pod_bvector< T, S >::last(), agg::scanline32_p8::span::len, m_cover_ptr, m_last_x, m_spans, and agg::pod_bvector< T, S >::size().

+ Here is the call graph for this function:

◆ add_span()

void agg::scanline32_p8::add_span ( int  x,
unsigned  len,
unsigned  cover 
)
inline
277 {
278 if(x == m_last_x+1 &&
279 m_spans.size() &&
280 m_spans.last().len < 0 &&
281 cover == *m_spans.last().covers)
282 {
283 m_spans.last().len -= coord_type(len);
284 }
285 else
286 {
287 *m_cover_ptr = cover_type(cover);
288 m_spans.add(span(coord_type(x), -coord_type(len), m_cover_ptr++));
289 }
290 m_last_x = x + len - 1;
291 }
const cover_type * covers
Definition agg_scanline_p.h:197

References agg::pod_bvector< T, S >::add(), agg::scanline32_p8::span::covers, agg::pod_bvector< T, S >::last(), agg::scanline32_p8::span::len, m_cover_ptr, m_last_x, m_spans, and agg::pod_bvector< T, S >::size().

+ Here is the call graph for this function:

◆ begin()

const_iterator agg::scanline32_p8::begin ( ) const
inline
310{ return const_iterator(m_spans); }

References m_spans.

◆ finalize()

void agg::scanline32_p8::finalize ( int  y)
inline
295 {
296 m_y = y;
297 }
int m_y
Definition agg_scanline_p.h:318
int y() const
Definition agg_scanline_p.h:308

References m_y, and y().

+ Here is the call graph for this function:

◆ num_spans()

unsigned agg::scanline32_p8::num_spans ( ) const
inline
309{ return m_spans.size(); }

References m_spans, and agg::pod_bvector< T, S >::size().

+ Here is the call graph for this function:

◆ operator=()

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

◆ reset()

void agg::scanline32_p8::reset ( int  min_x,
int  max_x 
)
inline
232 {
233 unsigned max_len = max_x - min_x + 3;
234 if(max_len > m_covers.size())
235 {
236 m_covers.resize(max_len);
237 }
238 m_last_x = 0x7FFFFFF0;
239 m_cover_ptr = &m_covers[0];
241 }
unsigned size() const
Definition agg_array.h:142
void resize(unsigned size)
Definition agg_array.h:127
void remove_all()
Definition agg_array.h:346

References m_cover_ptr, m_covers, m_last_x, m_spans, agg::pod_bvector< T, S >::remove_all(), agg::pod_array< T >::resize(), and agg::pod_array< T >::size().

+ Here is the call graph for this function:

◆ reset_spans()

void agg::scanline32_p8::reset_spans ( )
inline
301 {
302 m_last_x = 0x7FFFFFF0;
303 m_cover_ptr = &m_covers[0];
305 }

References m_cover_ptr, m_covers, m_last_x, m_spans, and agg::pod_bvector< T, S >::remove_all().

+ Here is the call graph for this function:

◆ y()

int agg::scanline32_p8::y ( ) const
inline
308{ 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::scanline32_p8::m_cover_ptr
private

◆ m_covers

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

Referenced by reset(), and reset_spans().

◆ m_last_x

int agg::scanline32_p8::m_last_x
private

◆ m_max_len

unsigned agg::scanline32_p8::m_max_len
private

◆ m_spans

span_array_type agg::scanline32_p8::m_spans
private

◆ m_y

int agg::scanline32_p8::m_y
private

Referenced by finalize(), and y().


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