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 f4dc891ff2..93d0392e38 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 @@ -12,6 +12,7 @@ #include #include #include +#include namespace AZ { @@ -90,13 +91,13 @@ namespace AZ T GetSubImagePixelValue(uint32_t x, uint32_t y, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (float) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (uint) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); //! Retrieve a region of image pixel values (int) for specified mip and slice - void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex = 0, uint32_t mip = 0, uint32_t slice = 0); + void GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, 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 3d810c4c8f..099f9c3df9 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -244,7 +244,8 @@ namespace AZ AZStd::array values = { aznumeric_cast(0) }; auto position = AZStd::make_pair(x, y); - GetSubImagePixelValues(position, position, values, componentIndex, mip, slice); + AZStd::span valueSpan(values.begin(), values.size()); + GetSubImagePixelValues(position, position, valueSpan, componentIndex, mip, slice); return values[0]; } @@ -267,7 +268,7 @@ namespace AZ return GetSubImagePixelValueInternal(x, y, componentIndex, mip, slice); } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -293,7 +294,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex; @@ -319,7 +320,7 @@ namespace AZ } } - void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::array_view outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) + void StreamingImageAsset::GetSubImagePixelValues(AZStd::pair topLeft, AZStd::pair bottomRight, AZStd::span outValues, uint32_t componentIndex, uint32_t mip, uint32_t slice) { // TODO: Use the component index (void)componentIndex;