GXPokeBlendMode

Syntax

#include <revolution/gx.h>

void GXPokeBlendMode( 
    GXBlendMode    type,
    GXBlendFactor  src_factor, 
    GXBlendFactor  dst_factor, 
    GXLogicOp      op );

Arguments

type Blend mode. Accepted values are:
Name Mode
GX_BM_NONE Performs neither blending nor logical operations.
GX_BM_BLEND Blend mode.
GX_BM_LOGIC Logical operations 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 Frame buffer color.
GX_BL_INVDSTCLR 1.0 - (frame buffer color)
GX_BL_SRCALPHA Source alpha.
GX_BL_INVSRCALPHA 1.0 - (source alpha)
GX_BL_DSTALPHA Frame buffer alpha.
GX_BL_INVDSTALPHA 1.0 - (frame buffer alpha)
dst_factor 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 - (source color)
GX_BL_SRCALPHA Source alpha.
GX_BL_INVSRCALPHA 1.0 - (source alpha)
GX_BL_DSTALPHA Frame buffer alpha.
GX_BL_INVDSTALPHA 1.0 - (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 a GXPoke* function, is blended with the current embedded frame buffer (EFB). When type is set to GX_BM_NONE, color data is not written to the EFB. When type is set to GX_BM_BLEND, the source image and EFB pixels are blended according to 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 the GXSetPixelFmt function).

When type is set to GX_BM_LOGIC, the source and EFB pixels are blended using a logical bitwise operation.

This function does not affect the normal rendering state (see the GXSetBlendMode function).

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

2007/02/19 Corrected typos.
2006/03/01 Initial version.


CONFIDENTIAL