Rice GLES2 (from mupen64plus-ae) plugin. Compile but doesn't works well on the OpenPa...
[mupen64plus-pandora.git] / source / gles2rice / src / TextureFilters.h
1 /*
2 Copyright (C) 2003 Rice1964
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17
18 */
19
20
21 #ifndef __FILTERS_H__
22 #define __FILTERS_H__
23
24 #include "Config.h"
25 #include "TextureManager.h"
26
27 #define DWORD_MAKE(r, g, b, a)   ((uint32) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
28 #define WORD_MAKE(r, g, b, a)   ((uint16) (((a) << 12) | ((r) << 8) | ((g) << 4) | (b)))
29
30 extern void InitExternalTextures(void);
31 extern void CloseExternalTextures(void);
32
33 void Texture2x_32( DrawInfo &srcInfo, DrawInfo &destInfo);
34 void Texture2x_16( DrawInfo &srcInfo, DrawInfo &destInfo);
35
36 void Texture2x_Interp_32( DrawInfo &srcInfo, DrawInfo &destInfo);
37 void Texture2x_Interp_16( DrawInfo &srcInfo, DrawInfo &destInfo);
38
39 void Super2xSaI_32( uint32 *srcPtr, uint32 *destPtr, uint32 width, uint32 height, uint32 pitch);
40 void Super2xSaI_16( uint16 *srcPtr, uint16 *destPtr, uint32 width, uint32 height, uint32 pitch);
41
42 void hq4x_16( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int SrcPPL, int BpL );
43 void hq4x_32( unsigned char * pIn, unsigned char * pOut, int Xres, int Yres, int SrcPPL, int BpL );
44 void hq4x_InitLUTs(void);
45
46 void SmoothFilter_32(uint32 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1);
47 void SmoothFilter_16(uint16 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_ENHANCEMENT_WITH_SMOOTH_FILTER_1);
48
49 void SharpenFilter_32(uint32 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_SHARPEN_ENHANCEMENT);
50 void SharpenFilter_16(uint16 *pdata, uint32 width, uint32 height, uint32 pitch, uint32 filter=TEXTURE_SHARPEN_ENHANCEMENT);
51
52 void hq2x_init(unsigned bits_per_pixel);
53 void hq2x_16(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
54 void hq2x_32(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
55
56 void lq2x_16(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
57 void lq2x_32(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height);
58
59 typedef enum _IMAGE_FILEFORMAT 
60 {
61    XIFF_BMP = 0,
62      XIFF_JPG = 1,
63      XIFF_TGA = 2,
64      XIFF_PNG = 3,
65      XIFF_DDS = 4,
66      XIFF_PPM = 5,
67      XIFF_DIB = 6,
68      XIFF_HDR = 7,
69      XIFF_PFM = 8,
70      XIFF_FORCE_DWORD = 0x7fffffff
71 } IMAGE_FILEFORMAT;
72
73 typedef struct _IMAGE_INFO
74 {
75    unsigned int Width;
76    unsigned int Height;
77    unsigned int Depth;
78    unsigned int MipLevels;
79    int          Format;  /* SURFFORMAT */
80    IMAGE_FILEFORMAT ImageFileFormat;
81 } IMAGE_INFO;
82
83 #endif
84