1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>GXSetCopyFilter</title> 10</head> 11 12<body> 13 14<h1 align="left">GXSetCopyFilter</h1> 15 16<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/gx.h> 19 20void GXSetCopyFilter( 21 <A href="../Enumerated_Types/GXBool.html">GXBool</A> aa, 22 const u8 sample_pattern[12][2], 23 <A href="../Enumerated_Types/GXBool.html">GXBool</A> vf, 24 const u8 vfilter[7] ); 25</pre></dd></dl> 26 27<h2>Arguments</h2> 28<TABLE class="arguments" border="1" > 29 <tr> 30<TH>aa</TH> 31<TD>If <code>GX_TRUE</code>, use <SPAN class="argument">sample_pattern</SPAN>. If <code>GX_FALSE</code>, sample a center pixel.</TD> 32 </tr> 33 <tr> 34<TH>sample_pattern</TH> 35<TD>The sample pattern for the subpixel. The valid range is 1 to 11.</TD> 36 </tr> 37 <tr> 38<TH>vf</TH> 39<TD>For <code>GX_TRUE</code>, use <SPAN class="argument">vfilter</SPAN>. For <code>GX_FALSE</code>, use the default 1 line filter.</TD> 40 </tr> 41 <tr> 42<TH>vfilter</TH> 43<TD>Vertical filter coefficient. The valid coefficient range is from 0 to 63. We recommend that the coefficients have a sum total value of 64.</TD> 44 </tr> 45</TABLE> 46 47<h2>Return Values</h2> 48<p>None.</p> 49 50<H2>Description</H2> 51<P>This function sets the subpixel sample patterns and vertical filter coefficients used to filter subpixels into pixels. This function normally uses the <SPAN class="argument">aa</SPAN>, <SPAN class="argument">sample_pattern</SPAN>, and <SPAN class="argument">vfilter</SPAN> provided by the <A href="RenderMode.html">Render Mode</A> structure:</P> 52<DL><DD><CODE>GXRenderModeObj* rmode = &GXNtsc240IntAa;<BR> GXSetCopyFilter( rmode->aa, rmode->sample_pattern, GX_TRUE, rmode->vfilter );</CODE></DD></DL> 53<P>Be aware that in order to make use of <SPAN class="argument">sample_pattern</SPAN>, anti-aliasing must be enabled by setting the embedded frame buffer (EFB) format to <CODE>GX_PF_RGB565_Z16</CODE>; see the <A href="../PixelProc/GXSetPixelFmt.html"><CODE>GXSetPixelFmt</CODE></A> function.</P> 54<P>The <SPAN class="argument">sample_pattern</SPAN> array is arranged as 12 pairs of (x,y) coordinates. Indices 0 through 2 are samples of the upper-left pixel. 3 to 5 are for the upper-right, 6 to 8 the lower-left, and 9 to 11 the lower-right. For each pixel, the subsample coordinates are stored in ascending y-coordinate order. For example, for the upper-left pixel, index 0 must have the smallest y coordinate, and index 2 the largest y coordinate.</P> 55<P>Subsample coordinates should all be within the range of 1 - 11. The coordinate grid for a single pixel is shown below. If the pixel below were pixel (0, 0) in the EFB, then the black subsample point in the middle would have a screen coordinate of (0.5, 0.5).</P> 56<P><IMG src="pixel.gif" alt="pixel.gif (2981 bytes)" border="0" width="214" height="214"></P> 57<P>If the <SPAN class="argument">aa</SPAN> parameter is <code>GX_TRUE</code>, then the supplied <SPAN class="argument">sample_pattern</SPAN> is used. If <SPAN class="argument">aa</SPAN> is <code>GX_FALSE</code>, then <SPAN class="argument">sample_pattern</SPAN> is ignored, and a default non-anti-aliased pattern is used instead. This pattern places all the subsamples at (6, 6). Note that this means that the pixel at (0, 0) has its sample at a screen coordinate of (0.5, 0.5).</P> 58<P>The <SPAN class="argument">vfilter</SPAN> array stores 7 coefficients for the vertical filter operation. Indices 0 and 1 are for the lower 2 samples of the upper pixel, 2 to 4 are for the middle pixel, and 5 and 6 are for the upper 2 samples of the lower pixel. The vertical filter is applied between the <A href="GXCopyDisp.html"><CODE>GXCopyDisp</CODE></A> and <A href="GXCopyTex.html"><CODE>GXCopyTex</CODE></A> functions' copy operations. The vertical filter is always used (regardless of anti-aliasing mode).</P> 59<P>The vertical filter coefficients must all be within the range of 0 to 63. In addition, we recommend that the coefficients have a sum total value of 64. It is possible to change the overall screen brightness by making the sum total of the coefficients a value other than 64, but depending on color values this could cause overflow and lead to display problems. Note that although a three-line filter is used for deflickering, only a single-line filter must be used during field rendering. If deflickering is not required for anti-aliasing, it is possible to see the advantages of a high-level filter.</P> 60<P>If the <SPAN class="argument">vf</SPAN> argument is <CODE>GX_TRUE</CODE>, then the supplied <SPAN class="argument">vfilter</SPAN> is used. If <SPAN class="argument">vf</SPAN> is <code>GX_FALSE</code>, then <SPAN class="argument">vfilter</SPAN> is ignored, and a default 1-line filter is used instead.</P> 61 62<h2>See Also</h2> 63<P class="reference"> 64<A href="RenderMode.html">Render Modes</A>, 65<A href="GXCopyDisp.html">GXCopyDisp</A>, 66<A href="GXCopyTex.html">GXCopyTex</A>, 67<A href="GXSetCopyClamp.html">GXSetCopyClamp</A>, 68<A href="../PixelProc/GXSetPixelFmt.html">GXSetPixelFmt</A> 69</p> 70 71<H2>Revision History</H2> 72<P> 732008/07/04 Updated notes concerning the use of filters.<br>2008/06/18 Updated the explanation of the vertical filter coefficients.<br>2006/03/01 Initial version.<br> 74</P> 75 76<hr><p>CONFIDENTIAL</p></body> 77</html>