1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>GXPokeBlendMode</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXPokeBlendMode</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXPokeBlendMode( 18 <A href="../Enumerated_Types/GXBlendMode.html">GXBlendMode</A> type, 19 <A href="../Enumerated_Types/GXBlendFactor.html">GXBlendFactor</A> src_factor, 20 <A href="../Enumerated_Types/GXBlendFactor.html">GXBlendFactor</A> dst_factor, 21 <A href="../Enumerated_Types/GXLogicOp.html">GXLogicOp</A> op ); 22</pre></dd></dl> 23 24<H2>Arguments</H2> 25<TABLE class="arguments" border="1" > 26 <TBODY> 27 <TR> 28<TH>type</TH> 29<TD>Blend mode. Accepted values are:<BR> 30 <TABLE class="arguments" border="1" > 31 <tr> 32<TD bgcolor="#C0C0C0">Name</TD> 33<TD bgcolor="#C0C0C0">Mode</TD> 34 </tr> 35 <tr> 36<TH>GX_BM_NONE</TH> 37<TD>Performs neither blending nor logical operations.</TD> 38 </tr> 39 <tr> 40<TH>GX_BM_BLEND</TH> 41<TD>Blend mode.</TD> 42 </tr> 43 <tr> 44<TH>GX_BM_LOGIC</TH> 45<TD>Logical operations mode.</TD> 46 </tr> 47 <tr> 48<TH>GX_BM_SUBTRACT</TH> 49<TD>Subtraction processing mode</TD> 50 </tr> 51 </TABLE> 52 </TD> 53 </TR> 54 <TR> 55<TH><A name="src_factor">src_factor</A></TH> 56<TD>Source coefficient. <BR>The pixel color generated by the GP is multiplied by this coefficient. Applicable values are indicated in the table below. 57 <TABLE class="arguments" border="1" > 58 <TBODY> 59 <TR> 60<TD bgcolor="#C0C0C0">Name</TD> 61<TD bgcolor="#C0C0C0">Coefficient Description</TD> 62 </TR> 63 <TR> 64<TH>GX_BL_ZERO</TH> 65<TD>0.0</TD> 66 </TR> 67 <TR> 68<TH>GX_BL_ONE</TH> 69<TD>1.0</TD> 70 </TR> 71 <TR> 72<TH>GX_BL_DSTCLR</TH> 73<TD>Frame buffer color.</TD> 74 </TR> 75 <TR> 76<TH>GX_BL_INVDSTCLR</TH> 77<TD>1.0 - (frame buffer color)</TD> 78 </TR> 79 <TR> 80<TH>GX_BL_SRCALPHA</TH> 81<TD>Source alpha.</TD> 82 </TR> 83 <TR> 84<TH>GX_BL_INVSRCALPHA</TH> 85<TD>1.0 - (source alpha)</TD> 86 </TR> 87 <TR> 88<TH>GX_BL_DSTALPHA</TH> 89<TD>Frame buffer alpha.</TD> 90 </TR> 91 <TR> 92<TH>GX_BL_INVDSTALPHA</TH> 93<TD>1.0 - (frame buffer alpha)</TD> 94 </TR> 95 </TBODY> 96 </TABLE> 97 </TD> 98 </TR> 99 <TR> 100<TH>dst_factor</TH> 101<TD>Output coefficient. <BR>The current frame buffer pixel color is multiplied by this coefficient. Accepted values are:<BR> 102 <TABLE class="arguments" border="1" > 103 <tr> 104<TD bgcolor="#C0C0C0">Name</TD> 105<TD bgcolor="#C0C0C0">Coefficient Description</TD> 106 </tr> 107 <tr> 108<TH>GX_BL_ZERO</TH> 109<TD>0.0</TD> 110 </tr> 111 <tr> 112<TH>GX_BL_ONE</TH> 113<TD>1.0</TD> 114 </tr> 115 <tr> 116<TH>GX_BL_SRCCLR</TH> 117<TD>Source color.</TD> 118 </tr> 119 <tr> 120<TH>GX_BL_INVSRCCLR</TH> 121<TD>1.0 - (source color)</TD> 122 </tr> 123 <tr> 124<TH>GX_BL_SRCALPHA</TH> 125<TD>Source alpha.</TD> 126 </tr> 127 <tr> 128<TH>GX_BL_INVSRCALPHA</TH> 129<TD>1.0 - (source alpha)</TD> 130 </tr> 131 <tr> 132<TH>GX_BL_DSTALPHA</TH> 133<TD>Frame buffer alpha.</TD> 134 </tr> 135 <tr> 136<TH>GX_BL_INVDSTALPHA</TH> 137<TD>1.0 - (frame buffer alpha)</TD> 138 </tr> 139 </TABLE> 140 </TD> 141 </TR> 142 <TR> 143<TH>op</TH> 144<TD>Blend processing. <BR>Applicable values and logical operations are indicated in the table below. 145 <TABLE class="arguments" border="1" > 146 <TBODY> 147 <TR> 148 <TD bgcolor="#C0C0C0">Name</TD> 149 <TD bgcolor="#C0C0C0">Logical Bit Operations in C</TD> 150 </TR> 151 <TR> 152 <TH>GX_LO_CLEAR</TH> 153 <TD>dst = 0</TD> 154 </TR> 155 <TR> 156 <TH>GX_LO_SET</TH> 157 <TD>dst = 1</TD> 158 </TR> 159 <TR> 160 <TH>GX_LO_COPY</TH> 161 <TD>dst = src</TD> 162 </TR> 163 <TR> 164 <TH>GX_LO_INVCOPY</TH> 165 <TD>dst = ~src</TD> 166 </TR> 167 <TR> 168 <TH>GX_LO_NOOP</TH> 169 <TD>dst = dst</TD> 170 </TR> 171 <TR> 172 <TH>GX_LO_INV</TH> 173 <TD>dst = ~dst</TD> 174 </TR> 175 <TR> 176 <TH>GX_LO_AND</TH> 177 <TD>dst = src & dst</TD> 178 </TR> 179 <TR> 180 <TH>GX_LO_NAND</TH> 181 <TD>dst = ~(src & dst)</TD> 182 </TR> 183 <TR> 184 <TH>GX_LO_OR</TH> 185 <TD>dst = src | dst</TD> 186 </TR> 187 <TR> 188 <TH>GX_LO_NOR</TH> 189 <TD>dst = ~(src | dst)</TD> 190 </TR> 191 <TR> 192 <TH>GX_LO_XOR</TH> 193 <TD>dst = src ^ dst</TD> 194 </TR> 195 <TR> 196 <TH>GX_LO_EQUIV</TH> 197 <TD>dst = ~(src ^ dst)</TD> 198 </TR> 199 <TR> 200 <TH>GX_LO_REVAND</TH> 201 <TD>dst = src & ~dst</TD> 202 </TR> 203 <TR> 204 <TH>GX_LO_INVAND</TH> 205 <TD>dst = ~src & dst</TD> 206 </TR> 207 <TR> 208 <TH>GX_LO_REVOR</TH> 209 <TD>dst = src | ~dst</TD> 210 </TR> 211 <TR> 212 <TH>GX_LO_INVOR</TH> 213 <TD>dst = ~src | dest</TD> 214 </TR> 215 </TBODY> 216 </TABLE> 217 </TD> 218 </TR> 219 </TBODY> 220</TABLE> 221 222<H2>Return Values</H2> 223<P>None.</P> 224 225<H2>Description</H2> 226<P>This function determines how the source image, written with a <CODE>GXPoke*</CODE> function, is blended with the current embedded frame buffer (EFB). When <SPAN class="argument">type</SPAN> is set to <CODE>GX_BM_NONE</CODE>, color data is not written to the EFB. When <SPAN class="argument">type</SPAN> is set to <CODE>GX_BM_BLEND</CODE>, the source image and EFB pixels are blended according to the following equation:</P> 227<DL><DD><CODE><EM>dst_pix_clr = src_pix_clr * </EM></CODE><SPAN class="argument">src_factor</SPAN><CODE><EM> + dst_pix_clr * </EM></CODE><SPAN class="argument">dst_factor</SPAN></DD></DL> 228<P><SPAN class="argument">dst_factor</SPAN> can be used only when the frame buffer has a <CODE>GX_PF_RGBA6_Z24</CODE> pixel format (see the <A href="../PixelProc/GXSetPixelFmt.html"><CODE>GXSetPixelFmt</CODE></A> function).</P> 229<P>When <SPAN class="argument">type</SPAN> is set to <CODE>GX_BM_LOGIC</CODE>, the source and EFB pixels are blended using a logical bitwise operation.</P> 230<P>This function does not affect the normal rendering state (see the <A href="../PixelProc/GXSetBlendMode.html"><CODE>GXSetBlendMode</CODE></A> function).</P> 231<P>When <CODE>GX_BM_SUBTRACT</CODE> is used for <SPAN class="argument">type</SPAN>, the destination pixel is calculated as follows:</P> 232<DL><DD><CODE><EM>dst_pix_clr = dst_pix_clr - src_pix_clr</EM></CODE> [clamped to zero]</DD></DL> 233<P>Be aware that <SPAN class="argument">src_factor</SPAN> and <SPAN class="argument">dst_factor</SPAN> are not part of the equation.</P> 234 235<H2>See Also</H2> 236<P class="reference"> 237<A href="../PixelProc/GXSetPixelFmt.html">GXSetPixelFmt</A>, 238<A href="GXPokeZMode.html">GXPokeZMode</A> 239</P> 240 241<H2>Revision History</H2> 242<P> 2432007/02/19 Corrected typos.<BR>2006/03/01 Initial version.<br> 244</P> 245 246<hr><p>CONFIDENTIAL</p></body> 247</HTML>