1 // Online Manual-Specific Headers
2 #ifndef HBM_NETWORKMANUAL_H_
3 #define HBM_NETWORKMANUAL_H_
4 
5 #ifdef __cplusplus
6 extern "C"
7 {
8 #endif /*__cplusplus */
9 
10 #define HBM_ADD_LAYOUT
11 
12 #include <revolution/gx.h>
13 
14 
15 
16 typedef struct
17 {
18     void* layoutBuf;
19     void* msgBuf;
20     void* graphicBuf;
21     void* reserve;
22     u16		width;
23     u16		height;
24     GXTexFmt texFmt;
25 }
26 HBMNetworkManualInfo;
27 
28 //	Be absolutely sure to call this between HBMCreate and HBMInit.
29 void	HBMCreateEx( const HBMNetworkManualInfo* input );
30 //	Call this if you only want to deallocate additional data without calling HBMDelete().
31 void	HBMDeleteEx();
32 
33 
34 
35 #define JPG_NOERROR                 0
36 #define JPG_GET_BUFFER_SIZE_ERROR   -1
37 #define JPG_DECODE_ERROR            -2
38 
39 /*---------------------------------------------------------------------------*
40   Name:         HBMJPGGetTextureBufferSize
41 
42   Description:  Gets the required size of the texture buffer from JPEG data.
43                 The computational cost of finding the size by calculation can be lowered if you know the texture size in advance.
44 
45 
46   Arguments:    *jpeg_workarea -  Work memory for decoding JPEGs
47                 *buffersize -     Returns the data size of the buffer
48                 *width -          Returns the width of the buffer
49                 *height -         Returns the height of the buffer
50                 *jpg -            JPEG stream
51                 jpg_size -        JPEG stream size
52                 format -          Format of the texture to output
53 
54   Returns:
55  *---------------------------------------------------------------------------*/
56 s32	HBMJPGGetTextureBufferSize( void *jpeg_workarea, s32 *buffersize,
57 	u16 *width, u16 *height, void *jpg, u32 jpg_size, GXTexFmt format );
58 
59 /*---------------------------------------------------------------------------*
60   Name:         HBMJPGMakeTextureBuffer
61 
62   Description:  Decodes from a JPEG into a texture buffer
63 
64   Arguments:    *jpeg_workarea -  Work memory for decoding JPEGs
65                 *result -         Destination buffer for the decoding
66                 buf_size -        Buffer size of the destination buffer for the decoding
67                 *jpg -            JPEG stream
68                 jpg_size -        JPEG stream size
69                 format -          Format of the texture to output
70 
71   Returns:
72  *---------------------------------------------------------------------------*/
73 s32	HBMJPGMakeTextureBuffer( void *jpeg_workarea, void *result,
74 	u32 buf_size, void *jpg, u32 jpg_size, GXTexFmt format );
75 
76 
77 
78 #ifdef __cplusplus
79 }
80 #endif /*__cplusplus */
81 
82 #endif /* HBM_NETWORKMANUAL_H_ */
83