5 * Copyright (C) 2007 Hiroshi Morii All Rights Reserved.
6 * Email koolsmoky(at)users.sourceforge.net
7 * Web http://www.3dfxzone.it/koolsmoky
9 * this is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
14 * this is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with GNU Make; see the file COPYING. If not, write to
21 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 #ifndef __TXQUANTIZE_H__
25 #define __TXQUANTIZE_H__
27 /* Glide64 DXTn workaround
28 * (0:disable, 1:enable) */
29 #define GLIDE64_DXTN 1
31 #include "TxInternal.h"
40 fxtCompressTexFuncExt _tx_compress_fxt1;
41 dxtCompressTexFuncExt _tx_compress_dxtn;
43 /* fast optimized... well, sort of. */
44 void ARGB1555_ARGB8888(uint32* src, uint32* dst, int width, int height);
45 void ARGB4444_ARGB8888(uint32* src, uint32* dst, int width, int height);
46 void RGB565_ARGB8888(uint32* src, uint32* dst, int width, int height);
47 void A8_ARGB8888(uint32* src, uint32* dst, int width, int height);
48 void AI44_ARGB8888(uint32* src, uint32* dst, int width, int height);
49 void AI88_ARGB8888(uint32* src, uint32* dst, int width, int height);
51 void ARGB8888_ARGB1555(uint32* src, uint32* dst, int width, int height);
52 void ARGB8888_ARGB4444(uint32* src, uint32* dst, int width, int height);
53 void ARGB8888_RGB565(uint32* src, uint32* dst, int width, int height);
54 void ARGB8888_A8(uint32* src, uint32* dst, int width, int height);
55 void ARGB8888_AI44(uint32* src, uint32* dst, int width, int height);
56 void ARGB8888_AI88(uint32* src, uint32* dst, int width, int height);
59 void ARGB8888_RGB565_ErrD(uint32* src, uint32* dst, int width, int height);
60 void ARGB8888_ARGB1555_ErrD(uint32* src, uint32* dst, int width, int height);
61 void ARGB8888_ARGB4444_ErrD(uint32* src, uint32* dst, int width, int height);
62 void ARGB8888_AI44_ErrD(uint32* src, uint32* dst, int width, int height);
63 void ARGB8888_AI88_Slow(uint32* src, uint32* dst, int width, int height);
64 void ARGB8888_I8_Slow(uint32* src, uint32* dst, int width, int height);
67 boolean FXT1(uint8 *src, uint8 *dest,
68 int srcwidth, int srcheight, uint16 srcformat,
69 int *destwidth, int *destheight, uint16 *destformat);
70 boolean DXTn(uint8 *src, uint8 *dest,
71 int srcwidth, int srcheight, uint16 srcformat,
72 int *destwidth, int *destheight, uint16 *destformat);
79 void P8_16BPP(uint32* src, uint32* dst, int width, int height, uint32* palette);
81 boolean quantize(uint8* src, uint8* dest, int width, int height, uint16 srcformat, uint16 destformat, boolean fastQuantizer = 1);
83 boolean compress(uint8 *src, uint8 *dest,
84 int srcwidth, int srcheight, uint16 srcformat,
85 int *destwidth, int *destheight, uint16 *destformat,
90 void ARGB8888_I8(uint32* src, uint32* dst, int width, int height);
91 void I8_ARGB8888(uint32* src, uint32* dst, int width, int height);
93 void ARGB1555_ABGR8888(uint32* src, uint32* dst, int width, int height);
94 void ARGB4444_ABGR8888(uint32* src, uint32* dst, int width, int height);
95 void ARGB8888_ABGR8888(uint32* src, uint32* dst, int width, int height);
99 #endif /* __TXQUANTIZE_H__ */