Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
AG_ALPHAFN(3)		     Library Functions Manual		   AG_ALPHAFN(3)

NAME
     AG_AlphaFn -- agar pixel arithmetic function

SYNOPSIS
     #include <agar/core.h>
     #include <agar/gui.h>

DESCRIPTION
     The  AG_AlphaFn type specifies an arithmetic operation to use when blending
     two pixels. The incoming pixel is referred to as the  "source"  pixel.  The
     target  pixel  already  in the frame buffer is referred to as the "destina-
     tion" pixel.  AG_AlphaFn is defined as:

     typedef enum ag_blend_func {
	     AG_ALPHA_OVERLAY,		     /* MIN(sA+dA, 1) */
	     AG_ALPHA_ZERO,		     /* 0 */
	     AG_ALPHA_ONE,		     /* 1 */
	     AG_ALPHA_SRC,		     /* sA */
	     AG_ALPHA_DST,		     /* dA */
	     AG_ALPHA_ONE_MINUS_DST,	     /* 1-dA */
	     AG_ALPHA_ONE_MINUS_SRC	     /* 1-sA */
     } AG_AlphaFn;

     The blending functions differ in how the weight of  the  destination  pixel
     (versus the weight of the source pixel) is selected.

     AG_PIXEL_SRC uses the alpha component of the source pixel (sA).

     AG_PIXEL_DST uses the alpha component of the destination pixel (dA),

     AG_PIXEL_OVERLAY uses the sum of the source and alpha components clamped to
     the maximum value that can be represented by an AG_Component.

     AG_PIXEL_ONE_MINUS_SRC and AG_PIXEL_ONE_MINUS_DST use the value 1 minus the
     source and destination alpha component.

SEE ALSO
     AG_Intro(3), AG_Widget(3), AG_Window(3), glBlendFunc(3)

HISTORY
     The AG_AlphaFn type first appeared in Agar 1.3.4 under the name AG_BlendFn.
     It was renamed AG_AlphaFn and AG_ALPHA_{ZERO,ONE} were added in Agar 1.6.0.

Agar 1.7			  March 6, 2023 		   AG_ALPHAFN(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=AG_AlphaFn&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help