Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset > Class Template Reference

#include <src/agg/agg_pixfmt_gray.h>

Classes

struct  pixel_type
 

Public Types

enum  { num_components = 1 , pix_width = sizeof(value_type) * Step , pix_step = Step , pix_offset = Offset }
 
typedef pixfmt_gray_tag pixfmt_category
 
typedef RenBuf rbuf_type
 
typedef rbuf_type::row_data row_data
 
typedef Blender blender_type
 
typedef blender_type::color_type color_type
 
typedef int order_type
 
typedef color_type::value_type value_type
 
typedef color_type::calc_type calc_type
 

Public Member Functions

 pixfmt_alpha_blend_gray (rbuf_type &rb)
 
void attach (rbuf_type &rb)
 
template<class PixFmt >
bool attach (PixFmt &pixf, int x1, int y1, int x2, int y2)
 
AGG_INLINE unsigned width () const
 
AGG_INLINE unsigned height () const
 
AGG_INLINE int stride () const
 
int8urow_ptr (int y)
 
const int8urow_ptr (int y) const
 
row_data row (int y) const
 
AGG_INLINE int8upix_ptr (int x, int y)
 
AGG_INLINE const int8upix_ptr (int x, int y) const
 
AGG_INLINE pixel_typepix_value_ptr (int x, int y, unsigned len)
 
AGG_INLINE const pixel_typepix_value_ptr (int x, int y) const
 
AGG_INLINE color_type pixel (int x, int y) const
 
AGG_INLINE void copy_pixel (int x, int y, const color_type &c)
 
AGG_INLINE void blend_pixel (int x, int y, const color_type &c, int8u cover)
 
AGG_INLINE void copy_hline (int x, int y, unsigned len, const color_type &c)
 
AGG_INLINE void copy_vline (int x, int y, unsigned len, const color_type &c)
 
void blend_hline (int x, int y, unsigned len, const color_type &c, int8u cover)
 
void blend_vline (int x, int y, unsigned len, const color_type &c, int8u cover)
 
void blend_solid_hspan (int x, int y, unsigned len, const color_type &c, const int8u *covers)
 
void blend_solid_vspan (int x, int y, unsigned len, const color_type &c, const int8u *covers)
 
void copy_color_hspan (int x, int y, unsigned len, const color_type *colors)
 
void copy_color_vspan (int x, int y, unsigned len, const color_type *colors)
 
void blend_color_hspan (int x, int y, unsigned len, const color_type *colors, const int8u *covers, int8u cover)
 
void blend_color_vspan (int x, int y, unsigned len, const color_type *colors, const int8u *covers, int8u cover)
 
template<class Function >
void for_each_pixel (Function f)
 
template<class GammaLut >
void apply_gamma_dir (const GammaLut &g)
 
template<class GammaLut >
void apply_gamma_inv (const GammaLut &g)
 
template<class RenBuf2 >
void copy_from (const RenBuf2 &from, int xdst, int ydst, int xsrc, int ysrc, unsigned len)
 
template<class SrcPixelFormatRenderer >
void blend_from_color (const SrcPixelFormatRenderer &from, const color_type &color, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover)
 
template<class SrcPixelFormatRenderer >
void blend_from_lut (const SrcPixelFormatRenderer &from, const color_type *color_lut, int xdst, int ydst, int xsrc, int ysrc, unsigned len, int8u cover)
 

Static Public Member Functions

static AGG_INLINE pixel_typepix_value_ptr (void *p)
 
static AGG_INLINE const pixel_typepix_value_ptr (const void *p)
 
static AGG_INLINE void write_plain_color (void *p, color_type c)
 
static AGG_INLINE color_type read_plain_color (const void *p)
 
static AGG_INLINE void make_pix (int8u *p, const color_type &c)
 

Private Member Functions

AGG_INLINE void blend_pix (pixel_type *p, value_type v, value_type a, unsigned cover)
 
AGG_INLINE void blend_pix (pixel_type *p, value_type v, value_type a)
 
AGG_INLINE void blend_pix (pixel_type *p, const color_type &c, unsigned cover)
 
AGG_INLINE void blend_pix (pixel_type *p, const color_type &c)
 
AGG_INLINE void copy_or_blend_pix (pixel_type *p, const color_type &c, unsigned cover)
 
AGG_INLINE void copy_or_blend_pix (pixel_type *p, const color_type &c)
 

Private Attributes

rbuf_typem_rbuf
 

Detailed Description

template<class Blender, class RenBuf, unsigned Step = 1, unsigned Offset = 0>
class agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >

Member Typedef Documentation

◆ blender_type

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef Blender agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blender_type

◆ calc_type

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef color_type::calc_type agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::calc_type

◆ color_type

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef blender_type::color_type agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::color_type

◆ order_type

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef int agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::order_type

◆ pixfmt_category

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef pixfmt_gray_tag agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixfmt_category

◆ rbuf_type

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef RenBuf agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::rbuf_type

◆ row_data

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef rbuf_type::row_data agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::row_data

◆ value_type

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
typedef color_type::value_type agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::value_type

Member Enumeration Documentation

◆ anonymous enum

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
anonymous enum
Enumerator
num_components 
pix_width 
pix_step 
pix_offset 
138 {
139 num_components = 1,
140 pix_width = sizeof(value_type) * Step,
141 pix_step = Step,
142 pix_offset = Offset,
143 };
color_type::value_type value_type
Definition agg_pixfmt_gray.h:135
@ pix_step
Definition agg_pixfmt_gray.h:141
@ num_components
Definition agg_pixfmt_gray.h:139
@ pix_offset
Definition agg_pixfmt_gray.h:142
@ pix_width
Definition agg_pixfmt_gray.h:140

Constructor & Destructor Documentation

◆ pixfmt_alpha_blend_gray()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixfmt_alpha_blend_gray ( rbuf_type rb)
inlineexplicit
250 :
251 m_rbuf(&rb)
252 {}
rbuf_type * m_rbuf
Definition agg_pixfmt_gray.h:713

Member Function Documentation

◆ apply_gamma_dir()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class GammaLut >
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::apply_gamma_dir ( const GammaLut &  g)
inline
633 {
634 for_each_pixel(apply_gamma_dir_gray<color_type, GammaLut>(g));
635 }
void for_each_pixel(Function f)
Definition agg_pixfmt_gray.h:611

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::for_each_pixel().

+ Here is the call graph for this function:

◆ apply_gamma_inv()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class GammaLut >
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::apply_gamma_inv ( const GammaLut &  g)
inline
639 {
640 for_each_pixel(apply_gamma_inv_gray<color_type, GammaLut>(g));
641 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::for_each_pixel().

+ Here is the call graph for this function:

◆ attach() [1/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class PixFmt >
bool agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::attach ( PixFmt &  pixf,
int  x1,
int  y1,
int  x2,
int  y2 
)
inline
258 {
259 rect_i r(x1, y1, x2, y2);
260 if (r.clip(rect_i(0, 0, pixf.width()-1, pixf.height()-1)))
261 {
262 int stride = pixf.stride();
263 m_rbuf->attach(pixf.pix_ptr(r.x1, stride < 0 ? r.y2 : r.y1),
264 (r.x2 - r.x1) + 1,
265 (r.y2 - r.y1) + 1,
266 stride);
267 return true;
268 }
269 return false;
270 }
AGG_INLINE int stride() const
Definition agg_pixfmt_gray.h:275
rect_base< int > rect_i
Definition agg_basics.h:363

References agg::rect_base< T >::clip(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::m_rbuf, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::stride(), 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:

◆ attach() [2/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::attach ( rbuf_type rb)
inline

◆ blend_color_hspan()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_color_hspan ( int  x,
int  y,
unsigned  len,
const color_type colors,
const int8u covers,
int8u  cover 
)
inline
538 {
539 pixel_type* p = pix_value_ptr(x, y, len);
540
541 if (covers)
542 {
543 do
544 {
545 copy_or_blend_pix(p, *colors++, *covers++);
546 p = p->next();
547 }
548 while (--len);
549 }
550 else
551 {
552 if (cover == cover_mask)
553 {
554 do
555 {
556 copy_or_blend_pix(p, *colors++);
557 p = p->next();
558 }
559 while (--len);
560 }
561 else
562 {
563 do
564 {
565 copy_or_blend_pix(p, *colors++, cover);
566 p = p->next();
567 }
568 while (--len);
569 }
570 }
571 }
AGG_INLINE pixel_type * pix_value_ptr(int x, int y, unsigned len)
Definition agg_pixfmt_gray.h:294
AGG_INLINE void copy_or_blend_pix(pixel_type *p, const color_type &c, unsigned cover)
Definition agg_pixfmt_gray.h:217
@ cover_mask
Definition agg_basics.h:242

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix(), agg::cover_mask, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ blend_color_vspan()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_color_vspan ( int  x,
int  y,
unsigned  len,
const color_type colors,
const int8u covers,
int8u  cover 
)
inline
580 {
581 if (covers)
582 {
583 do
584 {
585 copy_or_blend_pix(pix_value_ptr(x, y++, 1), *colors++, *covers++);
586 }
587 while (--len);
588 }
589 else
590 {
591 if (cover == cover_mask)
592 {
593 do
594 {
595 copy_or_blend_pix(pix_value_ptr(x, y++, 1), *colors++);
596 }
597 while (--len);
598 }
599 else
600 {
601 do
602 {
603 copy_or_blend_pix(pix_value_ptr(x, y++, 1), *colors++, cover);
604 }
605 while (--len);
606 }
607 }
608 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix(), agg::cover_mask, and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ blend_from_color()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class SrcPixelFormatRenderer >
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_from_color ( const SrcPixelFormatRenderer &  from,
const color_type color,
int  xdst,
int  ydst,
int  xsrc,
int  ysrc,
unsigned  len,
int8u  cover 
)
inline
667 {
668 typedef typename SrcPixelFormatRenderer::pixel_type src_pixel_type;
669 typedef typename SrcPixelFormatRenderer::color_type src_color_type;
670
671 if (const src_pixel_type* psrc = from.pix_value_ptr(xsrc, ysrc))
672 {
673 pixel_type* pdst = pix_value_ptr(xdst, ydst, len);
674
675 do
676 {
677 copy_or_blend_pix(pdst, color, src_color_type::scale_cover(cover, psrc->c[0]));
678 psrc = psrc->next();
679 pdst = pdst->next();
680 }
681 while (--len);
682 }
683 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ blend_from_lut()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class SrcPixelFormatRenderer >
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_from_lut ( const SrcPixelFormatRenderer &  from,
const color_type color_lut,
int  xdst,
int  ydst,
int  xsrc,
int  ysrc,
unsigned  len,
int8u  cover 
)
inline
695 {
696 typedef typename SrcPixelFormatRenderer::pixel_type src_pixel_type;
697
698 if (const src_pixel_type* psrc = from.pix_value_ptr(xsrc, ysrc))
699 {
700 pixel_type* pdst = pix_value_ptr(xdst, ydst, len);
701
702 do
703 {
704 copy_or_blend_pix(pdst, color_lut[psrc->c[0]], cover);
705 psrc = psrc->next();
706 pdst = pdst->next();
707 }
708 while (--len);
709 }
710 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ blend_hline()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_hline ( int  x,
int  y,
unsigned  len,
const color_type c,
int8u  cover 
)
inline
393 {
394 if (!c.is_transparent())
395 {
396 pixel_type* p = pix_value_ptr(x, y, len);
397
398 if (c.is_opaque() && cover == cover_mask)
399 {
400 do
401 {
402 p->set(c);
403 p = p->next();
404 }
405 while (--len);
406 }
407 else
408 {
409 do
410 {
411 blend_pix(p, c, cover);
412 p = p->next();
413 }
414 while (--len);
415 }
416 }
417 }
AGG_INLINE void blend_pix(pixel_type *p, value_type v, value_type a, unsigned cover)
Definition agg_pixfmt_gray.h:191

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix(), agg::cover_mask, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ blend_pix() [1/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix ( pixel_type p,
const color_type c 
)
inlineprivate
212 {
213 blender_type::blend_pix(p->c, c.v, c.a);
214 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::c.

◆ blend_pix() [2/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix ( pixel_type p,
const color_type c,
unsigned  cover 
)
inlineprivate
206 {
207 blender_type::blend_pix(p->c, c.v, c.a, cover);
208 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::c.

◆ blend_pix() [3/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix ( pixel_type p,
value_type  v,
value_type  a 
)
inlineprivate
200 {
201 blender_type::blend_pix(p->c, v, a);
202 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::c.

◆ blend_pix() [4/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix ( pixel_type p,
value_type  v,
value_type  a,
unsigned  cover 
)
inlineprivate

◆ blend_pixel()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pixel ( int  x,
int  y,
const color_type c,
int8u  cover 
)
inline
356 {
357 copy_or_blend_pix(pix_value_ptr(x, y, 1), c, cover);
358 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ blend_solid_hspan()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_solid_hspan ( int  x,
int  y,
unsigned  len,
const color_type c,
const int8u covers 
)
inline
453 {
454 if (!c.is_transparent())
455 {
456 pixel_type* p = pix_value_ptr(x, y, len);
457
458 do
459 {
460 if (c.is_opaque() && *covers == cover_mask)
461 {
462 p->set(c);
463 }
464 else
465 {
466 blend_pix(p, c, *covers);
467 }
468 p = p->next();
469 ++covers;
470 }
471 while (--len);
472 }
473 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix(), agg::cover_mask, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ blend_solid_vspan()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_solid_vspan ( int  x,
int  y,
unsigned  len,
const color_type c,
const int8u covers 
)
inline
481 {
482 if (!c.is_transparent())
483 {
484 do
485 {
486 pixel_type* p = pix_value_ptr(x, y++, 1);
487
488 if (c.is_opaque() && *covers == cover_mask)
489 {
490 p->set(c);
491 }
492 else
493 {
494 blend_pix(p, c, *covers);
495 }
496 ++covers;
497 }
498 while (--len);
499 }
500 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix(), agg::cover_mask, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ blend_vline()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_vline ( int  x,
int  y,
unsigned  len,
const color_type c,
int8u  cover 
)
inline
425 {
426 if (!c.is_transparent())
427 {
428 if (c.is_opaque() && cover == cover_mask)
429 {
430 do
431 {
432 pix_value_ptr(x, y++, 1)->set(c);
433 }
434 while (--len);
435 }
436 else
437 {
438 do
439 {
440 blend_pix(pix_value_ptr(x, y++, 1), c, cover);
441 }
442 while (--len);
443 }
444 }
445 }
void set(value_type v)
Definition agg_pixfmt_gray.h:148

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix(), agg::cover_mask, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ copy_color_hspan()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_color_hspan ( int  x,
int  y,
unsigned  len,
const color_type colors 
)
inline
507 {
508 pixel_type* p = pix_value_ptr(x, y, len);
509
510 do
511 {
512 p->set(*colors++);
513 p = p->next();
514 }
515 while (--len);
516 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ copy_color_vspan()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_color_vspan ( int  x,
int  y,
unsigned  len,
const color_type colors 
)
inline
523 {
524 do
525 {
526 pix_value_ptr(x, y++, 1)->set(*colors++);
527 }
528 while (--len);
529 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ copy_from()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class RenBuf2 >
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_from ( const RenBuf2 &  from,
int  xdst,
int  ydst,
int  xsrc,
int  ysrc,
unsigned  len 
)
inline
649 {
650 if (const int8u* p = from.row_ptr(ysrc))
651 {
652 memmove(m_rbuf->row_ptr(xdst, ydst, len) + xdst * pix_width,
653 p + xsrc * pix_width,
654 len * pix_width);
655 }
656 }
AGG_INT8U int8u
Definition agg_basics.h:120

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::m_rbuf, and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_width.

◆ copy_hline()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_hline ( int  x,
int  y,
unsigned  len,
const color_type c 
)
inline
364 {
365 pixel_type* p = pix_value_ptr(x, y, len);
366 do
367 {
368 p->set(c);
369 p = p->next();
370 }
371 while(--len);
372 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ copy_or_blend_pix() [1/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix ( pixel_type p,
const color_type c 
)
inlineprivate
234 {
235 if (!c.is_transparent())
236 {
237 if (c.is_opaque())
238 {
239 p->set(c);
240 }
241 else
242 {
243 blend_pix(p, c);
244 }
245 }
246 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ copy_or_blend_pix() [2/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_or_blend_pix ( pixel_type p,
const color_type c,
unsigned  cover 
)
inlineprivate
218 {
219 if (!c.is_transparent())
220 {
221 if (c.is_opaque() && cover == cover_mask)
222 {
223 p->set(c);
224 }
225 else
226 {
227 blend_pix(p, c, cover);
228 }
229 }
230 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pix(), agg::cover_mask, and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

Referenced by agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_color_hspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_color_vspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_from_color(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_from_lut(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pixel().

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

◆ copy_pixel()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_pixel ( int  x,
int  y,
const color_type c 
)
inline
350 {
351 pix_value_ptr(x, y, 1)->set(c);
352 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ copy_vline()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_vline ( int  x,
int  y,
unsigned  len,
const color_type c 
)
inline
379 {
380 do
381 {
382 pix_value_ptr(x, y++, 1)->set(c);
383 }
384 while (--len);
385 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

◆ for_each_pixel()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
template<class Function >
void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::for_each_pixel ( Function  f)
inline
612 {
613 unsigned y;
614 for (y = 0; y < height(); ++y)
615 {
616 row_data r = m_rbuf->row(y);
617 if (r.ptr)
618 {
619 unsigned len = r.x2 - r.x1 + 1;
620 pixel_type* p = pix_value_ptr(r.x1, y, len);
621 do
622 {
623 f(p->c);
624 p = p->next();
625 }
626 while (--len);
627 }
628 }
629 }
rbuf_type::row_data row_data
Definition agg_pixfmt_gray.h:131
AGG_INLINE unsigned height() const
Definition agg_pixfmt_gray.h:274
const Scalar & y
Definition MathFunctions.h:552

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::c, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::height(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::m_rbuf, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::next(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

Referenced by agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::apply_gamma_dir(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::apply_gamma_inv().

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

◆ height()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE unsigned agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::height ( ) const
inline
274{ return m_rbuf->height(); }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::m_rbuf.

Referenced by agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::for_each_pixel().

+ Here is the caller graph for this function:

◆ make_pix()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
static AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::make_pix ( int8u p,
const color_type c 
)
inlinestatic
334 {
335 ((pixel_type*)p)->set(c);
336 }

◆ pix_ptr() [1/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE int8u * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_ptr ( int  x,
int  y 
)
inline

◆ pix_ptr() [2/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE const int8u * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_ptr ( int  x,
int  y 
) const
inline

◆ pix_value_ptr() [1/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
static AGG_INLINE const pixel_type * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr ( const void p)
inlinestatic
314 {
315 return (const pixel_type*)((const value_type*)p + pix_offset);
316 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_offset.

◆ pix_value_ptr() [2/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE const pixel_type * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr ( int  x,
int  y 
) const
inline

◆ pix_value_ptr() [3/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE pixel_type * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr ( int  x,
int  y,
unsigned  len 
)
inline
295 {
296 return (pixel_type*)(m_rbuf->row_ptr(x, y, len) + sizeof(value_type) * (x * pix_step + pix_offset));
297 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::m_rbuf, agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_offset, and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_step.

Referenced by agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_color_hspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_color_vspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_from_color(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_from_lut(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_hline(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_pixel(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_solid_hspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_solid_vspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::blend_vline(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_color_hspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_color_vspan(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_hline(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_pixel(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::copy_vline(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::for_each_pixel(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel(), agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::read_plain_color(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::write_plain_color().

+ Here is the caller graph for this function:

◆ pix_value_ptr() [4/4]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
static AGG_INLINE pixel_type * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr ( void p)
inlinestatic

◆ pixel()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE color_type agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel ( int  x,
int  y 
) const
inline
340 {
341 if (const pixel_type* p = pix_value_ptr(x, y))
342 {
343 return p->get();
344 }
345 return color_type::no_color();
346 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ read_plain_color()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
static AGG_INLINE color_type agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::read_plain_color ( const void p)
inlinestatic
328 {
329 return pix_value_ptr(p)->get();
330 }
void get(value_type &v) const
Definition agg_pixfmt_gray.h:158

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::get(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr().

+ Here is the call graph for this function:

◆ row()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
row_data agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::row ( int  y) const
inline

◆ row_ptr() [1/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
int8u * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::row_ptr ( int  y)
inline

◆ row_ptr() [2/2]

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
const int8u * agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::row_ptr ( int  y) const
inline

◆ stride()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE int agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::stride ( ) const
inline
275{ return m_rbuf->stride(); }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::m_rbuf.

Referenced by agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::attach().

+ Here is the caller graph for this function:

◆ width()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
AGG_INLINE unsigned agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::width ( ) const
inline

◆ write_plain_color()

template<class Blender , class RenBuf , unsigned Step = 1, unsigned Offset = 0>
static AGG_INLINE void agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::write_plain_color ( void p,
color_type  c 
)
inlinestatic
320 {
321 // Grayscale formats are implicitly premultiplied.
322 c.premultiply();
323 pix_value_ptr(p)->set(c);
324 }

References agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pix_value_ptr(), and agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::pixel_type::set().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_rbuf


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