From 16bad281aeeda76b8d097c486f0154767fe5f635 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 11 Jan 2022 10:40:59 -0600 Subject: [PATCH] Changed GetSubImagePixelValue parameter order so x,y are first Signed-off-by: Chris Galvan --- .../Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h | 2 +- .../RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 4 ++-- Gems/GradientSignal/Code/Source/ImageAsset.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h index 1db2a63b1c..bdb68601a9 100644 --- a/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h +++ b/Gems/Atom/RPI/Code/Include/Atom/RPI.Reflect/Image/StreamingImageAsset.h @@ -87,7 +87,7 @@ namespace AZ //! Get image pixel value for specified mip and slice template - T GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex = 0); + T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Returns streaming image pool asset id of the pool that will be used to create the streaming image. const Data::AssetId& GetPoolAssetId() const; diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index f1d9b1782b..37f0e04116 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -215,7 +215,7 @@ namespace AZ } template<> - float StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + float StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -235,7 +235,7 @@ namespace AZ } template<> - AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t mip, uint32_t slice, uint32_t x, uint32_t y, uint32_t componentIndex) + AZ::u32 StreamingImageAsset::GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; diff --git a/Gems/GradientSignal/Code/Source/ImageAsset.cpp b/Gems/GradientSignal/Code/Source/ImageAsset.cpp index afa233e5cb..e88a574768 100644 --- a/Gems/GradientSignal/Code/Source/ImageAsset.cpp +++ b/Gems/GradientSignal/Code/Source/ImageAsset.cpp @@ -198,7 +198,7 @@ namespace GradientSignal uint32_t x = static_cast(pixelLookup.GetX()) % width; uint32_t y = static_cast(pixelLookup.GetY()) % height; - return imageAsset->GetSubImagePixelValue(0, 0, x, y, 0); + return imageAsset->GetSubImagePixelValue(x, y); } }