没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > libsquish |
libsquish
|
1 | 0 | 45 |
贡献者 | 讨论 | 代码提交 |
squishNewsWe've moved! So far there have been just a few minor edits since version 1.10, check the issues for the planned changes.
FeaturesThe squish library (abbreviated to libsquish) is an open source DXT compression library written in C++ with the following features:
Supports the DXT1, DXT3 and DXT5 formats. Optimised for both SSE and Altivec SIMD instruction sets. Builds on multiple platforms (x86 and PPC tested). Very simple interface. A description of the algorithms used to perform the compression can be found on my blog.
Note that the cluster fit algorithm in squish now forms the core DXT compression algorithm for the NVIDIA Texture Tools. NVIDIA have been kind enough to allow implementation improvements to be refactored back into the library.
Example UsageSee squish.h in the distribution for the documentation. The library has only two functions, one to compress a block of 4x4 pixels and one to decompress. The following program will compress then decompress a single 4x4 DXT block:
#include
int main()
{
squish::u8 pixels[16*4]; // 16 pixels of input
squish::u8 block8; // 8 bytes of output
/* write some pixel data */
// compress the 4x4 block using DXT1 compression
squish::Compress( pixels, block, squish::kDxt1 );
// decompress the 4x4 block using DXT1 compression
squish::Decompress( pixels, block, squish::kDxt1 );
}A wrapper API is also included to compress entire images in a single call. In addition, there is an example program provided with the library that shows how to use the squish library to compress and decompress between PNG and DXT format images.
ContributorsThe squish library was originally written by:
Simon Brown
The following people have made significant contributions to the squish library:
Ignacio Castaño (NVIDIA)
AlternativesIt turns out that there are other open source DXT compression implementations out there on the interweb. Here is a list of the currently known competition:
Jason Dorie's image library: ImageLib Mesa S3TC compression library: libtxc_dxtn I haven't had the time yet to do any comparisons between these libraries and squish. If anyone has then please let me know!