From 5324156cc4b9e7c2edf11cf4e1f675da20ba0357 Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 19 Jan 2011 07:12:22 +0000 Subject: [PATCH] Fix kernel offset. Fixes issue 158. --- src/nvimage/FloatImage.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvimage/FloatImage.cpp b/src/nvimage/FloatImage.cpp index bec9ce8..21fe43b 100644 --- a/src/nvimage/FloatImage.cpp +++ b/src/nvimage/FloatImage.cpp @@ -761,7 +761,7 @@ float FloatImage::applyKernel(const Kernel2 * k, int x, int y, uint c, WrapMode nvDebugCheck(k != NULL); const uint kernelWindow = k->windowSize(); - const int kernelOffset = int(kernelWindow / 2) - 1; + const int kernelOffset = int(kernelWindow / 2); const float * channel = this->channel(c); @@ -790,7 +790,7 @@ float FloatImage::applyKernelVertical(const Kernel1 * k, int x, int y, uint c, W nvDebugCheck(k != NULL); const uint kernelWindow = k->windowSize(); - const int kernelOffset = int(kernelWindow / 2) - 1; + const int kernelOffset = int(kernelWindow / 2); const float * channel = this->channel(c); @@ -812,7 +812,7 @@ float FloatImage::applyKernelHorizontal(const Kernel1 * k, int x, int y, uint c, nvDebugCheck(k != NULL); const uint kernelWindow = k->windowSize(); - const int kernelOffset = int(kernelWindow / 2) - 1; + const int kernelOffset = int(kernelWindow / 2); const float * channel = this->channel(c);