Path: blob/master/libmupen64plus/mupen64plus-video-glide64mk2/src/GlideHQ/TxQuantize.h
2 views
/*1* Texture Filtering2* Version: 1.03*4* Copyright (C) 2007 Hiroshi Morii All Rights Reserved.5* Email koolsmoky(at)users.sourceforge.net6* Web http://www.3dfxzone.it/koolsmoky7*8* this is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2, or (at your option)11* any later version.12*13* this is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with GNU Make; see the file COPYING. If not, write to20* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.21*/2223#ifndef __TXQUANTIZE_H__24#define __TXQUANTIZE_H__2526/* Glide64 DXTn workaround27* (0:disable, 1:enable) */28#define GLIDE64_DXTN 12930#include "TxInternal.h"31#include "TxUtil.h"3233class TxQuantize34{35private:36TxUtil *_txUtil;37int _numcore;3839fxtCompressTexFuncExt _tx_compress_fxt1;40dxtCompressTexFuncExt _tx_compress_dxtn;4142/* fast optimized... well, sort of. */43void ARGB1555_ARGB8888(uint32* src, uint32* dst, int width, int height);44void ARGB4444_ARGB8888(uint32* src, uint32* dst, int width, int height);45void RGB565_ARGB8888(uint32* src, uint32* dst, int width, int height);46void A8_ARGB8888(uint32* src, uint32* dst, int width, int height);47void AI44_ARGB8888(uint32* src, uint32* dst, int width, int height);48void AI88_ARGB8888(uint32* src, uint32* dst, int width, int height);4950void ARGB8888_ARGB1555(uint32* src, uint32* dst, int width, int height);51void ARGB8888_ARGB4444(uint32* src, uint32* dst, int width, int height);52void ARGB8888_RGB565(uint32* src, uint32* dst, int width, int height);53void ARGB8888_A8(uint32* src, uint32* dst, int width, int height);54void ARGB8888_AI44(uint32* src, uint32* dst, int width, int height);55void ARGB8888_AI88(uint32* src, uint32* dst, int width, int height);5657/* quality */58void ARGB8888_RGB565_ErrD(uint32* src, uint32* dst, int width, int height);59void ARGB8888_ARGB1555_ErrD(uint32* src, uint32* dst, int width, int height);60void ARGB8888_ARGB4444_ErrD(uint32* src, uint32* dst, int width, int height);61void ARGB8888_AI44_ErrD(uint32* src, uint32* dst, int width, int height);62void ARGB8888_AI88_Slow(uint32* src, uint32* dst, int width, int height);63void ARGB8888_I8_Slow(uint32* src, uint32* dst, int width, int height);6465/* compressors */66boolean FXT1(uint8 *src, uint8 *dest,67int srcwidth, int srcheight, uint16 srcformat,68int *destwidth, int *destheight, uint16 *destformat);69boolean DXTn(uint8 *src, uint8 *dest,70int srcwidth, int srcheight, uint16 srcformat,71int *destwidth, int *destheight, uint16 *destformat);7273public:74TxQuantize();75~TxQuantize();7677/* others */78void P8_16BPP(uint32* src, uint32* dst, int width, int height, uint32* palette);7980boolean quantize(uint8* src, uint8* dest, int width, int height, uint16 srcformat, uint16 destformat, boolean fastQuantizer = 1);8182boolean compress(uint8 *src, uint8 *dest,83int srcwidth, int srcheight, uint16 srcformat,84int *destwidth, int *destheight, uint16 *destformat,85int compressionType);868788#if 0 /* unused */89void ARGB8888_I8(uint32* src, uint32* dst, int width, int height);90void I8_ARGB8888(uint32* src, uint32* dst, int width, int height);9192void ARGB1555_ABGR8888(uint32* src, uint32* dst, int width, int height);93void ARGB4444_ABGR8888(uint32* src, uint32* dst, int width, int height);94void ARGB8888_ABGR8888(uint32* src, uint32* dst, int width, int height);95#endif96};9798#endif /* __TXQUANTIZE_H__ */99100101