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

#include <ImageBuilder.h>

Public Member Functions

void SetDimensions (FImageDimensions DimensionsIn)
 
const FImageDimensionsGetDimensions () const
 
void Clear (const PixelType &ClearValue)
 
bool ContainsPixel (int32 X, int32 Y) const
 
bool ContainsPixel (const FVector2i &ImageCoords) const
 
PixelType & GetPixel (int32 X, int32 Y)
 
PixelType & GetPixel (const FVector2i &ImageCoords)
 
PixelType & GetPixel (int64 LinearIndex)
 
const PixelType & GetPixel (int32 X, int32 Y) const
 
const PixelType & GetPixel (const FVector2i &ImageCoords) const
 
const PixelType & GetPixel (int64 LinearIndex) const
 
TArrayView64< PixelType > GetImageBuffer ()
 
TConstArrayView64< PixelType > GetImageBuffer () const
 
void SetPixel (int32 X, int32 Y, const PixelType &NewValue)
 
void SetPixel (const FVector2i &ImageCoords, const PixelType &NewValue)
 
void SetPixel (int64 LinearIndex, const PixelType &NewValue)
 
void CopyPixel (int64 FromLinearIndex, int64 ToLinearIndex)
 
template<typename OtherType >
void Convert (TFunctionRef< OtherType(const PixelType &)> ConvertFunc, TImageBuilder< OtherType > &ConvertedImageOut) const
 
template<typename ScalarType , EImageTilingMethod TilingMethod = EImageTilingMethod::Clamp>
PixelType BilinearSample (const FVector2d &PixelCoords, const PixelType &InvalidValue) const
 
template<typename ScalarType , EImageTilingMethod TilingMethod = EImageTilingMethod::Clamp>
PixelType BilinearSampleUV (const FVector2d &UVCoords, const PixelType &InvalidValue) const
 
template<EImageTilingMethod TilingMethod = EImageTilingMethod::Clamp>
PixelType NearestSampleUV (const FVector2d &UVCoords) const
 
bool IsConstantValue () const
 
TImageBuilder< PixelType > FastDownsample (int32 SubSteps, const PixelType &ZeroValue, TFunctionRef< PixelType(PixelType, int)> AverageFunc) const
 

Static Protected Member Functions

template<EImageTilingMethod TilingMethod>
static FVector2d GetTiledUV (const FVector2d &UVCoords)
 

Protected Attributes

FImageDimensions Dimensions
 
TDenseGrid2< PixelType > Image
 

Detailed Description

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

TImageBuilder is used to create and populate a 2D image with a templated "pixel" type.

Member Function Documentation

◆ BilinearSample()

template<typename PixelType >
template<typename ScalarType , EImageTilingMethod TilingMethod = EImageTilingMethod::Clamp>
PixelType UE::Geometry::TImageBuilder< PixelType >::BilinearSample ( const FVector2d PixelCoords,
const PixelType &  InvalidValue 
) const
inline

Sample the image value at floating-point pixel coords with Bilinear interpolation The pixel coords are expected to be in the [0,Width]x[0,Height] image pixel rectangle.

◆ BilinearSampleUV()

template<typename PixelType >
template<typename ScalarType , EImageTilingMethod TilingMethod = EImageTilingMethod::Clamp>
PixelType UE::Geometry::TImageBuilder< PixelType >::BilinearSampleUV ( const FVector2d UVCoords,
const PixelType &  InvalidValue 
) const
inline

Sample the image value at floating-point UV coords with Bilinear interpolation.

◆ Clear()

template<typename PixelType >
void UE::Geometry::TImageBuilder< PixelType >::Clear ( const PixelType &  ClearValue)
inline

Clear all Pixels in the current Mip to the clear/default color for the texture build type

◆ ContainsPixel() [1/2]

template<typename PixelType >
bool UE::Geometry::TImageBuilder< PixelType >::ContainsPixel ( const FVector2i ImageCoords) const
inline
Returns
true if the given X/Y coordinates are inside the image pixel bounds, ie can be used to index a pixel

◆ ContainsPixel() [2/2]

template<typename PixelType >
bool UE::Geometry::TImageBuilder< PixelType >::ContainsPixel ( int32  X,
int32  Y 
) const
inline
Returns
true if the given X/Y coordinates are inside the image pixel bounds, ie can be used to index a pixel

◆ Convert()

template<typename PixelType >
template<typename OtherType >
void UE::Geometry::TImageBuilder< PixelType >::Convert ( TFunctionRef< OtherType(const PixelType &)>  ConvertFunc,
TImageBuilder< OtherType > &  ConvertedImageOut 
) const
inline

Convert to a different data type of same Dimensions using ConvertFunc

◆ CopyPixel()

template<typename PixelType >
void UE::Geometry::TImageBuilder< PixelType >::CopyPixel ( int64  FromLinearIndex,
int64  ToLinearIndex 
)
inline

Copy Pixel value from one linear index to another

◆ FastDownsample()

template<typename PixelType >
TImageBuilder< PixelType > UE::Geometry::TImageBuilder< PixelType >::FastDownsample ( int32  SubSteps,
const PixelType &  ZeroValue,
TFunctionRef< PixelType(PixelType, int)>  AverageFunc 
) const
inline

Very basic downsampling technqiue that just averages NxN pixel blocks. Multi-threaded.

Parameters
SubStepseach NxN pixel block of this size is averaged into 1 pixel in the output image
Zerovalue to use with template PixelType must be provided, pixel values will be added to this value
AverageFuncCalled with Sum(Pixels) and PixelCount, return value is used as new pixel value (eg should be average)

◆ GetDimensions()

template<typename PixelType >
const FImageDimensions & UE::Geometry::TImageBuilder< PixelType >::GetDimensions ( ) const
inline

◆ GetImageBuffer() [1/2]

template<typename PixelType >
TArrayView64< PixelType > UE::Geometry::TImageBuilder< PixelType >::GetImageBuffer ( )
inline

◆ GetImageBuffer() [2/2]

template<typename PixelType >
TConstArrayView64< PixelType > UE::Geometry::TImageBuilder< PixelType >::GetImageBuffer ( ) const
inline

◆ GetPixel() [1/6]

template<typename PixelType >
PixelType & UE::Geometry::TImageBuilder< PixelType >::GetPixel ( const FVector2i ImageCoords)
inline

Get the Pixel at the given X/Y coordinates

◆ GetPixel() [2/6]

template<typename PixelType >
const PixelType & UE::Geometry::TImageBuilder< PixelType >::GetPixel ( const FVector2i ImageCoords) const
inline

Get the Pixel at the given X/Y coordinates

◆ GetPixel() [3/6]

template<typename PixelType >
PixelType & UE::Geometry::TImageBuilder< PixelType >::GetPixel ( int32  X,
int32  Y 
)
inline

Get the Pixel at the given X/Y coordinates

◆ GetPixel() [4/6]

template<typename PixelType >
const PixelType & UE::Geometry::TImageBuilder< PixelType >::GetPixel ( int32  X,
int32  Y 
) const
inline

Get the Pixel at the given X/Y coordinates

◆ GetPixel() [5/6]

template<typename PixelType >
PixelType & UE::Geometry::TImageBuilder< PixelType >::GetPixel ( int64  LinearIndex)
inline

Get the Pixel at the given linear index

◆ GetPixel() [6/6]

template<typename PixelType >
const PixelType & UE::Geometry::TImageBuilder< PixelType >::GetPixel ( int64  LinearIndex) const
inline

Get the Pixel at the given linear index

◆ GetTiledUV()

template<typename PixelType >
template<EImageTilingMethod TilingMethod>
static FVector2d UE::Geometry::TImageBuilder< PixelType >::GetTiledUV ( const FVector2d UVCoords)
inlinestaticprotected

◆ IsConstantValue()

template<typename PixelType >
bool UE::Geometry::TImageBuilder< PixelType >::IsConstantValue ( ) const
inline
Returns
true if all pixels have the same value

◆ NearestSampleUV()

template<typename PixelType >
template<EImageTilingMethod TilingMethod = EImageTilingMethod::Clamp>
PixelType UE::Geometry::TImageBuilder< PixelType >::NearestSampleUV ( const FVector2d UVCoords) const
inline

Sample the image value at floating-point UV coords with Nearest sampling.

◆ SetDimensions()

template<typename PixelType >
void UE::Geometry::TImageBuilder< PixelType >::SetDimensions ( FImageDimensions  DimensionsIn)
inline

◆ SetPixel() [1/3]

template<typename PixelType >
void UE::Geometry::TImageBuilder< PixelType >::SetPixel ( const FVector2i ImageCoords,
const PixelType &  NewValue 
)
inline

Set the Pixel at the given X/Y coordinates to the given PixelType

◆ SetPixel() [2/3]

template<typename PixelType >
void UE::Geometry::TImageBuilder< PixelType >::SetPixel ( int32  X,
int32  Y,
const PixelType &  NewValue 
)
inline

Set the Pixel at the given X/Y coordinates to the given PixelType

◆ SetPixel() [3/3]

template<typename PixelType >
void UE::Geometry::TImageBuilder< PixelType >::SetPixel ( int64  LinearIndex,
const PixelType &  NewValue 
)
inline

Set the Pixel at the given linear index to the given PixelType

Member Data Documentation

◆ Dimensions

template<typename PixelType >
FImageDimensions UE::Geometry::TImageBuilder< PixelType >::Dimensions
protected

◆ Image

template<typename PixelType >
TDenseGrid2<PixelType> UE::Geometry::TImageBuilder< PixelType >::Image
protected

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