GXPokeBlendMode

C Specification

#include <revolution/gx.h>
void GXPokeBlendMode( 
GXBlendMode    type,
GXBlendFactor  src_factor, 
GXBlendFactor  dst_factor, 
GXLogicOp      op );

Arguments

type the blend mode
Accepted values are:
Name Mode
GX_BM_NONE performs neither blend nor logical processing
GX_BM_BLEND the blend mode
GX_BM_LOGIC logical operation mode
GX_BM_SUBTRACT subtraction processing mode
src_factor source coefficient
The pixel color generated by the GP is multiplied by this coefficient. Applicable values are indicated in the table below.
Name Coefficient Description
GX_BL_ZERO 0.0
GX_BL_ONE 1.0
GX_BL_DSTCLR the frame buffer color
GX_BL_INVDSTCLR 1.0 - (the frame buffer color)
GX_BL_SRCALPHA the source alpha
GX_BL_INVSRCALPHA 1.0 - (the source alpha)
GX_BL_DSTALPHA the frame buffer alpha
GX_BL_INVDSTALPHA 1.0 - (the frame buffer alpha)
dst_factor the output coefficient
The current frame buffer pixel color is multiplied by this coefficient.
Accepted values are:
Name Coefficient Description
GX_BL_ZERO 0.0
GX_BL_ONE 1.0
GX_BL_SRCCLR source color
GX_BL_INVSRCCLR 1.0 - (the source color)
GX_BL_SRCALPHA the source alpha
GX_BL_INVSRCALPHA 1.0 - (the source alpha)
GX_BL_DSTALPHA the frame buffer alpha
GX_BL_INVDSTALPHA 1.0 - (the frame buffer alpha)
op blend processing
Applicable values and logical operations are indicated in the table below.
Name Logical Bit Operations in C
GX_LO_CLEAR dst = 0
GX_LO_SET dst = 1
GX_LO_COPY dst = src
GX_LO_INVCOPY dst = ~src
GX_LO_NOOP dst = dst
GX_LO_INV dst = ~dst
GX_LO_AND dst = src & dst
GX_LO_NAND dst = ~(src & dst)
GX_LO_OR dst = src | dst
GX_LO_NOR dst = ~(src | dst)
GX_LO_XOR dst = src ^ dst
GX_LO_EQUIV dst = ~(src ^ dst)
GX_LO_REVAND dst = src & ~dst
GX_LO_INVAND dst = ~src & dst
GX_LO_REVOR dst = src | ~dst
GX_LO_INVOR dst = ~src | dest

Return Values

None.

Description

This function determines how the source image, written with the GXPoke* function, is blended with the current embedded frame buffer (EFB). No color data is written to the EFB when type is set to GX_CM_NONE. When type is set to GX_CM_BLEND, the source and EFB pixels are blended using the following equation:

dst_pix_clr = src_pix_clr * src_factor + dst_pix_clr * dst_factor

dst_factor can be used only when the frame buffer has a GX_PF_RGBA6_Z24 pixel format (see GXSetPixelFmt). 

When type is set to GX_CM_LOGIC, the source and EFB pixels are blended using logical bitwise operations.

This function does not affect the normal rendering state, GXSetBlendMode.

When GX_BM_SUBTRACT is used for type, the destination pixel is calculated as follows:

dst_pix_clr = dst_pix_clr - src_pix_clr [clamped to zero]

Be aware that src_factor and dst_factor are not part of the equation.

See Also

GXSetPixelFmt
GXPokeZMode

Revision History

03/01/2006 Initial version.