Add target decoder compression option.
This commit is contained in:
parent
cd6f798b85
commit
b74cd8ec97
@ -69,6 +69,8 @@ void CompressionOptions::reset()
|
|||||||
m.enableAlphaDithering = false;
|
m.enableAlphaDithering = false;
|
||||||
m.binaryAlpha = false;
|
m.binaryAlpha = false;
|
||||||
m.alphaThreshold = 127;
|
m.alphaThreshold = 127;
|
||||||
|
|
||||||
|
m.decoder = Decoder_D3D10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -185,6 +187,13 @@ void CompressionOptions::setQuantization(bool colorDithering, bool alphaDitherin
|
|||||||
m.alphaThreshold = alphaThreshold;
|
m.alphaThreshold = alphaThreshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set target decoder to optimize for.
|
||||||
|
void CompressionOptions::setTargetDecoder(Decoder decoder)
|
||||||
|
{
|
||||||
|
m.decoder = decoder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Translate to and from D3D formats.
|
// Translate to and from D3D formats.
|
||||||
unsigned int CompressionOptions::d3d9Format() const
|
unsigned int CompressionOptions::d3d9Format() const
|
||||||
|
@ -62,6 +62,8 @@ namespace nvtt
|
|||||||
bool binaryAlpha;
|
bool binaryAlpha;
|
||||||
int alphaThreshold; // reference value used for binary alpha quantization.
|
int alphaThreshold; // reference value used for binary alpha quantization.
|
||||||
|
|
||||||
|
Decoder decoder;
|
||||||
|
|
||||||
uint getBitCount() const
|
uint getBitCount() const
|
||||||
{
|
{
|
||||||
if (format == Format_RGBA) {
|
if (format == Format_RGBA) {
|
||||||
|
@ -121,6 +121,15 @@ namespace nvtt
|
|||||||
Quality_Highest,
|
Quality_Highest,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// DXT decoder.
|
||||||
|
enum Decoder
|
||||||
|
{
|
||||||
|
Decoder_D3D10,
|
||||||
|
Decoder_D3D9,
|
||||||
|
Decoder_NV5x,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/// Compression options. This class describes the desired compression format and other compression settings.
|
/// Compression options. This class describes the desired compression format and other compression settings.
|
||||||
struct CompressionOptions
|
struct CompressionOptions
|
||||||
{
|
{
|
||||||
@ -148,6 +157,8 @@ namespace nvtt
|
|||||||
|
|
||||||
NVTT_API void setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127);
|
NVTT_API void setQuantization(bool colorDithering, bool alphaDithering, bool binaryAlpha, int alphaThreshold = 127);
|
||||||
|
|
||||||
|
NVTT_API void setTargetDecoder(Decoder decoder);
|
||||||
|
|
||||||
// Translate to and from D3D formats.
|
// Translate to and from D3D formats.
|
||||||
NVTT_API unsigned int d3d9Format() const;
|
NVTT_API unsigned int d3d9Format() const;
|
||||||
//NVTT_API bool setD3D9Format(unsigned int format);
|
//NVTT_API bool setD3D9Format(unsigned int format);
|
||||||
@ -377,14 +388,6 @@ namespace nvtt
|
|||||||
typedef Compressor Context;
|
typedef Compressor Context;
|
||||||
|
|
||||||
|
|
||||||
/// DXT decoder.
|
|
||||||
enum Decoder
|
|
||||||
{
|
|
||||||
Decoder_D3D10,
|
|
||||||
Decoder_D3D9,
|
|
||||||
Decoder_NV5x,
|
|
||||||
};
|
|
||||||
|
|
||||||
/// A texture mipmap.
|
/// A texture mipmap.
|
||||||
struct TexImage
|
struct TexImage
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user