Gems/Atom

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-16 15:56:10 -07:00
parent 8cef306efb
commit e6b5342c07
9 changed files with 39 additions and 37 deletions
@@ -191,7 +191,7 @@ namespace ImageProcessingAtom
}
//for each pixel in dst image, find it's location in src and copy the data from there
float halfSize = rectSize / 2;
float halfSize = static_cast<float>(rectSize / 2);
for (AZ::u32 row = 0; row < rectSize; row++)
{
for (AZ::u32 col = 0; col < rectSize; col++)
@@ -201,8 +201,8 @@ namespace ImageProcessingAtom
float dstY = halfSize - row - 0.5f;
float srcX = dstX * mtx[0] + dstY * mtx[1];
float srcY = dstX * mtx[2] + dstY * mtx[3];
AZ::u32 srcCol = srcX + halfSize;
AZ::u32 srcRow = halfSize - srcY;
AZ::u32 srcCol = static_cast<AZ::u32>(srcX + halfSize);
AZ::u32 srcRow = static_cast<AZ::u32>(halfSize - srcY);
memcpy(&dstImageBuf[(row * rectSize + col) * bytePerPixel],
&srcImageBuf[(srcRow * rectSize + srcCol) * bytePerPixel], bytePerPixel);
@@ -464,7 +464,7 @@ namespace ImageProcessingAtom
else
{
//transform the image
TransformImage(srcDir, dstDir, buf, tempBuf, sizePerPixel, faceSize);
TransformImage(srcDir, dstDir, buf, tempBuf, static_cast<AZ::u8>(sizePerPixel), faceSize);
dstCubemap->SetFaceData(face, tempBuf, outSize);
}
}
@@ -649,7 +649,7 @@ namespace ImageProcessingAtom
preset.m_cubemapSetting->m_mipSlope, //MipAnglePerLevelScale,
(int)preset.m_cubemapSetting->m_filter, //FilterType, CP_FILTER_TYPE_COSINE for diffuse cube
preset.m_cubemapSetting->m_edgeFixup > 0 ? CP_FIXUP_PULL_LINEAR : CP_FIXUP_NONE, //FixupType, CP_FIXUP_PULL_LINEAR if FixupWidth> 0
preset.m_cubemapSetting->m_edgeFixup, //FixupWidth,
static_cast<int32>(preset.m_cubemapSetting->m_edgeFixup), //FixupWidth,
true, //bUseSolidAngle,
16, //GlossScale,
0, //GlossBias
@@ -269,11 +269,11 @@ namespace UnitTest
public:
//helper function to save an image object to a file through QtImage
static void SaveImageToFile(const IImageObjectPtr imageObject, const AZStd::string imageName, AZ::u32 maxMipCnt = 100)
static void SaveImageToFile([[maybe_unused]] const IImageObjectPtr imageObject, [[maybe_unused]] const AZStd::string imageName, [[maybe_unused]] AZ::u32 maxMipCnt = 100)
{
#ifndef DEBUG_OUTPUT_IMAGES
return;
#endif
#else
if (imageObject == nullptr)
{
return;
@@ -314,6 +314,7 @@ namespace UnitTest
QImage qimage(imageBuf, width, height, pitch, QImage::Format_RGBA8888);
qimage.save(filePath);
}
#endif
}
static bool GetComparisonResult(IImageObjectPtr image1, IImageObjectPtr image2, QString& output)