Updated the image gradient component to use a streaming image asset

Signed-off-by: Chris Galvan <chgalvan@amazon.com>
This commit is contained in:
Chris Galvan
2022-02-03 12:29:18 -06:00
parent 65e651388c
commit 6322dd5397
10 changed files with 150 additions and 43 deletions
@@ -49,20 +49,6 @@ namespace ImageProcessingAtom
static const unsigned int s_MinReduceLevel = 0;
static const unsigned int s_MaxReduceLevel = 5;
static const int s_TotalSupportedImageExtensions = 10;
static const char* s_SupportedImageExtensions[s_TotalSupportedImageExtensions] = {
"*.tif",
"*.tiff",
"*.png",
"*.bmp",
"*.jpg",
"*.jpeg",
"*.tga",
"*.gif",
"*.dds",
"*.exr"
};
enum class RGBWeight : AZ::u32
{
uniform, // uniform weights (1.0, 1.0, 1.0) (default)
@@ -27,6 +27,7 @@
#include <Atom/RPI.Reflect/Asset/AssetHandler.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAssetHandler.h>
#include <Atom/RPI.Reflect/Image/Image.h>
#include <Atom/RPI.Reflect/Image/ImageMipChainAsset.h>
namespace ImageProcessingAtom
@@ -66,9 +67,9 @@ namespace ImageProcessingAtom
AssetBuilderSDK::AssetBuilderDesc builderDescriptor;
builderDescriptor.m_name = "Atom Image Builder";
for (int i = 0; i < s_TotalSupportedImageExtensions; i++)
for (int i = 0; i < AZ::RPI::s_TotalSupportedImageExtensions; i++)
{
builderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(s_SupportedImageExtensions[i], AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
builderDescriptor.m_patterns.push_back(AssetBuilderSDK::AssetBuilderPattern(AZ::RPI::s_SupportedImageExtensions[i], AssetBuilderSDK::AssetBuilderPattern::PatternType::Wildcard));
}
builderDescriptor.m_busId = azrtti_typeid<ImageBuilderWorker>();
@@ -7,6 +7,7 @@
*/
#include <Atom/RPI.Reflect/Image/Image.h>
#include <Atom/RPI.Reflect/Image/StreamingImageAsset.h>
#include <AzCore/Component/ComponentApplicationBus.h>
@@ -223,9 +224,9 @@ namespace ImageProcessingAtom
{
AZStd::string targetExtension = entry->GetExtension();
for (int i = 0; i < s_TotalSupportedImageExtensions; i++)
for (int i = 0; i < AZ::RPI::s_TotalSupportedImageExtensions; i++)
{
if (AZStd::wildcard_match(s_SupportedImageExtensions[i], targetExtension.c_str()))
if (AZStd::wildcard_match(AZ::RPI::s_SupportedImageExtensions[i], targetExtension.c_str()))
{
return true;
}