UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Geometry::TMarchingPixelInfill< PixelType > Class Template Reference

#include <ImageInfilling.h>

Public Member Functions

void ComputeInfill (TImageBuilder< PixelType > &Image, const TArray< FVector2i > &MissingPixels, PixelType MissingValue, TFunctionRef< PixelType(PixelType SumOfNbrValues, int NbrCount)> NormalizeFunc)
 
template<typename OtherPixelType >
void ApplyInfill (TImageBuilder< OtherPixelType > &Image, TFunctionRef< OtherPixelType(OtherPixelType SumOfNbrValues, int NbrCount)> NormalizeFunc) const
 
void ApplyInfill (TImageBuilder< PixelType > &Image, TFunctionRef< PixelType(PixelType SumOfNbrValues, int NbrCount)> NormalizeFunc) const
 

Public Attributes

TArray< int32InfillSequence
 

Detailed Description

template<typename PixelType>
class UE::Geometry::TMarchingPixelInfill< PixelType >

TMarchingPixelInfill implements a very basic infilling strategy where the missing pixel with the most "known" neighbours is set to the average value of those neighbours, and this is iterated until all missing pixels are known. A Priority Queue is used to track the active front.

The infill sequence is tracked, which allows it to be "replayed" on multiple images. This is useful in cases where we have separate images with the same holes, which arises when baking textures from world sampling.

Member Function Documentation

◆ ApplyInfill() [1/2]

template<typename PixelType >
void UE::Geometry::TMarchingPixelInfill< PixelType >::ApplyInfill ( TImageBuilder< OtherPixelType > &  Image,
TFunctionRef< OtherPixelType(OtherPixelType SumOfNbrValues, int NbrCount)>  NormalizeFunc 
) const
inline

Fill the missing values in Image by replaying the infill sequence computed by ComputeInfill()

Parameters
NormalizeFuncImplements an "average" operation for the template OtherPixelType, normally (SumOfNbrValues / NbrCount)

◆ ApplyInfill() [2/2]

template<typename PixelType >
void UE::Geometry::TMarchingPixelInfill< PixelType >::ApplyInfill ( TImageBuilder< PixelType > &  Image,
TFunctionRef< PixelType(PixelType SumOfNbrValues, int NbrCount)>  NormalizeFunc 
) const
inline

Fill the missing values in Image by replaying the infill sequence computed by ComputeInfill()

Parameters
NormalizeFuncImplements an "average" operation for the template PixelType, normally (SumOfNbrValues / NbrCount)

◆ ComputeInfill()

template<typename PixelType >
void UE::Geometry::TMarchingPixelInfill< PixelType >::ComputeInfill ( TImageBuilder< PixelType > &  Image,
const TArray< FVector2i > &  MissingPixels,
PixelType  MissingValue,
TFunctionRef< PixelType(PixelType SumOfNbrValues, int NbrCount)>  NormalizeFunc 
)
inline

Fill the values of MissingPixels in Image by propagating from known values.

Parameters
MissingValuethis value is used to indicate 'missing' in the image. Input pixels do not have to be set to this value, they are set internally to avoid map lookups
NormalizeFuncImplements an "average" operation for the template PixelType, normally (SumOfNbrValues / Count)

Member Data Documentation

◆ InfillSequence

template<typename PixelType >
TArray<int32> UE::Geometry::TMarchingPixelInfill< PixelType >::InfillSequence

The documentation for this class was generated from the following file: