diff --git a/krest/core/AutoLevelsTask.cpp b/krest/core/AutoLevelsTask.cpp index a58b02a..468d42d 100644 --- a/krest/core/AutoLevelsTask.cpp +++ b/krest/core/AutoLevelsTask.cpp @@ -247,7 +247,7 @@ void AutoLevelsTask::execute() auto const channelOffset = (pt.type == PixelType::SIGNED ? 0.5 : 0.0); auto const channelScale = imageChannelScale(pt) / static_cast(channels); - auto chanelWeights = std::vector(channels, channelScale); + auto channelWeights = std::vector(channels, channelScale); // Examine image while (stride--) @@ -262,7 +262,7 @@ void AutoLevelsTask::execute() } // Get pixel value - auto const v = (*pf)(image, i << stride, j << stride, chanelWeights); + auto const v = (*pf)(image, i << stride, j << stride, channelWeights); auto const vn = std::min(std::max(0.0, v + channelOffset), 1.0); // Get bucket index and increment bucket count diff --git a/krest/core/ImageUtils.cpp b/krest/core/ImageUtils.cpp index 984cb20..dc1dc19 100644 --- a/krest/core/ImageUtils.cpp +++ b/krest/core/ImageUtils.cpp @@ -233,9 +233,9 @@ void KREST_CORE_EXPORT imageToTexture( auto const yk = image.height(); auto const ck = image.depth(); - auto const xs = image.w_step(); - auto const ys = image.h_step(); - auto cs = image.d_step(); + auto const xs = image.w_step() * ss; + auto const ys = image.h_step() * ss; + auto cs = image.d_step() * ss; auto* first = reinterpret_cast(image.first_pixel()); auto const isPlanePacked = (std::abs(cs) > std::abs(ys));