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 http-equiv="Content-Style-Type" content="text/css"> 6<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>GXGetYScaleFactor</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXGetYScaleFactor</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17f32 GXGetYScaleFactor( u16 efbHeight, u16 xfbHeight ); 18</pre></dd></dl> 19 20<H2>Arguments</H2> 21<TABLE class="arguments" border="1" > 22 <TBODY> 23 <TR> 24<TH>efbHeight</TH> 25<TD>Height of embedded frame buffer (EFB). Ranges from 2 to 528. Should be a multiple of 2.</TD> 26 </TR> 27 <TR> 28<TH>xfbHeight</TH> 29<TD>Height of the requested XFB. Range from 2 to 1024. This needs to be equal to or greater than <CODE><STRONG><EM>efbHeight</EM></STRONG></CODE>.</TD> 30 </TR> 31 </TBODY> 32</TABLE> 33 34<H2>Return Values</H2> 35<P>Returns a Y scale factor that can be used as an argument in the <A href="GXSetDispCopyYScale.html"><CODE>GXSetDispCopyYScale</CODE></A> function.</P> 36 37<H2>Description</H2> 38<P>This function calculates an appropriate Y scale factor value for the <A href="GXSetDispCopyYScale.html"><CODE>GXSetDispCopyYScale</CODE></A> function, based on the height of embedded frame buffer (EFB) and the height of external framebuffer (XFB) you intend to use.</P> 39<P>This scale factor can be roughly approximated by the following equation:</P> 40<DL><DD><CODE>yscale = (f32)xfbHeight / (f32)efbHeight;</CODE></DD></DL> 41<P>Using this equation, however, may sometimes be a source of rounding errors when the value is sent to the hardware register, and you may not get the exact number of lines to copy that you intended. We recommend using this function to calculate accurate Y scale factors.</P> 42<P><B>Note:</B> It is still possible that you cannot get the number of actual XFB lines you desired because of the hardware restriction. (For example, you cannot get scaled 528 lines XFB from 480 lines EFB.) For such cases, this function returns a scale factor that makes the number of lines that is feasible and as close as possible to the original <SPAN class="argument">xfbHeight</SPAN> argument. However, this line number will never be greater than the original height, <SPAN class="argument">xfbHeight</SPAN>. If you try 480 to 528 scaling, the number of actual lines becomes 527.)</P> 43<P>The number of actual lines copied is gotten as the return value of the <A href="GXSetDispCopyYScale.html"><CODE>GXSetDispCopyYScale</CODE></A> function. You may also use the <A href="GXGetNumXfbLines.html"><CODE>GXGetNumXfbLines</CODE></A> function.</P> 44 45<H2>See Also</H2> 46<P class="reference"> 47<A href="GXSetDispCopyYScale.html">GXSetDispCopyYScale</A>, 48<A href="GXGetNumXfbLines.html">GXGetNumXfbLines</A> 49</P> 50 51<H2>Revision History</H2> 52<P> 532006/03/01 Initial version.<br> 54</P> 55 56<hr><p>CONFIDENTIAL</p></body> 57</HTML>