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<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><CODE>#include &lt;revolution/gx.h&gt;</CODE></PRE>
16  <DD>
17<PRE><CODE>void GXSetTexCopyDst(
18u16       wd,
19u16       ht,
20<A href="../Enumerated_Types/GXTexFmt.html">GXTexFmt</A>  fmt,
21<A href="../Enumerated_Types/GXBool.html">GXBool</A>    mipmap );</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" bgcolor="#ffffe8"><EM><STRONG><CODE>wd</FONT></STRONG></EM></TD>
28<TD width="520"><SPAN>the distance (in texels) between successive lines within the texture buffer <BR>It must be a multiple of the texture tile width, which depends on the texture format, <CODE>fmt</CODE>.</SPAN></TD>
29    </TR>
30    <TR>
31<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>ht</FONT></STRONG></EM></TD>
32<TD width="520"><SPAN>the height of the texture buffer</SPAN></TD>
33    </TR>
34    <TR>
35<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>fmt</FONT></STRONG></EM></TD>
36<TD width="520">the generated texture <A href="../Enumerated_Types/GXTexFmt.html">format</A><BR>Accepted values are:<BR>
37      <TABLE border="1" width="500" cellspacing="0.1">
38
39          <tr>
40<TD width="150" bgcolor="#C0C0C0">Name</TD>
41<TD width="350" bgcolor="#C0C0C0">Texture Format</TD>
42          </tr>
43          <tr>
44<TD width="150"><code>GX_TF_I4</code></TD>
45<TD width="350">intensity 4-bit value (see <a href="#Note1">1</a>)</TD>
46          </tr>
47          <tr>
48<TD width="150"><code>GX_TF_IA4</code></TD>
49<TD width="350">intensity 4-bit plus the alpha 4-bit value (see <a href="#Note1">1</a>)</TD>
50          </tr>
51          <tr>
52<TD width="150"><code>GX_TF_I8</code></TD>
53<TD width="350">intensity 8-bit value (see <a href="#Note1">1</a>)</TD>
54          </tr>
55          <tr>
56<TD width="150"><code>GX_TF_IA8</code></TD>
57<TD width="350">intensity 8-bit plus the alpha 8-bit value (see <a href="#Note1">1</a>)</TD>
58          </tr>
59          <tr>
60<TD width="150"><code>GX_TF_RGB565</code></TD>
61<TD width="350">16-bit color (RGB565)</TD>
62          </tr>
63          <tr>
64<TD width="150"><code>GX_TF_RGB5A3</code></TD>
65<TD width="350">16-bit color + alpha (RGB555 or RGBA4443)</TD>
66          </tr>
67          <tr>
68<TD width="150"><code>GX_TF_RGBA8</code></TD>
69<TD width="350">the 32-bit full color RGBA (8 bits per element)</TD>
70          </tr>
71          <tr>
72<TD width="150"><code>GX_TF_Z8</code></TD>
73<TD width="350">the first 8 bits from the Z buffer copied to 8-bit format</TD>
74          </tr>
75          <tr>
76<TD width="150"><code>GX_TF_Z16</code></TD>
77<TD width="350">the first 16 bits from the Z buffer copied to 16-bit format (see <A href="#Note2">2</A>)</TD>
78          </tr>
79          <tr>
80<TD width="150"><code>GX_TF_Z24X8</code></TD>
81<TD width="350">all 24 bits from the Z buffer copied to 32-bit format <BR>The upper 8 bits are set to 0xFF.</TD>
82          </tr>
83          <tr>
84<TD width="150"><code>GX_CTF_R4</code></TD>
85<TD width="350">4 bits copied from the red element <BR>Results can be used as I4 format.</TD>
86          </tr>
87          <tr>
88<TD width="150"><code>GX_CTF_RA4</code></TD>
89<TD width="350">4 bits each copied from the red and alpha elements <BR>Results can be used as IA4 format.</TD>
90          </tr>
91          <tr>
92<TD width="150"><code>GX_CTF_RA8 </code></TD>
93<TD width="350">8 bits each copied from the red and alpha elements <BR>Results can be used as IA8 format.</TD>
94          </tr>
95          <tr>
96<TD width="150"><code>GX_CTF_A8</code></TD>
97<TD width="350">8 bits copied from the alpha element <BR>Results can be used as I8 format.</TD>
98          </tr>
99          <tr>
100<TD width="150"><code>GX_CTF_R8</code></TD>
101<TD width="350">8 bits copied from the red element <BR>Results can be used as I8 format.</TD>
102          </tr>
103          <tr>
104<TD width="150"><code>GX_CTF_G8</code></TD>
105<TD width="350">8 bits copied from the green element <BR>Results can be used as I8 format.</TD>
106          </tr>
107          <tr>
108<TD width="150"><code>GX_CTF_B8</code></TD>
109<TD width="350">8 bits copied from the blue element <BR>Results can be used as I8 format.</TD>
110          </tr>
111          <tr>
112<TD width="150"><code>GX_CTF_RG8</code></TD>
113<TD width="350">8 bits each copied from the red and green elements <BR>Results can be used as IA8 format.</TD>
114          </tr>
115          <tr>
116<TD width="150"><code>GX_CTF_GB8</code></TD>
117<TD width="350">8 bits each copied from the green and blue elements <BR>Results can be used as IA8 format.</TD>
118          </tr>
119          <tr>
120<TD width="150"><code>GX_CTF_Z4</code></TD>
121<TD width="350">upper 4 bits from the Z value copied to 4-bit format</TD>
122          </tr>
123          <tr>
124<TD width="150"><code>GX_CTF_Z8M</code></TD>
125<TD width="350">middle 8 bits of the Z value copied to 8-bit format</TD>
126          </tr>
127          <tr>
128<TD width="150"><code>GX_CTF_Z8L</code></TD>
129<TD width="350">lower 8 bits from the Z value copied to 8-bit format</TD>
130          </tr>
131          <tr>
132<TD width="150"><code>GX_CTF_Z16L </code></TD>
133<TD width="350">lower 16 bits from the Z value copied to 16-bit format (see <A href="#Note2">2</A>)</TD>
134          </tr>
135
136      </TABLE>
137      </TD>
138    </TR>
139    <TR>
140<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>mipmap</FONT></STRONG></EM></TD>
141<TD width="520"><SPAN>For <CODE>GX_TRUE</CODE>, a box filter is applied to the EFB before the texture is generated.</SPAN></TD>
142    </TR>
143  </TBODY>
144</TABLE>
145<H2>Return Values</H2>
146<P>None.</P>
147<H2>Description</H2>
148<P>This function sets the width, <code>wd</code>, and height, <code>ht</code>, of the destination texture buffer in texels. The application may render an image into the embedded frame buffer (EFB, source) and then copy it into a texture buffer in main memory. <code>wd</code> specifies the number of texels between adjacent lines in the texture buffer and can be different than the width of the source image.&nbsp;This function also sets the texture format, <code>fmt</code>,&nbsp; generated during the copy operation for texel generation.&nbsp;An optional box filter can be enabled using the <code>mipmap</code> flag.&nbsp;This flag will scale the source image by 1/2 in both width and height.</P>
149<P>Normally, the width of the EFB and the destination <code>wd</code> are the same.&nbsp;When rendering smaller images that get copied and composited into a larger texture buffer, however, the EFB width and texture buffer <code>wd</code> are not necessarily the same.</P>
150<P>The Z buffer can be copied to a Z texture format by setting <code>fmt</code> to&nbsp; <code>GX_TF_Z24X8</code>.&nbsp;Doing so is only valid when the EFB format is <code>GX_PF_RGB8_Z24</code> or <code>GX_PF_RGBA6_Z24</code>.</P>
151<P>The alpha channel can be copied from an EFB with the format <code>GX_PF_RGBA6_Z24</code> by setting <code>fmt</code> to <code>GX_TF_A8</code>.</P>
152<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.&nbsp;The <a href="GXCopyTex.html"><code>GXCopyTex</code></a> function actually performs the copy operation.</P>
153<P>See <A href="../Enumerated_Types/GXTexFmt.html"><CODE>GXTexFmt</CODE></A> for more information on the texture copy format.</P>
154<P><A NAME="Note1"><strong>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 16 to 235. If exact values from the EFB are needed, formats like R8 and RA8 can be used.</P>
155<P><A NAME="Note2"><strong>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>
156
157
158<H2>See Also</H2>
159<P><A href="GXSetTexCopySrc.html"><CODE>GXSetTexCopySrc</CODE></A><br> <A href="GXCopyTex.html"><CODE>GXCopyTex</CODE></A>
160</P>
161<H2>Revision History</H2>
162<P>03/01/2006 Initial version.</P></BODY>
163</HTML>