Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
agg::renderer_base< PixelFormat > Class Template Reference

#include <src/agg/agg_renderer_base.h>

+ Inheritance diagram for agg::renderer_base< PixelFormat >:
+ Collaboration diagram for agg::renderer_base< PixelFormat >:

Public Types

typedef PixelFormat pixfmt_type
 
typedef pixfmt_type::color_type color_type
 
typedef pixfmt_type::row_data row_data
 

Public Member Functions

 renderer_base ()
 
 renderer_base (pixfmt_type &ren)
 
void attach (pixfmt_type &ren)
 
const pixfmt_typeren () const
 
pixfmt_typeren ()
 
unsigned width () const
 
unsigned height () const
 
bool clip_box (int x1, int y1, int x2, int y2)
 
void reset_clipping (bool visibility)
 
void clip_box_naked (int x1, int y1, int x2, int y2)
 
bool inbox (int x, int y) const
 
const rect_iclip_box () const
 
int xmin () const
 
int ymin () const
 
int xmax () const
 
int ymax () const
 
const rect_ibounding_clip_box () const
 
int bounding_xmin () const
 
int bounding_ymin () const
 
int bounding_xmax () const
 
int bounding_ymax () const
 
void clear (const color_type &c)
 
void fill (const color_type &c)
 
void copy_pixel (int x, int y, const color_type &c)
 
void blend_pixel (int x, int y, const color_type &c, cover_type cover)
 
color_type pixel (int x, int y) const
 
void copy_hline (int x1, int y, int x2, const color_type &c)
 
void copy_vline (int x, int y1, int y2, const color_type &c)
 
void blend_hline (int x1, int y, int x2, const color_type &c, cover_type cover)
 
void blend_vline (int x, int y1, int y2, const color_type &c, cover_type cover)
 
void copy_bar (int x1, int y1, int x2, int y2, const color_type &c)
 
void blend_bar (int x1, int y1, int x2, int y2, const color_type &c, cover_type cover)
 
void blend_solid_hspan (int x, int y, int len, const color_type &c, const cover_type *covers)
 
void blend_solid_vspan (int x, int y, int len, const color_type &c, const cover_type *covers)
 
void copy_color_hspan (int x, int y, int len, const color_type *colors)
 
void copy_color_vspan (int x, int y, int len, const color_type *colors)
 
void blend_color_hspan (int x, int y, int len, const color_type *colors, const cover_type *covers, cover_type cover=agg::cover_full)
 
void blend_color_vspan (int x, int y, int len, const color_type *colors, const cover_type *covers, cover_type cover=agg::cover_full)
 
rect_i clip_rect_area (rect_i &dst, rect_i &src, int wsrc, int hsrc) const
 
template<class RenBuf >
void copy_from (const RenBuf &src, const rect_i *rect_src_ptr=0, int dx=0, int dy=0)
 
template<class SrcPixelFormatRenderer >
void blend_from (const SrcPixelFormatRenderer &src, const rect_i *rect_src_ptr=0, int dx=0, int dy=0, cover_type cover=agg::cover_full)
 
template<class SrcPixelFormatRenderer >
void blend_from_color (const SrcPixelFormatRenderer &src, const color_type &color, const rect_i *rect_src_ptr=0, int dx=0, int dy=0, cover_type cover=agg::cover_full)
 
template<class SrcPixelFormatRenderer >
void blend_from_lut (const SrcPixelFormatRenderer &src, const color_type *color_lut, const rect_i *rect_src_ptr=0, int dx=0, int dy=0, cover_type cover=agg::cover_full)
 

Private Attributes

pixfmt_typem_ren
 
rect_i m_clip_box
 

Detailed Description

template<class PixelFormat>
class agg::renderer_base< PixelFormat >

Member Typedef Documentation

◆ color_type

template<class PixelFormat >
typedef pixfmt_type::color_type agg::renderer_base< PixelFormat >::color_type

◆ pixfmt_type

template<class PixelFormat >
typedef PixelFormat agg::renderer_base< PixelFormat >::pixfmt_type

◆ row_data

template<class PixelFormat >
typedef pixfmt_type::row_data agg::renderer_base< PixelFormat >::row_data

Constructor & Destructor Documentation

◆ renderer_base() [1/2]

template<class PixelFormat >
agg::renderer_base< PixelFormat >::renderer_base ( )
inline
38: m_ren(0), m_clip_box(1, 1, 0, 0) {}
pixfmt_type * m_ren
Definition agg_renderer_base.h:724
rect_i m_clip_box
Definition agg_renderer_base.h:725

◆ renderer_base() [2/2]

template<class PixelFormat >
agg::renderer_base< PixelFormat >::renderer_base ( pixfmt_type ren)
inlineexplicit
39 :
40 m_ren(&ren),
41 m_clip_box(0, 0, ren.width() - 1, ren.height() - 1)
42 {}
const pixfmt_type & ren() const
Definition agg_renderer_base.h:50

Member Function Documentation

◆ attach()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::attach ( pixfmt_type ren)
inline
44 {
45 m_ren = &ren;
46 m_clip_box = rect_i(0, 0, ren.width() - 1, ren.height() - 1);
47 }
rect_base< int > rect_i
Definition agg_basics.h:363

References agg::renderer_base< PixelFormat >::m_clip_box, agg::renderer_base< PixelFormat >::m_ren, and agg::renderer_base< PixelFormat >::ren().

+ Here is the call graph for this function:

◆ blend_bar()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_bar ( int  x1,
int  y1,
int  x2,
int  y2,
const color_type c,
cover_type  cover 
)
inline
257 {
258 rect_i rc(x1, y1, x2, y2);
259 rc.normalize();
260 if(rc.clip(clip_box()))
261 {
262 int y;
263 for(y = rc.y1; y <= rc.y2; y++)
264 {
265 m_ren->blend_hline(rc.x1,
266 y,
267 unsigned(rc.x2 - rc.x1 + 1),
268 c,
269 cover);
270 }
271 }
272 }
const rect_i & clip_box() const
Definition agg_renderer_base.h:110
const Scalar & y
Definition MathFunctions.h:552

References agg::rect_base< T >::clip(), agg::renderer_base< PixelFormat >::clip_box(), agg::renderer_base< PixelFormat >::m_ren, agg::rect_base< T >::normalize(), agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ blend_color_hspan()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_color_hspan ( int  x,
int  y,
int  len,
const color_type colors,
const cover_type covers,
cover_type  cover = agg::cover_full 
)
inline
372 {
373 if(y > ymax()) return;
374 if(y < ymin()) return;
375
376 if(x < xmin())
377 {
378 int d = xmin() - x;
379 len -= d;
380 if(len <= 0) return;
381 if(covers) covers += d;
382 colors += d;
383 x = xmin();
384 }
385 if(x + len > xmax())
386 {
387 len = xmax() - x + 1;
388 if(len <= 0) return;
389 }
390 m_ren->blend_color_hspan(x, y, len, colors, covers, cover);
391 }
int ymin() const
Definition agg_renderer_base.h:112
int ymax() const
Definition agg_renderer_base.h:114
int xmax() const
Definition agg_renderer_base.h:113
int xmin() const
Definition agg_renderer_base.h:111
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ blend_color_vspan()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_color_vspan ( int  x,
int  y,
int  len,
const color_type colors,
const cover_type covers,
cover_type  cover = agg::cover_full 
)
inline
398 {
399 if(x > xmax()) return;
400 if(x < xmin()) return;
401
402 if(y < ymin())
403 {
404 int d = ymin() - y;
405 len -= d;
406 if(len <= 0) return;
407 if(covers) covers += d;
408 colors += d;
409 y = ymin();
410 }
411 if(y + len > ymax())
412 {
413 len = ymax() - y + 1;
414 if(len <= 0) return;
415 }
416 m_ren->blend_color_vspan(x, y, len, colors, covers, cover);
417 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ blend_from()

template<class PixelFormat >
template<class SrcPixelFormatRenderer >
void agg::renderer_base< PixelFormat >::blend_from ( const SrcPixelFormatRenderer &  src,
const rect_i rect_src_ptr = 0,
int  dx = 0,
int  dy = 0,
cover_type  cover = agg::cover_full 
)
inline
516 {
517 rect_i rsrc(0, 0, src.width(), src.height());
518 if(rect_src_ptr)
519 {
520 rsrc.x1 = rect_src_ptr->x1;
521 rsrc.y1 = rect_src_ptr->y1;
522 rsrc.x2 = rect_src_ptr->x2 + 1;
523 rsrc.y2 = rect_src_ptr->y2 + 1;
524 }
525
526 // Version with xdst, ydst (absolute positioning)
527 //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1);
528
529 // Version with dx, dy (relative positioning)
530 rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy);
531 rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height());
532
533 if(rc.x2 > 0)
534 {
535 int incy = 1;
536 if(rdst.y1 > rsrc.y1)
537 {
538 rsrc.y1 += rc.y2 - 1;
539 rdst.y1 += rc.y2 - 1;
540 incy = -1;
541 }
542 while(rc.y2 > 0)
543 {
544 typename SrcPixelFormatRenderer::row_data rw = src.row(rsrc.y1);
545 if(rw.ptr)
546 {
547 int x1src = rsrc.x1;
548 int x1dst = rdst.x1;
549 int len = rc.x2;
550 if(rw.x1 > x1src)
551 {
552 x1dst += rw.x1 - x1src;
553 len -= rw.x1 - x1src;
554 x1src = rw.x1;
555 }
556 if(len > 0)
557 {
558 if(x1src + len-1 > rw.x2)
559 {
560 len -= x1src + len - rw.x2 - 1;
561 }
562 if(len > 0)
563 {
564 m_ren->blend_from(src,
565 x1dst, rdst.y1,
566 x1src, rsrc.y1,
567 len,
568 cover);
569 }
570 }
571 }
572 rdst.y1 += incy;
573 rsrc.y1 += incy;
574 --rc.y2;
575 }
576 }
577 }
rect_i clip_rect_area(rect_i &dst, rect_i &src, int wsrc, int hsrc) const
Definition agg_renderer_base.h:420

References agg::renderer_base< PixelFormat >::clip_rect_area(), agg::renderer_base< PixelFormat >::m_ren, agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ blend_from_color()

template<class PixelFormat >
template<class SrcPixelFormatRenderer >
void agg::renderer_base< PixelFormat >::blend_from_color ( const SrcPixelFormatRenderer &  src,
const color_type color,
const rect_i rect_src_ptr = 0,
int  dx = 0,
int  dy = 0,
cover_type  cover = agg::cover_full 
)
inline
587 {
588 rect_i rsrc(0, 0, src.width(), src.height());
589 if(rect_src_ptr)
590 {
591 rsrc.x1 = rect_src_ptr->x1;
592 rsrc.y1 = rect_src_ptr->y1;
593 rsrc.x2 = rect_src_ptr->x2 + 1;
594 rsrc.y2 = rect_src_ptr->y2 + 1;
595 }
596
597 // Version with xdst, ydst (absolute positioning)
598 //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1);
599
600 // Version with dx, dy (relative positioning)
601 rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy);
602 rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height());
603
604 if(rc.x2 > 0)
605 {
606 int incy = 1;
607 if(rdst.y1 > rsrc.y1)
608 {
609 rsrc.y1 += rc.y2 - 1;
610 rdst.y1 += rc.y2 - 1;
611 incy = -1;
612 }
613 while(rc.y2 > 0)
614 {
615 typename SrcPixelFormatRenderer::row_data rw = src.row(rsrc.y1);
616 if(rw.ptr)
617 {
618 int x1src = rsrc.x1;
619 int x1dst = rdst.x1;
620 int len = rc.x2;
621 if(rw.x1 > x1src)
622 {
623 x1dst += rw.x1 - x1src;
624 len -= rw.x1 - x1src;
625 x1src = rw.x1;
626 }
627 if(len > 0)
628 {
629 if(x1src + len-1 > rw.x2)
630 {
631 len -= x1src + len - rw.x2 - 1;
632 }
633 if(len > 0)
634 {
635 m_ren->blend_from_color(src,
636 color,
637 x1dst, rdst.y1,
638 x1src, rsrc.y1,
639 len,
640 cover);
641 }
642 }
643 }
644 rdst.y1 += incy;
645 rsrc.y1 += incy;
646 --rc.y2;
647 }
648 }
649 }

References agg::renderer_base< PixelFormat >::clip_rect_area(), agg::renderer_base< PixelFormat >::m_ren, agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ blend_from_lut()

template<class PixelFormat >
template<class SrcPixelFormatRenderer >
void agg::renderer_base< PixelFormat >::blend_from_lut ( const SrcPixelFormatRenderer &  src,
const color_type color_lut,
const rect_i rect_src_ptr = 0,
int  dx = 0,
int  dy = 0,
cover_type  cover = agg::cover_full 
)
inline
659 {
660 rect_i rsrc(0, 0, src.width(), src.height());
661 if(rect_src_ptr)
662 {
663 rsrc.x1 = rect_src_ptr->x1;
664 rsrc.y1 = rect_src_ptr->y1;
665 rsrc.x2 = rect_src_ptr->x2 + 1;
666 rsrc.y2 = rect_src_ptr->y2 + 1;
667 }
668
669 // Version with xdst, ydst (absolute positioning)
670 //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1);
671
672 // Version with dx, dy (relative positioning)
673 rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy);
674 rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height());
675
676 if(rc.x2 > 0)
677 {
678 int incy = 1;
679 if(rdst.y1 > rsrc.y1)
680 {
681 rsrc.y1 += rc.y2 - 1;
682 rdst.y1 += rc.y2 - 1;
683 incy = -1;
684 }
685 while(rc.y2 > 0)
686 {
687 typename SrcPixelFormatRenderer::row_data rw = src.row(rsrc.y1);
688 if(rw.ptr)
689 {
690 int x1src = rsrc.x1;
691 int x1dst = rdst.x1;
692 int len = rc.x2;
693 if(rw.x1 > x1src)
694 {
695 x1dst += rw.x1 - x1src;
696 len -= rw.x1 - x1src;
697 x1src = rw.x1;
698 }
699 if(len > 0)
700 {
701 if(x1src + len-1 > rw.x2)
702 {
703 len -= x1src + len - rw.x2 - 1;
704 }
705 if(len > 0)
706 {
707 m_ren->blend_from_lut(src,
708 color_lut,
709 x1dst, rdst.y1,
710 x1src, rsrc.y1,
711 len,
712 cover);
713 }
714 }
715 }
716 rdst.y1 += incy;
717 rsrc.y1 += incy;
718 --rc.y2;
719 }
720 }
721 }

References agg::renderer_base< PixelFormat >::clip_rect_area(), agg::renderer_base< PixelFormat >::m_ren, agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ blend_hline()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_hline ( int  x1,
int  y,
int  x2,
const color_type c,
cover_type  cover 
)
inline
209 {
210 if(x1 > x2) { int t = x2; x2 = x1; x1 = t; }
211 if(y > ymax()) return;
212 if(y < ymin()) return;
213 if(x1 > xmax()) return;
214 if(x2 < xmin()) return;
215
216 if(x1 < xmin()) x1 = xmin();
217 if(x2 > xmax()) x2 = xmax();
218
219 m_ren->blend_hline(x1, y, x2 - x1 + 1, c, cover);
220 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ blend_pixel()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_pixel ( int  x,
int  y,
const color_type c,
cover_type  cover 
)
inline
161 {
162 if(inbox(x, y))
163 {
164 m_ren->blend_pixel(x, y, c, cover);
165 }
166 }
bool inbox(int x, int y) const
Definition agg_renderer_base.h:103

References agg::renderer_base< PixelFormat >::inbox(), and agg::renderer_base< PixelFormat >::m_ren.

+ Here is the call graph for this function:

◆ blend_solid_hspan()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_solid_hspan ( int  x,
int  y,
int  len,
const color_type c,
const cover_type covers 
)
inline
278 {
279 if(y > ymax()) return;
280 if(y < ymin()) return;
281
282 if(x < xmin())
283 {
284 len -= xmin() - x;
285 if(len <= 0) return;
286 covers += xmin() - x;
287 x = xmin();
288 }
289 if(x + len > xmax())
290 {
291 len = xmax() - x + 1;
292 if(len <= 0) return;
293 }
294 m_ren->blend_solid_hspan(x, y, len, c, covers);
295 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ blend_solid_vspan()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_solid_vspan ( int  x,
int  y,
int  len,
const color_type c,
const cover_type covers 
)
inline
301 {
302 if(x > xmax()) return;
303 if(x < xmin()) return;
304
305 if(y < ymin())
306 {
307 len -= ymin() - y;
308 if(len <= 0) return;
309 covers += ymin() - y;
310 y = ymin();
311 }
312 if(y + len > ymax())
313 {
314 len = ymax() - y + 1;
315 if(len <= 0) return;
316 }
317 m_ren->blend_solid_vspan(x, y, len, c, covers);
318 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ blend_vline()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::blend_vline ( int  x,
int  y1,
int  y2,
const color_type c,
cover_type  cover 
)
inline
225 {
226 if(y1 > y2) { int t = y2; y2 = y1; y1 = t; }
227 if(x > xmax()) return;
228 if(x < xmin()) return;
229 if(y1 > ymax()) return;
230 if(y2 < ymin()) return;
231
232 if(y1 < ymin()) y1 = ymin();
233 if(y2 > ymax()) y2 = ymax();
234
235 m_ren->blend_vline(x, y1, y2 - y1 + 1, c, cover);
236 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ bounding_clip_box()

template<class PixelFormat >
const rect_i & agg::renderer_base< PixelFormat >::bounding_clip_box ( ) const
inline

◆ bounding_xmax()

template<class PixelFormat >
int agg::renderer_base< PixelFormat >::bounding_xmax ( ) const
inline
120{ return m_clip_box.x2; }
T x2
Definition agg_basics.h:287

References agg::renderer_base< PixelFormat >::m_clip_box, and agg::rect_base< T >::x2.

◆ bounding_xmin()

template<class PixelFormat >
int agg::renderer_base< PixelFormat >::bounding_xmin ( ) const
inline
118{ return m_clip_box.x1; }
T x1
Definition agg_basics.h:287

References agg::renderer_base< PixelFormat >::m_clip_box, and agg::rect_base< T >::x1.

◆ bounding_ymax()

template<class PixelFormat >
int agg::renderer_base< PixelFormat >::bounding_ymax ( ) const
inline
121{ return m_clip_box.y2; }
T y2
Definition agg_basics.h:287

References agg::renderer_base< PixelFormat >::m_clip_box, and agg::rect_base< T >::y2.

◆ bounding_ymin()

template<class PixelFormat >
int agg::renderer_base< PixelFormat >::bounding_ymin ( ) const
inline
119{ return m_clip_box.y1; }
T y1
Definition agg_basics.h:287

References agg::renderer_base< PixelFormat >::m_clip_box, and agg::rect_base< T >::y1.

◆ clear()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::clear ( const color_type c)
inline
125 {
126 unsigned y;
127 if(width())
128 {
129 for(y = 0; y < height(); y++)
130 {
131 m_ren->copy_hline(0, y, width(), c);
132 }
133 }
134 }
unsigned width() const
Definition agg_renderer_base.h:54
unsigned height() const
Definition agg_renderer_base.h:55

References agg::renderer_base< PixelFormat >::height(), agg::renderer_base< PixelFormat >::m_ren, and agg::renderer_base< PixelFormat >::width().

Referenced by Slic3r::sla::AGGRaster< PixelRenderer, Renderer, Rasterizer, Scanline >::clear(), and Slic3r::rasterize_polygons().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clip_box() [1/2]

template<class PixelFormat >
const rect_i & agg::renderer_base< PixelFormat >::clip_box ( ) const
inline
110{ return m_clip_box; }

References agg::renderer_base< PixelFormat >::m_clip_box.

Referenced by agg::renderer_base< PixelFormat >::blend_bar(), agg::renderer_base< PixelFormat >::clip_rect_area(), and agg::renderer_base< PixelFormat >::copy_bar().

+ Here is the caller graph for this function:

◆ clip_box() [2/2]

template<class PixelFormat >
bool agg::renderer_base< PixelFormat >::clip_box ( int  x1,
int  y1,
int  x2,
int  y2 
)
inline
59 {
60 rect_i cb(x1, y1, x2, y2);
61 cb.normalize();
62 if(cb.clip(rect_i(0, 0, width() - 1, height() - 1)))
63 {
64 m_clip_box = cb;
65 return true;
66 }
67 m_clip_box.x1 = 1;
68 m_clip_box.y1 = 1;
69 m_clip_box.x2 = 0;
70 m_clip_box.y2 = 0;
71 return false;
72 }

References agg::rect_base< T >::clip(), agg::renderer_base< PixelFormat >::height(), agg::renderer_base< PixelFormat >::m_clip_box, agg::rect_base< T >::normalize(), agg::renderer_base< PixelFormat >::width(), agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ clip_box_naked()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::clip_box_naked ( int  x1,
int  y1,
int  x2,
int  y2 
)
inline

◆ clip_rect_area()

template<class PixelFormat >
rect_i agg::renderer_base< PixelFormat >::clip_rect_area ( rect_i dst,
rect_i src,
int  wsrc,
int  hsrc 
) const
inline
421 {
422 rect_i rc(0,0,0,0);
423 rect_i cb = clip_box();
424 ++cb.x2;
425 ++cb.y2;
426
427 if(src.x1 < 0)
428 {
429 dst.x1 -= src.x1;
430 src.x1 = 0;
431 }
432 if(src.y1 < 0)
433 {
434 dst.y1 -= src.y1;
435 src.y1 = 0;
436 }
437
438 if(src.x2 > wsrc) src.x2 = wsrc;
439 if(src.y2 > hsrc) src.y2 = hsrc;
440
441 if(dst.x1 < cb.x1)
442 {
443 src.x1 += cb.x1 - dst.x1;
444 dst.x1 = cb.x1;
445 }
446 if(dst.y1 < cb.y1)
447 {
448 src.y1 += cb.y1 - dst.y1;
449 dst.y1 = cb.y1;
450 }
451
452 if(dst.x2 > cb.x2) dst.x2 = cb.x2;
453 if(dst.y2 > cb.y2) dst.y2 = cb.y2;
454
455 rc.x2 = dst.x2 - dst.x1;
456 rc.y2 = dst.y2 - dst.y1;
457
458 if(rc.x2 > src.x2 - src.x1) rc.x2 = src.x2 - src.x1;
459 if(rc.y2 > src.y2 - src.y1) rc.y2 = src.y2 - src.y1;
460 return rc;
461 }

References agg::renderer_base< PixelFormat >::clip_box(), agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

Referenced by agg::renderer_base< PixelFormat >::blend_from(), agg::renderer_base< PixelFormat >::blend_from_color(), agg::renderer_base< PixelFormat >::blend_from_lut(), and agg::renderer_base< PixelFormat >::copy_from().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ copy_bar()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::copy_bar ( int  x1,
int  y1,
int  x2,
int  y2,
const color_type c 
)
inline
241 {
242 rect_i rc(x1, y1, x2, y2);
243 rc.normalize();
244 if(rc.clip(clip_box()))
245 {
246 int y;
247 for(y = rc.y1; y <= rc.y2; y++)
248 {
249 m_ren->copy_hline(rc.x1, y, unsigned(rc.x2 - rc.x1 + 1), c);
250 }
251 }
252 }

References agg::rect_base< T >::clip(), agg::renderer_base< PixelFormat >::clip_box(), agg::renderer_base< PixelFormat >::m_ren, agg::rect_base< T >::normalize(), agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ copy_color_hspan()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::copy_color_hspan ( int  x,
int  y,
int  len,
const color_type colors 
)
inline
323 {
324 if(y > ymax()) return;
325 if(y < ymin()) return;
326
327 if(x < xmin())
328 {
329 int d = xmin() - x;
330 len -= d;
331 if(len <= 0) return;
332 colors += d;
333 x = xmin();
334 }
335 if(x + len > xmax())
336 {
337 len = xmax() - x + 1;
338 if(len <= 0) return;
339 }
340 m_ren->copy_color_hspan(x, y, len, colors);
341 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ copy_color_vspan()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::copy_color_vspan ( int  x,
int  y,
int  len,
const color_type colors 
)
inline
346 {
347 if(x > xmax()) return;
348 if(x < xmin()) return;
349
350 if(y < ymin())
351 {
352 int d = ymin() - y;
353 len -= d;
354 if(len <= 0) return;
355 colors += d;
356 y = ymin();
357 }
358 if(y + len > ymax())
359 {
360 len = ymax() - y + 1;
361 if(len <= 0) return;
362 }
363 m_ren->copy_color_vspan(x, y, len, colors);
364 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ copy_from()

template<class PixelFormat >
template<class RenBuf >
void agg::renderer_base< PixelFormat >::copy_from ( const RenBuf &  src,
const rect_i rect_src_ptr = 0,
int  dx = 0,
int  dy = 0 
)
inline
469 {
470 rect_i rsrc(0, 0, src.width(), src.height());
471 if(rect_src_ptr)
472 {
473 rsrc.x1 = rect_src_ptr->x1;
474 rsrc.y1 = rect_src_ptr->y1;
475 rsrc.x2 = rect_src_ptr->x2 + 1;
476 rsrc.y2 = rect_src_ptr->y2 + 1;
477 }
478
479 // Version with xdst, ydst (absolute positioning)
480 //rect_i rdst(xdst, ydst, xdst + rsrc.x2 - rsrc.x1, ydst + rsrc.y2 - rsrc.y1);
481
482 // Version with dx, dy (relative positioning)
483 rect_i rdst(rsrc.x1 + dx, rsrc.y1 + dy, rsrc.x2 + dx, rsrc.y2 + dy);
484
485 rect_i rc = clip_rect_area(rdst, rsrc, src.width(), src.height());
486
487 if(rc.x2 > 0)
488 {
489 int incy = 1;
490 if(rdst.y1 > rsrc.y1)
491 {
492 rsrc.y1 += rc.y2 - 1;
493 rdst.y1 += rc.y2 - 1;
494 incy = -1;
495 }
496 while(rc.y2 > 0)
497 {
498 m_ren->copy_from(src,
499 rdst.x1, rdst.y1,
500 rsrc.x1, rsrc.y1,
501 rc.x2);
502 rdst.y1 += incy;
503 rsrc.y1 += incy;
504 --rc.y2;
505 }
506 }
507 }

References agg::renderer_base< PixelFormat >::clip_rect_area(), agg::renderer_base< PixelFormat >::m_ren, agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ copy_hline()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::copy_hline ( int  x1,
int  y,
int  x2,
const color_type c 
)
inline
178 {
179 if(x1 > x2) { int t = x2; x2 = x1; x1 = t; }
180 if(y > ymax()) return;
181 if(y < ymin()) return;
182 if(x1 > xmax()) return;
183 if(x2 < xmin()) return;
184
185 if(x1 < xmin()) x1 = xmin();
186 if(x2 > xmax()) x2 = xmax();
187
188 m_ren->copy_hline(x1, y, x2 - x1 + 1, c);
189 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ copy_pixel()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::copy_pixel ( int  x,
int  y,
const color_type c 
)
inline
152 {
153 if(inbox(x, y))
154 {
155 m_ren->copy_pixel(x, y, c);
156 }
157 }

References agg::renderer_base< PixelFormat >::inbox(), and agg::renderer_base< PixelFormat >::m_ren.

+ Here is the call graph for this function:

◆ copy_vline()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::copy_vline ( int  x,
int  y1,
int  y2,
const color_type c 
)
inline
193 {
194 if(y1 > y2) { int t = y2; y2 = y1; y1 = t; }
195 if(x > xmax()) return;
196 if(x < xmin()) return;
197 if(y1 > ymax()) return;
198 if(y2 < ymin()) return;
199
200 if(y1 < ymin()) y1 = ymin();
201 if(y2 > ymax()) y2 = ymax();
202
203 m_ren->copy_vline(x, y1, y2 - y1 + 1, c);
204 }

References agg::renderer_base< PixelFormat >::m_ren, agg::renderer_base< PixelFormat >::xmax(), agg::renderer_base< PixelFormat >::xmin(), agg::renderer_base< PixelFormat >::ymax(), and agg::renderer_base< PixelFormat >::ymin().

+ Here is the call graph for this function:

◆ fill()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::fill ( const color_type c)
inline
139 {
140 unsigned y;
141 if(width())
142 {
143 for(y = 0; y < height(); y++)
144 {
145 m_ren->blend_hline(0, y, width(), c, cover_mask);
146 }
147 }
148 }
@ cover_mask
Definition agg_basics.h:242

References agg::cover_mask, agg::renderer_base< PixelFormat >::height(), agg::renderer_base< PixelFormat >::m_ren, and agg::renderer_base< PixelFormat >::width().

+ Here is the call graph for this function:

◆ height()

template<class PixelFormat >
unsigned agg::renderer_base< PixelFormat >::height ( ) const
inline
55{ return m_ren->height(); }

References agg::renderer_base< PixelFormat >::m_ren.

Referenced by agg::renderer_base< PixelFormat >::clear(), agg::renderer_base< PixelFormat >::clip_box(), agg::renderer_base< PixelFormat >::fill(), and agg::renderer_base< PixelFormat >::reset_clipping().

+ Here is the caller graph for this function:

◆ inbox()

template<class PixelFormat >
bool agg::renderer_base< PixelFormat >::inbox ( int  x,
int  y 
) const
inline
104 {
105 return x >= m_clip_box.x1 && y >= m_clip_box.y1 &&
106 x <= m_clip_box.x2 && y <= m_clip_box.y2;
107 }

References agg::renderer_base< PixelFormat >::m_clip_box, agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

Referenced by agg::renderer_base< PixelFormat >::blend_pixel(), agg::renderer_base< PixelFormat >::copy_pixel(), and agg::renderer_base< PixelFormat >::pixel().

+ Here is the caller graph for this function:

◆ pixel()

template<class PixelFormat >
color_type agg::renderer_base< PixelFormat >::pixel ( int  x,
int  y 
) const
inline
170 {
171 return inbox(x, y) ?
172 m_ren->pixel(x, y) :
173 color_type::no_color();
174 }

References agg::renderer_base< PixelFormat >::inbox(), and agg::renderer_base< PixelFormat >::m_ren.

+ Here is the call graph for this function:

◆ ren() [1/2]

template<class PixelFormat >
pixfmt_type & agg::renderer_base< PixelFormat >::ren ( )
inline
51{ return *m_ren; }

References agg::renderer_base< PixelFormat >::m_ren.

◆ ren() [2/2]

template<class PixelFormat >
const pixfmt_type & agg::renderer_base< PixelFormat >::ren ( ) const
inline
50{ return *m_ren; }

References agg::renderer_base< PixelFormat >::m_ren.

Referenced by agg::renderer_base< PixelFormat >::attach().

+ Here is the caller graph for this function:

◆ reset_clipping()

template<class PixelFormat >
void agg::renderer_base< PixelFormat >::reset_clipping ( bool  visibility)
inline
76 {
77 if(visibility)
78 {
79 m_clip_box.x1 = 0;
80 m_clip_box.y1 = 0;
81 m_clip_box.x2 = width() - 1;
82 m_clip_box.y2 = height() - 1;
83 }
84 else
85 {
86 m_clip_box.x1 = 1;
87 m_clip_box.y1 = 1;
88 m_clip_box.x2 = 0;
89 m_clip_box.y2 = 0;
90 }
91 }

References agg::renderer_base< PixelFormat >::height(), agg::renderer_base< PixelFormat >::m_clip_box, agg::renderer_base< PixelFormat >::width(), agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

+ Here is the call graph for this function:

◆ width()

template<class PixelFormat >
unsigned agg::renderer_base< PixelFormat >::width ( ) const
inline
54{ return m_ren->width(); }

References agg::renderer_base< PixelFormat >::m_ren.

Referenced by agg::renderer_base< PixelFormat >::clear(), agg::renderer_base< PixelFormat >::clip_box(), agg::renderer_base< PixelFormat >::fill(), and agg::renderer_base< PixelFormat >::reset_clipping().

+ Here is the caller graph for this function:

◆ xmax()

◆ xmin()

◆ ymax()

◆ ymin()

Member Data Documentation

◆ m_clip_box

◆ m_ren


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