1 /*---------------------------------------------------------------------------*
2   Project:  Revolution THP Core Library
3   File:     thpcore.h
4 
5   Copyright (C)2003-2006 Nintendo  All Rights Reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Log: thpcore.h,v $
14   Revision 1.1  02/08/2006 02:52:42  aka
15   Imported from Dolphin Tree.
16 
17 
18     3     03/09/15 1:19p Akagi
19     Modified misspelling and renamed a function.
20 
21     2     03/07/03 10:56a Akagi
22     Renamed some functions.
23 
24     1     03/07/01 3:10p Akagi
25     Initial check-in. Modified to divide old THPConv.exe into 2 LIBs and 1
26     EXE by Ohki-san@NTSC.
27 
28   $NoKeywords: $
29 
30  *---------------------------------------------------------------------------*/
31 
32 #ifndef __THPCORE_H__
33 #define __THPCORE_H__
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <revolution/types.h>
40 
41 // Structure
42 
43 //--------------------------------------
44 // THPImageStatus
45 //--------------------------------------
46 typedef struct
47 {
48     u32     xSize;
49     u32     ySize;
50     u32     h[3];
51     u32     v[3];
52     u32     imageSize;
53 
54 } THPImageStatus;
55 
56 // Global Value
57 
58 //--------------------------------------
59 // VerboseFlag(default: 0)
60 //--------------------------------------
61 extern u32 THPVerboseFlag;
62 
63 //--------------------------------------
64 // Output message callback
65 //--------------------------------------
66 extern void (*THPPrintFunc)( const char* format, va_list argptr );
67 
68 //--------------------------------------
69 // Output Error message callback
70 //--------------------------------------
71 extern void (*THPPrintErrorFunc)( const char* format, va_list argptr );
72 
73 //--------------------------------------
74 // Output Log message callback(If VerboseFlag =1)
75 //--------------------------------------
76 extern void (*THPPrintLogFunc)( const char* format, va_list argptr );
77 
78 //--------------------------------------
79 // Memory fllocation callback(default: malloc)
80 //--------------------------------------
81 extern void* (*THPMalloc)( size_t size );
82 
83 //--------------------------------------
84 // Memory free callback (default: free)
85 //--------------------------------------
86 extern void (*THPFree)( void* memblock );
87 
88 // Function
89 
90 //--------------------------------------
91 // Output message
92 //--------------------------------------
93 void THPPrint( const char* format, ... );
94 
95 //--------------------------------------
96 // Output Error message
97 //--------------------------------------
98 void THPPrintError( const char* format, ... );
99 
100 //--------------------------------------
101 // Output Log message
102 //--------------------------------------
103 void THPPrintLog( const char* format, ... );
104 
105 //--------------------------------------
106 // Convert jpeg to thp
107 //--------------------------------------
108 s32  THPConvertJPEG2THP( void *jpeg_ptr, void* thp_ptr, s32 jpeg_length, THPImageStatus* status );
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif // __THPCORE_H__
115