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=utf-8"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<title>TMCCJPEGEncGetQFactor</title> 8<LINK rel="stylesheet" href="../../CSS/revolution.css" type="text/css"> 9</head> 10 11<body> 12 13<h1 align="left">TMCCJPEGEncGetQFactor</h1> 14<h2>Syntax</h2> 15 16<dl> 17 <dd> 18<CODE>#include <revolution/tmcc_jpeg.h></CODE><BR> <BR> 19 <PRE><CODE>s32 TMCCJPEGEncGetQFactor( 20 void *pWorkArea, 21 void *pTex, 22 u16 srcWidth, 23 u16 srcHeight, 24 GXTexFmt texFormat, 25 u32 TargetSize, 26 u32 *poutputSize, 27 u32 *pQFactor 28); 29</CODE></PRE></dd> 30</dl> 31 32<h2>Arguments</h2> 33<TABLE border="1" width="100%"> 34 <TBODY> 35 <TR> 36<TD width="13%"><EM><STRONG>*pWorkArea</STRONG></EM></TD> 37<TD width="87%">Configure the starting address of the work area. 38 39</TD> 40 </TR> 41 <TR> 42<TD width="13%"><EM><STRONG>*pTex</STRONG></EM></TD> 43<TD width="87%">Configure the starting address of the input texture data. 44 45</TD> 46 </TR> 47 <TR> 48<TD width="13%"><EM><STRONG>srcWidth</STRONG></EM></TD> 49<TD width="87%">Specify the effective image width of the input texture.<br>(When the texture size does not match the effective image region, fill the remaining parts with dummy data. A <CODE>TMCC_JPEG_OPT_ERR</CODE> error code is returned for input that exceeds the range of 1 to 65,535.) 50</TD> 51 </TR> 52 53 <TR> 54<TD width="13%"><EM><STRONG>srcHeight</STRONG></EM></TD> 55<TD width="87%">Specify the effective image height of the input texture.<br>(When the texture size does not match the effective image region, fill the remaining parts with dummy data. A <CODE>TMCC_JPEG_OPT_ERR</CODE> error code is returned for input that exceeds the range of 1 to 65,535.) 56</TD> 57 </TR> 58 <TR> 59<TD width="13%"><EM><STRONG>texFormat</STRONG></EM></TD> 60<TD width="87%">Specify the texture format. <br>(A <CODE>TMCC_JPEG_TEXT_ERR</CODE> error code is returned for input that is neither <CODE>GX_TF_RGB565</CODE> nor <CODE>GX_TF_RGBA8</CODE>.) 61 62</TD> 63 </TR> 64 <TR> 65<TD width="13%"><EM><STRONG>TargetSize</STRONG></EM></TD> 66<TD width="87%">Specify the output size after compression. 67 68</TD> 69 </TR> 70 71 <TR> 72<TD width="13%"><EM><STRONG>*poutputSize</STRONG></EM></TD> 73<TD width="87%">Size that is possible to output, given <CODE>pQFactor</CODE>. 74</TD> 75 </TR> 76 77 <TR> 78<TD width="13%"><EM><STRONG>*pQFactor</STRONG></EM></TD> 79<TD width="87%">Image quality factor that can get <CODE>poutputSize</CODE> bytes of data. 80</TD> 81 </TR> 82 83 </TBODY> 84</TABLE> 85 86 87<h2>Return Values</h2> 88<TABLE border="1"> 89 <TBODY> 90 <TR> 91 <TD width="30%"><CODE>0</CODE></TD> 92<TD width="70%">Function completed successfully.</TD> 93 </TR> 94 <TR> 95<TD width="30%"><CODE>Negative</CODE></TD> 96<TD width="70%">Abnormal exit (error code).</TD> 97 </TR> 98 </TBODY> 99</TABLE> 100 101<H2>Description</H2> 102<P>To achieve JPEG output of an arbitrary data size, this function decides the image quality factor and the actual output size. Gets the actual output size (<CODE>*poutputSize</CODE>) and the image quality factor (<CODE>*pQFactor</CODE>) that is used to compress the input texture image data to the specified target size (<CODE>TargetSize</CODE>). The margin of error between the target size and the actual output size that was obtained will differ, depending on the input image. <BR> 103</P> 104 105<h2>See Also</h2> 106<p><CODE><A href="errorcode.html">Error Codes</A></CODE></p> 107<H2>Revision History</H2> 108<P> 1092009/10/19 Made changes to the description of the <CODE>include</CODE> file in line with integration into the Revolution SDK.<BR>2008/03/11 Changed the type for the <CODE>srcWidth</CODE> and <CODE>srcHeight</CODE> arguments.<BR> 2007/02/02 Initial version.</P> 110<hr><p>CONFIDENTIAL</p></body> 111</html> 112