mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-12-02 22:34:21 +01:00
a80944901e
In order to better facilitate the change from block stream order to non-block stream order, a lot of changes were introduced to the way that we feed texture data to the compressors. This data is embodied in the CompressionJob struct. We have made it so that the compression job points to both the in and out pointers for our compressed and uncompressed data. Furthermore, we have made sure that the struct also contains the format that its compressing for, so that if any threading programs would like to chop up a compression job into smaller chunks based on the format, it doesn't need to know the format explicitly, it just needs to know certain properties about the format. Moreover, the user can now define the start and end pixels from which we would like to compress to. We can compress subsets of data by changing the in and out pointers and the width and height values. The compressors will read data linearly until they reach the out pixels based on the width of the given pixel.
35 lines
1.2 KiB
C++
Executable File
35 lines
1.2 KiB
C++
Executable File
/*
|
|
This code is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Lesser General Public
|
|
License as published by the Free Software Foundation; either
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
This code is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Lesser General Public License for more details.
|
|
*/
|
|
|
|
#include "TexCompTypes.h"
|
|
#include "CompressionJob.h"
|
|
|
|
namespace DXTC
|
|
{
|
|
// DXT compressor (scalar version).
|
|
void CompressImageDXT1(const FasTC::CompressionJob &);
|
|
void CompressImageDXT5(const FasTC::CompressionJob &);
|
|
|
|
void DecompressDXT1(const FasTC::DecompressionJob &);
|
|
|
|
uint16 ColorTo565(const uint8* color);
|
|
void EmitByte(uint8*& dest, uint8 b);
|
|
void EmitWord(uint8*& dest, uint16 s);
|
|
void EmitDoubleWord(uint8*& dest, uint32 i);
|
|
|
|
#if 0
|
|
// DXT compressor (SSE2 version).
|
|
void CompressImageDXT1SSE2(const uint8* inBuf, uint8* outBuf, uint32 width, uint32 height);
|
|
void CompressImageDXT5SSE2(const uint8* inBuf, uint8* outBuf, uint32 width, uint32 height);
|
|
#endif
|
|
}
|