5 CXX="g++ -Wall -Wextra -O3"
13 echo >&3 "<html><title>S2TC</title>"
15 <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
16 <script type="text/javascript">
22 me.data("src", me.attr("src"));
23 me.attr("src", me.data("src"));
24 if(refsrc == me.data("src"))
27 refsrc = me.data("src");
33 me.data("src", me.attr("src"));
35 me.attr("src", refsrc);
41 me.attr("src", me.data("src"));
45 $('img').click(clickfunc);
46 $('img').mouseenter(enterfunc);
47 $('img').mouseleave(leavefunc);
51 echo >&3 "<body onLoad=\"run()\"><h1>S2TC</h1>"
53 echo >&3 "<tr><th>Picture</th>"
54 echo >&3 "<th>Original</th>"
56 if $use_compressonator; then
57 echo >&3 "<th>Compressonator</th>"
59 if $use_nvcompress; then
60 echo >&3 "<th>nvcompress</th>"
62 echo >&3 "<th>rand64-sRGB-mixed</th>"
63 echo >&3 "<th>rand64-wavg</th>"
64 echo >&3 "<th>rand64-avg</th>"
66 if $use_libtxc_dxtn; then
67 echo >&3 "<th>libtxc_dxtn</th>"
69 echo >&3 "<th>norand-wavg</th>"
70 echo >&3 "<th>faster-wavg</th>"
76 echo >&3 "<tr><th>$1</th>"
80 convert "$1" -crop 256x256+192+128 "html/$1.png"
81 echo >&3 "<td><img src=\"$1.png\" alt=\"$1\"></td>"
85 ./s2tc_decompress < "$1" | convert TGA:- -crop 256x256+192+128 "html/$1-s2tc.png"
86 echo >&3 "<td><img src=\"$1-s2tc.png\" alt=\"$1\"></td>"
94 echo >&3 "</table></body></html>"
101 time "$@" < "$in" > "$out"
106 if which nvcompress >/dev/null 2>&1; then
111 if which wine >/dev/null 2>&1 && [ -f "$HOME/.wine/drive_c/Program Files (x86)/AMD/The Compressonator 1.50/TheCompressonator.exe" ]; then
112 use_compressonator=true
114 use_compressonator=false
116 if [ -f /usr/lib/libtxc_dxtn.so ]; then
119 use_libtxc_dxtn=false
123 for i in dxtfail base_concrete1a disabled floor_tile3a lift02 panel_ceil1a sunset amelia rms noise noise_solid supernova ishihara augenkrebs; do
128 if $use_compressonator; then
129 time wine "c:/Program Files (x86)/AMD/The Compressonator 1.50/TheCompressonator.exe" -convert -overwrite -mipmaps "$i".tga "$i"-amdcompress.dds -codec DXTC.dll +fourCC DXT1 -mipper BoxFilter.dll
130 html "$i"-amdcompress.dds
133 if $use_nvcompress; then
134 time nvcompress "$i".tga "$i"-nvcompress.dds
135 html "$i"-nvcompress.dds
138 ( S2TC_COLORDIST_MODE=SRGB_MIXED S2TC_RANDOM_COLORS=64 t "$i".tga "$i"-rand64-mrgb.dds ./s2tc )
139 ( S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=64 t "$i".tga "$i"-rand64-wavg.dds ./s2tc )
140 ( S2TC_COLORDIST_MODE=AVG S2TC_RANDOM_COLORS=64 t "$i".tga "$i"-rand64-avg.dds ./s2tc )
142 if $use_libtxc_dxtn; then
143 ( LD_PRELOAD=/usr/lib/libtxc_dxtn.so t "$i".tga "$i"-libtxc_dxtn.dds ./s2tc )
145 ( S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=0 t "$i".tga "$i"-norand-wavg.dds ./s2tc )
147 ( S2TC_COLORDIST_MODE=WAVG S2TC_RANDOM_COLORS=-1 t "$i".tga "$i"-faster-wavg.dds ./s2tc )