| 1 | /* |
| 2 | * Texture Filtering |
| 3 | * Version: 1.0 |
| 4 | * |
| 5 | * Copyright (C) 2007 Hiroshi Morii All Rights Reserved. |
| 6 | * Email koolsmoky(at)users.sourceforge.net |
| 7 | * Web http://www.3dfxzone.it/koolsmoky |
| 8 | * |
| 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) |
| 12 | * any later version. |
| 13 | * |
| 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. |
| 18 | * |
| 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. |
| 22 | */ |
| 23 | |
| 24 | #ifndef __TXFILTER_H__ |
| 25 | #define __TXFILTER_H__ |
| 26 | |
| 27 | #include "TxInternal.h" |
| 28 | #include "TxQuantize.h" |
| 29 | #include "TxHiResCache.h" |
| 30 | #include "TxTexCache.h" |
| 31 | #include "TxUtil.h" |
| 32 | #include "TxImage.h" |
| 33 | #include <string> |
| 34 | |
| 35 | class TxFilter |
| 36 | { |
| 37 | private: |
| 38 | int _numcore; |
| 39 | |
| 40 | uint8 *_tex1; |
| 41 | uint8 *_tex2; |
| 42 | int _maxwidth; |
| 43 | int _maxheight; |
| 44 | int _maxbpp; |
| 45 | int _options; |
| 46 | int _cacheSize; |
| 47 | std::wstring _ident; |
| 48 | std::wstring _datapath; |
| 49 | std::wstring _cachepath; |
| 50 | TxQuantize *_txQuantize; |
| 51 | TxTexCache *_txTexCache; |
| 52 | TxHiResCache *_txHiResCache; |
| 53 | TxUtil *_txUtil; |
| 54 | TxImage *_txImage; |
| 55 | boolean _initialized; |
| 56 | void clear(); |
| 57 | public: |
| 58 | ~TxFilter(); |
| 59 | TxFilter(int maxwidth, |
| 60 | int maxheight, |
| 61 | int maxbpp, |
| 62 | int options, |
| 63 | int cachesize, |
| 64 | wchar_t *datapath, |
| 65 | wchar_t *cachepath, |
| 66 | wchar_t *ident, |
| 67 | dispInfoFuncExt callback); |
| 68 | boolean filter(uint8 *src, |
| 69 | int srcwidth, |
| 70 | int srcheight, |
| 71 | uint16 srcformat, |
| 72 | uint64 g64crc, /* glide64 crc, 64bit for future use */ |
| 73 | GHQTexInfo *info); |
| 74 | boolean hirestex(uint64 g64crc, /* glide64 crc, 64bit for future use */ |
| 75 | uint64 r_crc64, /* checksum hi:palette low:texture */ |
| 76 | uint16 *palette, |
| 77 | GHQTexInfo *info); |
| 78 | uint64 checksum64(uint8 *src, int width, int height, int size, int rowStride, uint8 *palette); |
| 79 | boolean dmptx(uint8 *src, int width, int height, int rowStridePixel, uint16 gfmt, uint16 n64fmt, uint64 r_crc64); |
| 80 | boolean reloadhirestex(); |
| 81 | }; |
| 82 | |
| 83 | #endif /* __TXFILTER_H__ */ |