|
|
|
|
@ -257,39 +257,6 @@ namespace GradientSignal
|
|
|
|
|
return AZ::Uuid::CreateString("{7520DF20-16CA-4CF6-A6DB-D96759A09EE4}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static AZStd::unique_ptr<ImageAsset> LegacyLoadImageFromPath(const AZStd::string& fullPath)
|
|
|
|
|
{
|
|
|
|
|
ImageProcessing::IImageObjectPtr imageObject;
|
|
|
|
|
ImageProcessing::ImageProcessingRequestBus::BroadcastResult(imageObject, &ImageProcessing::ImageProcessingRequests::LoadImage,
|
|
|
|
|
fullPath);
|
|
|
|
|
|
|
|
|
|
if (!imageObject)
|
|
|
|
|
{
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//create a new image asset
|
|
|
|
|
auto imageAsset = AZStd::make_unique<ImageAsset>();
|
|
|
|
|
|
|
|
|
|
if (!imageAsset)
|
|
|
|
|
{
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
imageAsset->m_imageWidth = imageObject->GetWidth(0);
|
|
|
|
|
imageAsset->m_imageHeight = imageObject->GetHeight(0);
|
|
|
|
|
imageAsset->m_imageFormat = imageObject->GetPixelFormat();
|
|
|
|
|
|
|
|
|
|
AZ::u8* mem = nullptr;
|
|
|
|
|
AZ::u32 pitch = 0;
|
|
|
|
|
AZ::u32 mipBufferSize = imageObject->GetMipBufSize(0);
|
|
|
|
|
imageObject->GetImagePointer(0, mem, pitch);
|
|
|
|
|
|
|
|
|
|
imageAsset->m_imageData = { mem, mem + mipBufferSize };
|
|
|
|
|
|
|
|
|
|
return imageAsset;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static ImageProcessing::EPixelFormat AtomPixelFormatToLegacyPixelFormat(ImageProcessingAtom::EPixelFormat atomPixFormat)
|
|
|
|
|
{
|
|
|
|
|
// This could be dangerous to do if these enums have differences in the middle.
|
|
|
|
|
|