Integrate YCoCg color space conversion by Jim Tilander.
This commit is contained in:
@ -34,6 +34,7 @@
|
||||
#include <nvimage/Filter.h>
|
||||
#include <nvimage/Quantize.h>
|
||||
#include <nvimage/NormalMap.h>
|
||||
#include <nvimage/ColorSpace.h>
|
||||
|
||||
#include "Compressor.h"
|
||||
#include "InputOptions.h"
|
||||
@ -482,6 +483,17 @@ bool Compressor::Private::initMipmap(Mipmap & mipmap, const InputOptions::Privat
|
||||
premultiplyAlphaMipmap(mipmap, inputOptions);
|
||||
}
|
||||
|
||||
// Apply gamma space color transforms:
|
||||
if (inputOptions.colorTransform == ColorTransform_YCoCg)
|
||||
{
|
||||
ColorSpace::RGBtoYCoCg_R(mipmap.asMutableFixedImage());
|
||||
}
|
||||
else if (inputOptions.colorTransform == ColorTransform_ScaledYCoCg)
|
||||
{
|
||||
// @@ TODO
|
||||
//ColorSpace::RGBtoYCoCg_R(mipmap.asMutableFixedImage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -156,8 +156,10 @@ namespace nvtt
|
||||
enum ColorTransform
|
||||
{
|
||||
ColorTransform_None,
|
||||
ColorTransform_Linear,
|
||||
ColorTransform_Swizzle
|
||||
ColorTransform_Linear, ///< Not implemented.
|
||||
ColorTransform_Swizzle, ///< Not implemented.
|
||||
ColorTransform_YCoCg, ///< Transform into r=Co, g=Cg, b=0, a=Y
|
||||
ColorTransform_ScaledYCoCg, ///< Not implemented.
|
||||
};
|
||||
|
||||
/// Extents rounding mode.
|
||||
|
Reference in New Issue
Block a user