Misc changes.
This commit is contained in:
parent
bff3dab505
commit
ac3f2d1794
@ -85,8 +85,8 @@ void nv::Quantize::FloydSteinberg_BinaryAlpha( Image * image, int alpha_threshol
|
|||||||
memset(row0, 0, sizeof(float)*(w+2));
|
memset(row0, 0, sizeof(float)*(w+2));
|
||||||
memset(row1, 0, sizeof(float)*(w+2));
|
memset(row1, 0, sizeof(float)*(w+2));
|
||||||
|
|
||||||
for(uint y = 0; y < h; y++) {
|
for (uint y = 0; y < h; y++) {
|
||||||
for(uint x = 0; x < w; x++) {
|
for (uint x = 0; x < w; x++) {
|
||||||
|
|
||||||
Color32 pixel = image->pixel(x, y);
|
Color32 pixel = image->pixel(x, y);
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ void nv::Quantize::FloydSteinberg_BinaryAlpha( Image * image, int alpha_threshol
|
|||||||
int alpha = int(pixel.a) + int(row0[1+x]);
|
int alpha = int(pixel.a) + int(row0[1+x]);
|
||||||
|
|
||||||
// Convert color.
|
// Convert color.
|
||||||
if( alpha > alpha_threshold ) pixel.a = 255;
|
if (alpha > alpha_threshold) pixel.a = 255;
|
||||||
else pixel.a = 0;
|
else pixel.a = 0;
|
||||||
|
|
||||||
// Store color.
|
// Store color.
|
||||||
|
@ -497,11 +497,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (format == nvtt::Format_BC2) {
|
if (format == nvtt::Format_BC2) {
|
||||||
// Dither alpha when using BC2.
|
// Dither alpha when using BC2.
|
||||||
compressionOptions.setQuantization(false, true, false);
|
compressionOptions.setQuantization(/*color dithering*/false, /*alpha dithering*/true, /*binary alpha*/false);
|
||||||
}
|
}
|
||||||
else if (format == nvtt::Format_BC1a) {
|
else if (format == nvtt::Format_BC1a) {
|
||||||
// Binary alpha when using BC1a.
|
// Binary alpha when using BC1a.
|
||||||
compressionOptions.setQuantization(false, true, true, 127);
|
compressionOptions.setQuantization(/*color dithering*/false, /*alpha dithering*/true, /*binary alpha*/true, 127);
|
||||||
}
|
}
|
||||||
else if (format == nvtt::Format_RGBA)
|
else if (format == nvtt::Format_RGBA)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user