#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <algorithm>
#include "libtxc_dxtn.h"
uint32_t LittleLong(uint32_t w)
fwrite(t, 18, 1, stdout);
int n = ((width + 3) / 4) * ((height + 3) / 4);
- unsigned char *buf = malloc(n * blocksize);
+ unsigned char *buf = (unsigned char *) malloc(n * blocksize);
fread(buf, blocksize, n, stdin);
int x, y;
{
char data[4];
fetch(width, buf, x, y, &data);
+ std::swap(data[0], data[2]);
fwrite(data, 4, 1, stdout);
}
return 0;
echo >&3 "<tr><th>Picture</th>"
echo >&3 "<th>Original</th>"
echo >&3 "<th>nvcompress</th>"
+ echo >&3 "<th>nvcompress (S2TC)</th>"
echo >&3 "<th>rand64-sRGB-mixed</th>"
echo >&3 "<th>norand-sRGB-mixed</th>"
echo >&3 "<th>faster-sRGB-mixed</th>"
convert "$1" -crop 256x256+192+128 "html/$1.png"
echo >&3 "<td><img src=\"$1.png\" alt=\"$1\"></td>"
}
+html2()
+{
+ ./s2tc_decompress < "$1" | convert TGA:- -crop 256x256+192+128 "html/$1-s2tc.png"
+ echo >&3 "<td><img src=\"$1.png\" alt=\"$1\"></td>"
+}
html_rowend()
{
echo >&3 "</tr>"
nvcompress "$i".tga "$i".dds
html "$i".dds
+ html2 "$i".dds
t "$i".tga "$i"-rand64-mrgb.dds ./s2tc -c SRGB_MIXED -r 64
t "$i".tga "$i"-norand-mrgb.dds ./s2tc -c SRGB_MIXED -r 0