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 17<h2>C Specification</h2> 18 19<dl> 20 <dd><PRE><CODE>#include <revolution/gx.h></CODE></PRE> 21 </dd> 22 <dd><pre><CODE>void GXSetCopyFilter( 23 <A href="../Enumerated_Types/GXBool.html">GXBool</A> aa, 24 const u8 sample_pattern[12][2], 25 <A href="../Enumerated_Types/GXBool.html">GXBool</A> vf, 26 const u8 vfilter[7] );</CODE></pre> 27 </dd> 28</dl> 29 30<h2>Arguments</h2> 31<TABLE border="1" cellpadding="3" cellspacing="0.1"> 32 <tr> 33<TD width="120" bgcolor="#ffffe8"><em><strong><code>aa</code></strong></em></TD> 34<TD width="520">for <CODE>GX_TRUE</CODE>, use <code>sample_pattern</code><BR>Otherwise, sample pixels at their centers.</TD> 35 </tr> 36 <tr> 37<TD width="120" bgcolor="#ffffe8"><em><strong><code>sample_pattern</code></strong></em></TD> 38<TD width="520">The sample pattern for the pixel cell. <BR>The valid range is [1..11].</TD> 39 </tr> 40 <tr> 41<TD width="120" bgcolor="#ffffe8"><em><strong><code>vf</code></strong></em></TD> 42<TD width="520">For <CODE>GX_TRUE</CODE>, use <code>vfilter</code>. <BR>Otherwise, use the default 1-line filter.</TD> 43 </tr> 44 <tr> 45<TD width="120" bgcolor="#ffffe8"><em><strong><code>vfilter</code></strong></em></TD> 46<TD width="520">The vertical filter coefficient. <BR>Its valid range is [0..63]. The sum of the coefficients must equal 64.</TD> 47 </tr> 48</TABLE> 49<h2>Return Values</h2> 50 51<p>None.</p> 52<H2>Description</H2> 53<P>This function sets the subpixel sample patterns and vertical filter coefficients used to filter subpixels into pixels. This function normally uses the <em><strong><code>aa</code></strong></em>, <em><strong><code>sample_pattern</code></strong></em>, and <em><strong><code>vfilter</code></strong></em> provided by the <code><a href="RenderMode.html">Render Mode</a></code> structure:</P> 54<P><CODE>GXRenderModeObj* rmode = &GXNtsc240IntAa;<BR> GXSetCopyFilter( rmode->aa, rmode->sample_pattern, GX_TRUE, rmode->vfilter );</CODE></P> 55<P>Be aware that in order to make use of <em><strong><code>sample_pattern</code></strong></em>, anti-aliasing must be enabled by setting the embedded frame buffer (EFB) format to <code>GX_PF_RGB565_Z16</code>; see <a href="../PixelProc/GXSetPixelFmt.html"><code>GXSetPixelFmt</code></a>.</P> 56<P>The <em><strong><code>sample_pattern</code></strong></em> 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 is 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> 57<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> 58<P><IMG src="pixel.gif" alt="pixel.gif (2981 bytes)" border="0" width="214" height="214"></P> 59<P>If the <em><strong><code>aa</code></strong></em> parameter is <code>GX_TRUE</code>, then the supplied <em><strong><code>sample_pattern</code></strong></em> is used. If <em><strong><code>aa</code></strong></em> is <code>GX_FALSE</code>, then <em><strong><code>sample_pattern</code></strong></em> is ignored, and a default non-anti-aliased pattern is used instead. This pattern places all the subsamples at (6, 6). This means that the pixel at (0, 0) has its sample at a screen coordinate of (0.5, 0.5).</P> 60<P>The <em><strong><code>vfilter</code></strong></em> 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 <code><a href="GXCopyDisp.html">GXCopyDisp</a></code> and <code><a href="GXCopyTex.html">GXCopyTex</a></code> copy operations. The vertical filter is always used (regardless of anti-aliasing mode).</P> 61<P>Vertical filter coefficients should all be within the range of 0 to 63, and they should add up to a total of 64. Be aware that using field rendering requires using only a 1-line filter, while deflickering requires a 3-line filter. Anti-aliasing can benefit from a broader filter (where possible) even when deflickering is not required.</P> 62<P>If the <em><strong><code>vf</code></strong></em> argument is <code>GX_TRUE</code>, then the supplied <em><strong><code>vfilter</code></strong></em> is used. If <em><strong><code>vf</code></strong></em> is <code>GX_FALSE</code>, then <em><strong><code>vfilter</code></strong></em> is ignored, and a default 1-line filter is used instead.</P> 63 64 65 66 67<h2>See Also</h2> 68<p><A href="RenderMode.html">Render Modes</A></p> 69<p><code><a href="GXCopyDisp.html">GXCopyDisp</a><br> <a href="GXCopyTex.html">GXCopyTex</a><br></code><code><a href="GXSetCopyClamp.html">GXSetCopyClamp</a><br> <a href="../PixelProc/GXSetPixelFmt.html">GXSetPixelFmt</a></code></p> 70<H2>Revision History</H2> 71<P>2006/03/01 Initial version.</P><hr> 72<P>CONFIDENTIAL</p> 73</BODY> 74</HTML>