Files
UnrealEngineUWP/Engine/Source/Runtime/TextureUtilitiesCommon/Public/TextureImportUtils.h
charles bloom f260e6f946 ETextureImportPNGInfill option to control when transparent RGB is filled from neighbors
set to Always to get fill into transparent for non-binary transparency case
legacy config setting still respected, but new config supercedes
legacy behavior was to Infill only for binary transparency

#preflight https://horde.devtools.epicgames.com/job/6463e74dd62884a78fd7dad6
#rb jared.adkins,fabian.giesen
#rnx

[CL 25502194 by charles bloom in ue5-main branch]
2023-05-16 21:49:29 -04:00

29 lines
1.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreTypes.h"
#include "Engine/TextureDefines.h"
struct FImage;
namespace UE::TextureUtilitiesCommon
{
/**
* Detect the existence of gray scale image in some formats and convert those to a gray scale equivalent image
*
* @return true if the image was converted
*/
TEXTUREUTILITIESCOMMON_API bool AutoDetectAndChangeGrayScale(FImage& Image);
/**
* For PNG texture importing, this ensures that any pixels with an alpha value of zero have an RGB
* assigned to them from a neighboring pixel which has non-zero alpha.
* This is needed as PNG exporters tend to turn pixels that are RGBA = (x,x,x,0) to (1,1,1,0)
* and this produces artifacts when drawing the texture with bilinear filtering.
*
* @param TextureSource - The source texture
* @param SourceData - The source texture data
*/
TEXTUREUTILITIESCOMMON_API void FillZeroAlphaPNGData(int32 SizeX, int32 SizeY, ETextureSourceFormat SourceFormat, uint8* SourceData, bool bDoOnComplexAlphaNotJustBinaryTransparency);
}