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>TMCCJPEGEncEncode</title>
8<LINK rel="stylesheet" href="../../CSS/revolution.css" type="text/css">
9</head>
10
11<body>
12
13<h1 align="left">TMCCJPEGEncEncode</h1>
14<h2>Syntax</h2>
15
16<dl>
17  <dd>
18<CODE>#include &lt;revolution/tmcc_jpeg.h&gt;</CODE><BR> <BR>
19  <PRE><CODE>s32 TMCCJPEGEncEncode(
20        void *pWorkArea,
21        void *pTex,
22        u16 srcWidth,
23        u16 srcHeight,
24        GXTexFmt texFormat,
25        u32 QFactor,
26        void *pJpegBuffer,
27        u32 jpegBufferSize,
28        u32 *poutputSize
29);
30</CODE></PRE></dd>
31</dl>
32
33<h2>Arguments</h2>
34<TABLE border="1" width="100%">
35  <TBODY>
36    <TR>
37<TD width="13%"><EM><STRONG>*pWorkArea</STRONG></EM></TD>
38<TD width="87%">Configure the starting address of the work area.
39
40</TD>
41    </TR>
42    <TR>
43<TD width="13%"><EM><STRONG>*pTex</STRONG></EM></TD>
44<TD width="87%">Configure the starting address of the input texture data.
45
46</TD>
47    </TR>
48    <TR>
49<TD width="13%"><EM><STRONG>srcWidth</STRONG></EM></TD>
50<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.)
51</TD>
52    </TR>
53
54    <TR>
55<TD width="13%"><EM><STRONG>srcHeight</STRONG></EM></TD>
56<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.)
57</TD>
58    </TR>
59    <TR>
60<TD width="13%"><EM><STRONG>texFormat</STRONG></EM></TD>
61<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>.)
62
63
64</TD>
65    </TR>
66    <TR>
67<TD width="13%"><EM><STRONG>QFactor</STRONG></EM></TD>
68<TD width="87%">Specify the quality factor.<br>(A <CODE>TMCC_JPEG_OPT_ERR</CODE> error code is returned for input that exceeds the range of 1 to 500.)
69
70</TD>
71    </TR>
72    <TR>
73<TD width="13%"><EM><STRONG>*pJpegBuffer</STRONG></EM></TD>
74<TD width="87%">Specify the starting address of the work memory for the output JPEG data.
75</TD>
76    </TR>
77
78    <TR>
79<TD width="13%"><EM><STRONG>jpegBufferSize</STRONG></EM></TD>
80<TD width="87%">Specify the size of the work memory for the output JPEG data.<br>(If it appears that the JPEG output size will exceed this size, a <CODE>TMCC_JPEG_ENC_BUF_OVER</CODE> error code is returned. Allocate and configure a work memory size of at least <CODE>TMCC_JPEG_JPEGBUFFER_MINIMAM_SIZE</CODE> bytes.)
81
82</TD>
83    </TR>
84
85    <TR>
86<TD width="13%"><EM><STRONG>*poutputSize</STRONG></EM></TD>
87<TD width="87%">Size of the JPEG output data.
88
89</TD>
90    </TR>
91
92  </TBODY>
93</TABLE>
94
95
96<h2>Return Values</h2>
97<TABLE border="1">
98  <TBODY>
99    <TR>
100      <TD width="30%"><CODE>0</CODE></TD>
101<TD width="70%">Function completed successfully.</TD>
102    </TR>
103    <TR>
104<TD width="30%"><CODE>Negative</CODE></TD>
105<TD width="70%">Abnormal exit (error code).</TD>
106    </TR>
107  </TBODY>
108</TABLE>
109
110<H2>Description</H2>
111<P>Takes texture image data as input, JPEG-encodes it, and outputs compressed data. <BR>
112</P>
113
114<h2>See Also</h2>
115<p><CODE><A href="errorcode.html">Error Codes</A></CODE></p>
116<H2>Revision History</H2>
117<P>
1182009/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>
119<hr><p>CONFIDENTIAL</p></body>
120</html>
121