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<H2>C Specification</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <revolution/gx.h></CODE></PRE> 16 <DD> 17 <PRE><CODE>f32 GXGetYScaleFactor( u16 efbHeight, u16 xfbHeight );</CODE></PRE> 18</DL> 19<H2>Arguments</H2> 20<TABLE border="1" cellpadding="3" cellspacing="0.1"> 21 <TBODY> 22 <TR> 23<TD width="120" bgcolor="#ffffe8"><I><B><code>efbHeight</code></B></I></TD> 24<TD width="520">Height of embedded frame buffer (EFB). Range from 2 to 528 Should be multiples of two.</TD> 25 </TR> 26 <TR> 27<TD width="120" bgcolor="#ffffe8"><EM><STRONG><CODE>xfbHeight</FONT></STRONG></EM></TD> 28<TD width="520">Height of the external frame buffer (XFB) requested. Ranges from 2 to 1024. This needs to be equal to or greater than <FONT face="Courier New, Courier, mono">efbHeight</FONT></I></B>.</TD> 29 </TR> 30 </TBODY> 31</TABLE> 32<H2>Return Values</H2> 33<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> 34<H2>Description</H2> 35<P>This function calculates an appropriate Y scale factor value for <code><a href="GXSetDispCopyYScale.html">GXSetDispCopyYScale</a></code> based on the height of embedded frame buffer (EFB) and the height of external framebuffer (XFB) you intend to use.</P> 36<P>This scale factor can be roughly calculated by the following equation:</P> 37<P><font size="2"><CODE> yscale = (f32)xfbHeight / (f32)efbHeight;</CODE></FONT></P> 38<P> which sometimes causes rounding error when the value is sent to the hardware register and you may not get the intended number of lines copied. So you should use this function to calculate accurate Y scale factors.</P> 39<P><B>Note:</B> It's still possible that you can't get the number of actual XFB lines you desired because of the hardware restriction. (For example, you can't get scaled 528 lines XFB from 480 lines EFB.) For such cases, this API returns a scale factor which makes the number of actual lines closer to the original <b><i>xfbHeight</i></b> argument. However, the number will never be greater than the original height. If you try 480 to 528 scaling, the number of actual lines becomes 527.</P> 40<P> The number of actual lines copied is obtained as the return value of <code><a href="GXSetDispCopyYScale.html">GXSetDispCopyYScale</a></code>. Or you can use <a href="GXGetNumXfbLines.html"><code>GXGetNumXfbLines</code></a> as well.</P> 41 42 43<H2>See Also</H2> 44<P><a href="GXSetDispCopyYScale.html">GXSetDispCopyYScale</a><br> <a href="GXGetNumXfbLines.html">GXGetNumXfbLines</a></P> 45<H2>Revision History</H2> 46<P>2006/03/01 Initial version</P><hr> 47<P>CONFIDENTIAL</p> 48</BODY> 49</HTML>