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<H2>C Specification</H2> 13<DL> 14 <DD> 15<PRE><CODE>#include <revolution/gx.h></CODE></PRE> 16 <DD> 17<PRE><CODE>void 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 );</CODE></PRE> 22</DL> 23<H2>Arguments</H2> 24<TABLE border="1" cellpadding="3" cellspacing="0.1"> 25 <TBODY> 26 <TR> 27<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG>type</STRONG></EM></TD> 28<TD width="520">the blend mode <BR>Accepted values are:<BR> 29 <TABLE border="1" width="500" cellspacing="0.1"> 30 31 <tr> 32<TD width="150" bgcolor="#C0C0C0">Name</TD> 33<TD width="350" bgcolor="#C0C0C0">Mode</TD> 34 </tr> 35 <tr> 36<TD width="150"><code>GX_BM_NONE</code></TD> 37<TD width="350">performs neither blend nor logical processing</TD> 38 </tr> 39 <tr> 40<TD width="150"><code>GX_BM_BLEND</code></TD> 41<TD width="350">the blend mode</TD> 42 </tr> 43 <tr> 44<TD width="150"><code>GX_BM_LOGIC</code></TD> 45<TD width="350">logical operation mode</TD> 46 </tr> 47 <tr> 48<TD width="150"><code>GX_BM_SUBTRACT</code></TD> 49<TD width="350">subtraction processing mode</TD> 50 </tr> 51 52 </TABLE> 53 </TD> 54 </TR> 55 <TR> 56<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG><A name="src_factor">src_factor</A></STRONG></EM></TD> 57<TD width="520">source coefficient <BR>The pixel color generated by the GP is multiplied by this coefficient. Applicable values are indicated in the table below. 58 <TABLE border="1" width="500" cellspacing="0.1"> 59 <TBODY> 60 <TR> 61<TD width="150" bgcolor="#C0C0C0">Name</TD> 62<TD width="350" bgcolor="#C0C0C0">Coefficient Description</TD> 63 </TR> 64 <TR> 65<TD width="150"><CODE>GX_BL_ZERO</CODE></TD> 66 <TD width="350">0.0</TD> 67 </TR> 68 <TR> 69<TD width="150"><CODE>GX_BL_ONE</CODE></TD> 70 <TD width="350">1.0</TD> 71 </TR> 72 <TR> 73<TD width="150"><CODE>GX_BL_DSTCLR</CODE></TD> 74<TD width="350">the frame buffer color</TD> 75 </TR> 76 <TR> 77<TD width="150"><CODE>GX_BL_INVDSTCLR</CODE></TD> 78<TD width="350">1.0 - (the frame buffer color)</TD> 79 </TR> 80 <TR> 81<TD width="150"><CODE>GX_BL_SRCALPHA</CODE></TD> 82<TD width="350">the source alpha</TD> 83 </TR> 84 <TR> 85<TD width="150"><CODE>GX_BL_INVSRCALPHA</CODE></TD> 86<TD width="350">1.0 - (the source alpha)</TD> 87 </TR> 88 <TR> 89<TD width="150"><CODE>GX_BL_DSTALPHA</CODE></TD> 90<TD width="350">the frame buffer alpha</TD> 91 </TR> 92 <TR> 93<TD width="150"><CODE>GX_BL_INVDSTALPHA</CODE></TD> 94<TD width="350">1.0 - (the frame buffer alpha)</TD> 95 </TR> 96 </TBODY> 97 </TABLE> 98 </TD> 99 </TR> 100 <TR> 101<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG>dst_factor</STRONG></EM></TD> 102<TD width="520">the output coefficient <BR>The current frame buffer pixel color is multiplied by this coefficient. <BR>Accepted values are:<BR> 103 <TABLE border="1" width="500" cellspacing="0.1"> 104 105 <tr> 106<TD width="150" bgcolor="#C0C0C0">Name</TD> 107<TD width="350" bgcolor="#C0C0C0">Coefficient Description</TD> 108 </tr> 109 <tr> 110<TD width="150"><code>GX_BL_ZERO</code></TD> 111 <TD width="350">0.0</TD> 112 </tr> 113 <tr> 114<TD width="150"><code>GX_BL_ONE</code></TD> 115 <TD width="350">1.0</TD> 116 </tr> 117 <tr> 118<TD width="150"><code>GX_BL_SRCCLR</code></TD> 119<TD width="350">source color</TD> 120 </tr> 121 <tr> 122<TD width="150"><code>GX_BL_INVSRCCLR</code></TD> 123<TD width="350">1.0 - (the source color)</TD> 124 </tr> 125 <tr> 126<TD width="150"><code>GX_BL_SRCALPHA</code></TD> 127<TD width="350">the source alpha</TD> 128 </tr> 129 <tr> 130<TD width="150"><code>GX_BL_INVSRCALPHA</code></TD> 131<TD width="350">1.0 - (the source alpha)</TD> 132 </tr> 133 <tr> 134<TD width="150"><code>GX_BL_DSTALPHA</code></TD> 135<TD width="350">the frame buffer alpha</TD> 136 </tr> 137 <tr> 138<TD width="150"><code>GX_BL_INVDSTALPHA</code></TD> 139<TD width="350">1.0 - (the frame buffer alpha)</TD> 140 </tr> 141 142 </TABLE> 143 </TD> 144 </TR> 145 <TR> 146<TD width="120" valign="top" bgcolor="#ffffe8"><EM><STRONG>op</STRONG></EM></TD> 147<TD width="520">blend processing <BR>Applicable values and logical operations are indicated in the table below. 148 <TABLE border="1" width="500" cellspacing="0.1"> 149 <TBODY> 150 <TR> 151<TD width="150" bgcolor="#C0C0C0">Name</TD> 152<TD width="350" bgcolor="#C0C0C0">Logical Bit Operations in C</TD> 153 </TR> 154 <TR> 155<TD width="150"><CODE>GX_LO_CLEAR</CODE></TD> 156<TD width="350">dst = 0</TD> 157 </TR> 158 <TR> 159<TD width="150"><CODE>GX_LO_SET</CODE></TD> 160<TD width="350">dst = 1</TD> 161 </TR> 162 <TR> 163<TD width="150"><CODE>GX_LO_COPY</CODE></TD> 164<TD width="350">dst = src</TD> 165 </TR> 166 <TR> 167<TD width="150"><CODE>GX_LO_INVCOPY</CODE></TD> 168<TD width="350">dst = ~src</TD> 169 </TR> 170 <TR> 171<TD width="150"><CODE>GX_LO_NOOP</CODE></TD> 172<TD width="350">dst = dst</TD> 173 </TR> 174 <TR> 175<TD width="150"><CODE>GX_LO_INV</CODE></TD> 176<TD width="350">dst = ~dst</TD> 177 </TR> 178 <TR> 179<TD width="150"><CODE>GX_LO_AND</CODE></TD> 180<TD width="350">dst = src & dst</TD> 181 </TR> 182 <TR> 183<TD width="150"><CODE>GX_LO_NAND</CODE></TD> 184<TD width="350">dst = ~(src & dst)</TD> 185 </TR> 186 <TR> 187<TD width="150"><CODE>GX_LO_OR</CODE></TD> 188<TD width="350">dst = src | dst</TD> 189 </TR> 190 <TR> 191<TD width="150"><CODE>GX_LO_NOR</CODE></TD> 192<TD width="350">dst = ~(src | dst)</TD> 193 </TR> 194 <TR> 195<TD width="150"><CODE>GX_LO_XOR</CODE></TD> 196<TD width="350">dst = src ^ dst</TD> 197 </TR> 198 <TR> 199<TD width="150"><CODE>GX_LO_EQUIV</CODE></TD> 200<TD width="350">dst = ~(src ^ dst)</TD> 201 </TR> 202 <TR> 203<TD width="150"><CODE>GX_LO_REVAND</CODE></TD> 204<TD width="350">dst = src & ~dst</TD> 205 </TR> 206 <TR> 207<TD width="150"><CODE>GX_LO_INVAND</CODE></TD> 208<TD width="350">dst = ~src & dst</TD> 209 </TR> 210 <TR> 211<TD width="150"><CODE>GX_LO_REVOR</CODE></TD> 212<TD width="350">dst = src | ~dst</TD> 213 </TR> 214 <TR> 215<TD width="150"><CODE>GX_LO_INVOR</CODE></TD> 216<TD width="350">dst = ~src | dest</TD> 217 </TR> 218 </TBODY> 219 </TABLE> 220 </TD> 221 </TR> 222 </TBODY> 223</TABLE> 224<H2>Return Values</H2> 225<P>None.</P> 226<H2>Description</H2> 227<P>This function determines how the source image, written with the <code>GXPoke</code>* function, is blended with the current embedded frame buffer (EFB). No color data is written to the EFB when <code>type</code> is set to <code>GX_CM_NONE</code>. When <code>type</code> is set to <code>GX_CM_BLEND</code>, the source and EFB pixels are blended using the following equation:</P> 228<P><code>dst_pix_clr = src_pix_clr * <strong>src_factor</strong> + dst_pix_clr * <strong>dst_factor</strong></code></P> 229<P><code>dst_factor</code> can be used only when the frame buffer has a <code>GX_PF_RGBA6_Z24</code> pixel format (see <a href="../PixelProc/GXSetPixelFmt.html"><code>GXSetPixelFmt</code></a>). </P> 230<P>When <code>type</code> is set to <code>GX_CM_LOGIC</code>, the source and EFB pixels are blended using logical bitwise operations.</P> 231<P>This function does not affect the normal rendering state, <a href="../PixelProc/GXSetBlendMode.html"><code>GXSetBlendMode</code></a>.</P> 232<P>When <CODE>GX_BM_SUBTRACT</CODE> is used for <code>type</code>, the destination pixel is calculated as follows:</P> 233<P><FONT size="3"><CODE><EM>dst_pix_clr = dst_pix_clr - src_pix_clr [clamped to zero]</EM></CODE></FONT></P> 234<P><font size="3">Be aware that <code>src_factor</code> and <code>dst_factor</code> are not part of the equation.</font></P> 235 236 237<H2>See Also</H2> 238<P><A href="../PixelProc/GXSetPixelFmt.html"><CODE>GXSetPixelFmt</CODE></A><BR> <A href="GXPokeZMode.html"><CODE>GXPokeZMode</CODE></A></P> 239<H2>Revision History</H2> 240<P>03/01/2006 Initial version.</P> 241</BODY> 242</HTML> 243