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>GXSetTexCopyDst</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXSetTexCopyDst</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXSetTexCopyDst( 18 u16 wd, 19 u16 ht, 20 <A href="../Enumerated_Types/GXTexFmt.html">GXTexFmt</A> fmt, 21 <A href="../Enumerated_Types/GXBool.html">GXBool</A> mipmap ); 22</pre></dd></dl> 23 24<H2>Arguments</H2> 25<TABLE class="arguments" border="1" > 26 <TBODY> 27 <TR> 28 <TH>wd</TH> 29 <TD>The distance (in texels) between contiguous lines within the texture buffer. It must be a multiple of the texture tile width dependent on the texture format, <SPAN class="argument">fmt</SPAN>.</TD> 30 </TR> 31 <TR> 32 <TH>ht</TH> 33 <TD>Height of the texture buffer.</TD> 34 </TR> 35 <TR> 36 <TH>fmt</TH> 37 <TD>The generated texture <A href="../Enumerated_Types/GXTexFmt.html">format</A>. Accepted values are:<BR> 38 <TABLE class="arguments" border="1" > 39 <tr> 40 <TD bgcolor="#C0C0C0">Name</TD> 41 <TD bgcolor="#C0C0C0">Texture Format</TD> 42 </tr> 43 <tr> 44 <TH>GX_TF_I4</TH> 45 <TD>The intensity 4-bit (see <a href="#Note1">note 1</a>).</TD> 46 </tr> 47 <tr> 48 <TH>GX_TF_IA4</TH> 49 <TD>The intensity 4-bit plus the alpha 4-bit (see <a href="#Note1">note 1</a>).</TD> 50 </tr> 51 <tr> 52 <TH>GX_TF_I8</TH> 53 <TD>The intensity 8-bit (see <a href="#Note1">note 1</a>).</TD> 54 </tr> 55 <tr> 56 <TH>GX_TF_IA8</TH> 57 <TD>The intensity 8-bit plus the alpha 8-bit (see <a href="#Note1">note 1</a>).</TD> 58 </tr> 59 <tr> 60 <TH>GX_TF_RGB565</TH> 61 <TD>16-bit color (RGB565)</TD> 62 </tr> 63 <tr> 64 <TH>GX_TF_RGB5A3</TH> 65 <TD>16-bit color + alpha (RGB555 or RGBA4443)</TD> 66 </tr> 67 <tr> 68 <TH>GX_TF_RGBA8</TH> 69 <TD>32-bit full RGBA (8 bits per element).</TD> 70 </tr> 71 <tr> 72 <TH>GX_TF_Z8</TH> 73 <TD>The first 8 bits from the Z buffer are copied to the 8-bit format.</TD> 74 </tr> 75 <tr> 76 <TH>GX_TF_Z16</TH> 77 <TD>The first 16 bits from the Z buffer are copied to the 16-bit format (see <A href="#Note2">note 2</A>).</TD> 78 </tr> 79 <tr> 80 <TH>GX_TF_Z24X8</TH> 81 <TD>All 24 bits from the Z buffer are copied to the 32-bit format. The first 8 bits are set to 0xFF.</TD> 82 </tr> 83 <tr> 84 <TH>GX_CTF_R4</TH> 85 <TD>4 bits are copied from the R element. The results are handled in the I4 format.</TD> 86 </tr> 87 <tr> 88 <TH>GX_CTF_RA4</TH> 89 <TD>4 bits each are copied from the R and alpha elements. The results are handled in the IA4 format.</TD> 90 </tr> 91 <tr> 92 <TH>GX_CTF_RA8 </TH> 93 <TD>8 bits each are copied from the R and alpha elements. The results are handled in the IA8 format.</TD> 94 </tr> 95 <tr> 96 <TH>GX_CTF_A8</TH> 97 <TD>8 bits are copied from the alpha element. The results are handled in the I8 format.</TD> 98 </tr> 99 <tr> 100 <TH>GX_CTF_R8</TH> 101 <TD>8 bits are copied from the R element. The results are handled in the I8 format.</TD> 102 </tr> 103 <tr> 104 <TH>GX_CTF_G8</TH> 105 <TD>8 bits are copied from the G element. The results are handled in the I8 format.</TD> 106 </tr> 107 <tr> 108 <TH>GX_CTF_B8</TH> 109 <TD>8 bits are copied from the B element. The results are handled in the I8 format.</TD> 110 </tr> 111 <tr> 112 <TH>GX_CTF_RG8</TH> 113 <TD>8 bits each are copied from the R and G elements. The results are handled in the IA8 format.</TD> 114 </tr> 115 <tr> 116 <TH>GX_CTF_GB8</TH> 117 <TD>8 bits each are copied from the G and B elements. The results are handled in the IA8 format.</TD> 118 </tr> 119 <tr> 120 <TH>GX_CTF_Z4</TH> 121 <TD>The first 4 bits from the Z value are copied to the 4-bit format.</TD> 122 </tr> 123 <tr> 124 <TH>GX_CTF_Z8M</TH> 125 <TD>The 8 bits from the middle of the Z value are copied to the 8-bit format.</TD> 126 </tr> 127 <tr> 128 <TH>GX_CTF_Z8L</TH> 129 <TD>The last 8 bits from the Z value are copied to the 8-bit format.</TD> 130 </tr> 131 <tr> 132 <TH>GX_CTF_Z16L </TH> 133 <TD>The last 16 bits from the Z value are copied to the 16-bit format (see <A href="#Note2">note 2</A>).</TD> 134 </tr> 135 </TABLE> 136 </TD> 137 </TR> 138 <TR> 139 <TH>mipmap</TH> 140 <TD>When <CODE>GX_TRUE</CODE>, a box filter is applied to the EFB before the texture is generated.</TD> 141 </TR> 142 </TBODY> 143</TABLE> 144 145<H2>Return Values</H2> 146<P>None.</P> 147 148<H2>Description</H2> 149<P>This function sets the width, <SPAN class="argument">wd</SPAN>, and height, <SPAN class="argument">ht</SPAN>, of the destination texture buffer in texels. The application may render an image into the embedded frame buffer (EFB, the source) and then copy it into a texture buffer in main memory. <SPAN class="argument">wd</SPAN> specifies the number of texels between adjacent lines in the texture buffer and can be different than the width of the source image. This function also sets the texture format, <SPAN class="argument">fmt</SPAN>, generated during the copy operation for texel generation. An optional box filter can be enabled using the <SPAN class="argument">mipmap</SPAN> flag. This flag will scale the source image by 1/2 in both width and height.</P> 150<P>Normally, the width of the EFB and the destination <SPAN class="argument">wd</SPAN> are the same. When rendering smaller images that get copied and composited into a larger texture buffer, however, the EFB width and texture buffer <SPAN class="argument">wd</SPAN> are not necessarily the same.</P> 151<P>The Z buffer can be copied to a Z texture format by setting <SPAN class="argument">fmt</SPAN> to <CODE>GX_TF_Z24X8</CODE>. Doing so is only valid when the EFB format is <CODE>GX_PF_RGB8_Z24</CODE> or <CODE>GX_PF_RGBA6_Z24</CODE>.</P> 152<P>The alpha channel can be copied from an EFB with the format <CODE>GX_PF_RGBA6_Z24</CODE> by setting <SPAN class="argument">fmt</SPAN> to <CODE>GX_TF_A8</CODE>.</P> 153<P>The <A href="../Texture/GXGetTexBufferSize.html"><CODE>GXGetTexBufferSize</CODE></A> function can be used to calculate the texture buffer size based on the texture parameters. The <A href="GXCopyTex.html"><CODE>GXCopyTex</CODE></A> function actually performs the copy operation.</P> 154<P>See <A href="../Enumerated_Types/GXTexFmt.html"><CODE>GXTexFmt</CODE></A> for information on the texture copy format.</P> 155<P><A NAME="Note1"><strong>Note 1</strong></A>: Texture copies into intensity formats (<CODE>GX_TF_I8</CODE>, <CODE>GX_TF_I4</CODE>, <CODE>GX_TF_IA8</CODE> and <CODE>GX_TF_IA4</CODE>) use the resulting Y value from RGB-YUV conversion as the intensity value. This means that the output range is linearly compressed to a range from 16 to 235. Be sure to use a format such as R8 or RA8 if your intention is not to get an intensity value, but rather to accurately obtain 8-bit data located in the EFB.</P> 156<P><A NAME="Note2"><strong>Note 2</strong></A>: Due to hardware design issues, texture copies into 16-bit Z formats put data in reverse byte order. Results cannot be directly used for Z textures.</P> 157 158<H2>See Also</H2> 159<P class="reference"> 160<A href="GXSetTexCopySrc.html">GXSetTexCopySrc</A><BR><A href="GXCopyTex.html">GXCopyTex</A> 161</P> 162 163<H2>Revision History</H2> 164<P> 1652008/09/09 Added information to Note 1 about the reason for using formats such as R8 and RA8.<br>2008/07/22 Corrected a typo in the description of <CODE>GX_CTF_A8</CODE>.<br>2006/03/01 Initial version.<br> 166</P> 167 168<hr><p>CONFIDENTIAL</p></body> 169</HTML>