merge gfx-opt branch
[drnoksnes] / imgdecmp.h
1 /*---------------------------------------------------------------------------*\
2  *
3  * (c) Copyright Microsoft Corp. 1997-98 All Rights Reserved
4  *
5  *  module: imgdecmp.h
6  *  date:
7  *  author: jaym
8  *
9  *  purpose: 
10  *
11 \*---------------------------------------------------------------------------*/
12 #ifndef __IMGDECMP_H__
13 #define __IMGDECMP_H__
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif // __cplusplus
18
19 #include "imgrendr.h"
20
21 typedef void (CALLBACK *PROGRESSFUNC)(IImageRender *pRender, BOOL bComplete, LPARAM lParam);
22 typedef DWORD (CALLBACK *GETDATAFUNC)(LPSTR szBuffer, DWORD dwBufferMax, LPARAM lParam);
23
24 typedef struct tagDecompressImageInfo {
25         DWORD                   dwSize;                                 // Size of this structure
26         LPBYTE                  pbBuffer;                               // Pointer to the buffer to use for data
27         DWORD                   dwBufferMax;                    // Size of the buffer
28         DWORD                   dwBufferCurrent;                // The amount of data which is current in the buffer
29         HBITMAP *               phBM;                                   // Pointer to the bitmap returned (can be NULL)
30         IImageRender ** ppImageRender;                  // Pointer to an IImageRender object (can be NULL)
31         int                             iBitDepth;                              // Bit depth of the output image
32         LPARAM                  lParam;                                 // User parameter for callback functions
33         HDC                             hdc;                                    // HDC to use for retrieving palettes
34         int                             iScale;                                 // Scale factor (1 - 100)
35         int                             iMaxWidth;                              // Maximum width of the output image
36         int                             iMaxHeight;                             // Maxumum height of the output image
37         GETDATAFUNC             pfnGetData;                             // Callback function to get more data
38         PROGRESSFUNC    pfnImageProgress;               // Callback function to notify caller of progress decoding the image
39         COLORREF                crTransparentOverride;  // If this color is not (UINT)-1, it will override the
40                                                                                         // transparent color in the image with this color. (GIF ONLY)
41 } DecompressImageInfo;
42
43 #define IMGDECOMP_E_NOIMAGE             0x800b0100
44
45 COLORREF *
46 GetHalftonePalette();
47
48 COLORREF *
49 Get332Palette();
50
51 HRESULT
52 DecompressImageIndirect(DecompressImageInfo *pParams);
53
54 #ifdef __cplusplus
55 };
56 #endif // __cplusplus
57
58 #endif // !__IMGDECMP_H__