From 65aa7e1eaa1ee88d480e9f12c2c8749e1ed7e66b Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 5 Mar 2008 22:35:16 +0000 Subject: [PATCH] Add interface for swizzle color xform. --- src/nvtt/InputOptions.cpp | 13 +++++++++++++ src/nvtt/nvtt.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/src/nvtt/InputOptions.cpp b/src/nvtt/InputOptions.cpp index cb52e42..61ec767 100644 --- a/src/nvtt/InputOptions.cpp +++ b/src/nvtt/InputOptions.cpp @@ -305,6 +305,19 @@ void InputOptions::setLinearTransform(int channel, float w0, float w1, float w2, //m.linearTransform.setRow(channel, w); } +void InputOptions::setSwizzleTransform(int x, int y, int z, int w) +{ + nvCheck(x >= 0 && x < 3); + nvCheck(y >= 0 && y < 3); + nvCheck(z >= 0 && z < 3); + nvCheck(w >= 0 && w < 3); + + // m.xswizzle = x; + // m.yswizzle = y; + // m.zswizzle = z; + // m.wswizzle = w; +} + void InputOptions::setMaxExtents(int e) { nvDebugCheck(e > 0); diff --git a/src/nvtt/nvtt.h b/src/nvtt/nvtt.h index fd3a344..44dbdd9 100644 --- a/src/nvtt/nvtt.h +++ b/src/nvtt/nvtt.h @@ -157,6 +157,7 @@ namespace nvtt { ColorTransform_None, ColorTransform_Linear, + ColorTransform_Swizzle }; /// Extents rounding mode. @@ -221,6 +222,7 @@ namespace nvtt // Set color transforms. @@ Not implemented! NVTT_API void setColorTransform(ColorTransform t); NVTT_API void setLinearTransform(int channel, float w0, float w1, float w2, float w3); + NVTT_API void setSwizzleTransform(int x, int y, int z, int w); // Set resizing options. NVTT_API void setMaxExtents(int d);