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.
27 /* maximum number of CPU cores allowed */
30 #include "TxInternal.h"
37 void tx_compress_dxtn_rgba(int srccomps, int width, int height,
38 const void *source, int destformat, void *dest,
41 int fxt1_encode(int width, int height, int comps,
42 const void *source, int srcRowStride,
43 void *dest, int destRowStride);
49 typedef void (*dxtCompressTexFuncExt)(int srccomps, int width,
50 int height, const void *srcPixData,
51 int destformat, void *dest,
54 typedef int (*fxtCompressTexFuncExt)(int width, int height, int comps,
55 const void *source, int srcRowStride,
56 void *dest, int destRowStride);
64 fxtCompressTexFuncExt _tx_compress_fxt1;
65 dxtCompressTexFuncExt _tx_compress_dxtn_rgba;
68 static TxLoadLib* getInstance() {
69 static TxLoadLib txLoadLib;
73 fxtCompressTexFuncExt getfxtCompressTexFuncExt();
74 dxtCompressTexFuncExt getdxtCompressTexFuncExt();
80 uint32 Adler32(const uint8* data, int Len, uint32 Adler);
81 uint32 Adler32(const uint8* src, int width, int height, int size, int rowStride);
82 uint32 RiceCRC32(const uint8* src, int width, int height, int size, int rowStride);
83 boolean RiceCRC32_CI4(const uint8* src, int width, int height, int size, int rowStride,
84 uint32* crc32, uint32* cimax);
85 boolean RiceCRC32_CI8(const uint8* src, int width, int height, int size, int rowStride,
86 uint32* crc32, uint32* cimax);
91 int sizeofTx(int width, int height, uint16 format);
92 uint32 checksumTx(uint8 *data, int width, int height, uint16 format);
94 uint32 chkAlpha(uint32* src, int width, int height);
96 uint32 checksum(uint8 *src, int width, int height, int size, int rowStride);
97 uint64 checksum64(uint8 *src, int width, int height, int size, int rowStride, uint8 *palette);
98 int grLodLog2(int w, int h);
99 int grAspectRatioLog2(int w, int h);
100 int getNumberofProcessors();
110 static TxMemBuf* getInstance() {
111 static TxMemBuf txMemBuf;
115 boolean init(int maxwidth, int maxheight);
117 uint8 *get(unsigned int num);
118 uint32 size_of(unsigned int num);
121 #endif /* __TXUTIL_H__ */