Merge branch 'main' into TexturePresets-ATOM-14765

This commit is contained in:
Chris Santora
2021-04-19 20:35:50 -07:00
2921 changed files with 52208 additions and 546658 deletions
@@ -105,7 +105,7 @@ namespace ImageProcessingAtom
{
}
explicit ColorRGBA16(uint64 a_u)
explicit ColorRGBA16(AZ::u64 a_u)
: u(a_u)
{
}
@@ -152,7 +152,7 @@ namespace ImageProcessingAtom
uint16 b;
uint16 a;
};
uint64 u;
AZ::u64 u;
};
};
@@ -224,7 +224,7 @@ namespace ImageProcessingAtom
srcImage->GetImagePointer(mip, srcMem, srcPitch);
const pvrtexture::CPVRTextureHeader srcHeader(
srcPixelType.PixelTypeID, // uint64 u64PixelFormat,
srcPixelType.PixelTypeID, // AZ::u64 u64PixelFormat,
width, // uint32 u32Height=1,
height, // uint32 u32Width=1,
1, // uint32 u32Depth=1,
@@ -315,7 +315,7 @@ namespace ImageProcessingAtom
// Preparing source compressed data
const pvrtexture::CPVRTextureHeader compressedHeader(
FindPvrPixelFormat(fmtSrc), // uint64 u64PixelFormat,
FindPvrPixelFormat(fmtSrc), // AZ::u64 u64PixelFormat,
width, // uint32 u32Height=1,
height, // uint32 u32Width=1,
1, // uint32 u32Depth=1,
@@ -148,7 +148,6 @@ namespace ImageProcessingAtom
size_t nSlicePitch = (pitch / ePS_Blue);
AZ::u32 src = 0;
AZ::u32 dst = 0;
for (int b = 0; b < ePS_Blue; ++b)
{
for (int g = 0; g < ePS_Green; ++g)
@@ -311,4 +310,4 @@ namespace ImageProcessingAtom
//save color chart data to an image and save as current
m_img = colorChart.GenerateChartImage();
}
}
}
@@ -14,7 +14,7 @@
namespace ImageProcessingAtom
{
// note: lumberyard is right hand Z up coordinate
// note: O3DE is right hand Z up coordinate
// please don't change the order of the enum since we are using it to match the face id defined in AMD's CubemapGen
// and they are using left hand Y up coordinate
enum CubemapFace
@@ -25,9 +25,5 @@ typedef AZ::s32 int32;
typedef AZ::s32 sint32;
typedef AZ::u32 uint32;
typedef AZ::s64 int64;
typedef AZ::s64 sint64;
typedef AZ::u64 uint64;
typedef float f32;
typedef double f64;
@@ -638,7 +638,6 @@ namespace ImageProcessingAtom
DDS_FILE_DESC desc;
DDS_HEADER_DXT10 exthead;
AZ::IO::SizeType startPos = fileLoadStream.GetCurPos();
fileLoadStream.Read(sizeof(desc), &desc);
if (desc.dwMagic != FOURCC_DDS || !desc.IsValid())
@@ -119,8 +119,6 @@ namespace ImageProcessingAtom
ImfMath::Box2i dw = header.dataWindow();
width = dw.max.x - dw.min.x + 1;
height = dw.max.y - dw.min.y + 1;
int dx = dw.min.x;
int dy = dw.min.y;
// Create IImageObject
IImageObject* newImage = IImageObject::CreateImage(width, height, 1, format);
@@ -49,7 +49,7 @@ namespace ImageProcessingAtom
bool IsExtensionSupported(const char* extension);
IImageObject* LoadImageFromFile(const AZStd::string& filename);
// These functions are for loading legacy lumberyard dds files
// These functions are for loading legacy O3DE dds files
IImageObject* LoadImageFromFileLegacy(const AZStd::string& filename);
IImageObject* LoadImageFromFileStreamLegacy(AZ::IO::SystemFileStream& fileLoadStream);
IImageObject* LoadAttachedImageFromDdsFileLegacy(const AZStd::string& filename, IImageObjectPtr originImage);
@@ -36,7 +36,6 @@ namespace ImageProcessingAtom
}
//convert to format which compatiable our pixel format
QImage::Format format = qimage.format();
if (qimage.format() != QImage::Format_RGBA8888)
{
qimage = qimage.convertToFormat(QImage::Format_RGBA8888);
@@ -20,7 +20,7 @@
#include <QString>
#include <libtiff/tiffio.h> // TIFF library
#include <tiffio.h> // TIFF library
namespace ImageProcessingAtom
{
@@ -193,7 +193,7 @@ namespace ImageProcessingAtom
AZ::Uuid sourceId = source->GetSourceUuid();
QAction* editImportSettingsAction = menu->addAction("Edit Texture Settings...", [sourceId, this]()
menu->addAction("Edit Texture Settings...", [sourceId, this]()
{
OpenSourceTextureFile(sourceId);
});
@@ -205,7 +205,7 @@ namespace ImageProcessingAtom
if (product->GetAssetType() == azrtti_typeid<AZ::RPI::StreamingImageAsset>())
{
AZ::Data::AssetId assetId = product->GetAssetId();
QAction* editImportSettingsAction = menu->addAction("Save as DDS...", [assetId, this]()
menu->addAction("Save as DDS...", [assetId, this]()
{
QString filePath = QFileDialog::getSaveFileName(nullptr, QString("Save to file"), m_lastSavedPath, QString("DDS file (*.dds)"));
if (filePath.isEmpty())
@@ -144,7 +144,7 @@ namespace ImageProcessingAtom
AZ::u32 reserved;
};
// Dds header for lumberyard dds format.
// Dds header for O3DE dds format.
// It has same size as standard dds header but uses several reserved slots for customized information
struct DDS_HEADER_LEGACY
{
@@ -118,7 +118,6 @@ namespace ImageProcessingAtom
// Build mip chain assets.
// Start from smallest mips so the mip chain asset for the lowest resolutions may contain more high level mips
bool ready = false;
uint32_t lastMip = imageDesc.m_mipLevels;
uint32_t totalSize = 0;
AZStd::vector<Data::Asset<RPI::ImageMipChainAsset>> mipChains;
@@ -1090,7 +1090,6 @@ namespace ImageProcessingAtom
uint32 pitch1, pitch2;
float sumDeltaSqLinear = 0;
AZ::u32 sumPixelCount = 0;
//only process the highest mip
image1->GetImagePointer(0, mem1, pitch1);
@@ -504,8 +504,6 @@ namespace ImageProcessingAtom
const PixelFormatInfo* const pPixelFormatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(format);
DXGI_FORMAT d3dformat = pPixelFormatInfo->d3d10Format;
memset(&header, 0, sizeof(DDS_HEADER_LEGACY));
header.dwSize = sizeof(DDS_HEADER_LEGACY);
@@ -702,7 +700,6 @@ namespace ImageProcessingAtom
{
const MipLevel& level = *m_mips[mip];
AZ::u32 faceBufSize = level.m_pitch * level.m_rowCount / faces;
AZ::u32 start = faceBufSize * face;
saveFileStream.Write(faceBufSize, level.m_pData + faceBufSize * face);
}
}
@@ -342,9 +342,6 @@ namespace ImageProcessingAtom
AZ::Data::Asset<AZ::RPI::StreamingImageAsset> LoadImageAsset(const AZ::Data::AssetId& imageAssetId)
{
RPI::StreamingImageAssetHandler* imageAssetHandler = static_cast<RPI::StreamingImageAssetHandler*>(
Data::AssetManager::Instance().GetHandler(RPI::StreamingImageAsset::RTTI_Type()));
// Blocking loading streaming image asset with its mipchain assets
AZ::Data::Asset<AZ::RPI::StreamingImageAsset> imageAsset = AZ::Data::AssetManager::Instance().GetAsset<AZ::RPI::StreamingImageAsset>(imageAssetId, AZ::Data::AssetLoadBehavior::PreLoad);