UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FAllocator2D Class Reference

#include <Allocator2D.h>

Classes

struct  FRect
 
struct  FRun
 
struct  FSegment
 

Public Types

enum class  EMode { FreeSegments , UsedSegments }
 

Public Member Functions

MESHUTILITIESCOMMON_API FAllocator2D (EMode Mode, uint32 Width, uint32 Height, ELightmapUVVersion LayoutVersion)
 
MESHUTILITIESCOMMON_API void Clear ()
 
MESHUTILITIESCOMMON_API bool Find (FRect &Rect)
 
bool Test (FRect Rect)
 
MESHUTILITIESCOMMON_API void Alloc (FRect Rect)
 
MESHUTILITIESCOMMON_API bool FindBitByBit (FRect &Rect, const FAllocator2D &Other)
 
MESHUTILITIESCOMMON_API bool FindWithSegments (FRect &Rect, const FAllocator2D &Other, TFunctionRef< bool(const FAllocator2D::FRect &)> IsBestRect) const
 
bool Test (FRect Rect, const FAllocator2D &Other)
 
MESHUTILITIESCOMMON_API void Alloc (FRect Rect, const FAllocator2D &Other)
 
uint64 GetBit (uint32 x, uint32 y) const
 
void SetBit (uint32 x, uint32 y)
 
void ClearBit (uint32 x, uint32 y)
 
MESHUTILITIESCOMMON_API void CreateUsedSegments ()
 
MESHUTILITIESCOMMON_API void MergeRun (FRun &Run, const FRun &OtherRun, uint32 RectOffset, uint32 RectLength, uint32 PrimaryResolution, uint32 PerpendicularResolution)
 
MESHUTILITIESCOMMON_API void MergeSegments (const FRect &Rect, const FAllocator2D &Other)
 
MESHUTILITIESCOMMON_API void FlipX (const FRect &Rect)
 
MESHUTILITIESCOMMON_API void FlipY (const FRect &Rect)
 
MESHUTILITIESCOMMON_API uint32 GetUsedTexels () const
 
MESHUTILITIESCOMMON_API void CopyRuns (TArray< FRun > &Runs, const TArray< FRun > &OtherRuns, int32 MaxSize)
 
 FAllocator2D (const FAllocator2D &Other)=default
 
MESHUTILITIESCOMMON_API FAllocator2Doperator= (const FAllocator2D &Other)
 
MESHUTILITIESCOMMON_API FString ToString () const
 
MESHUTILITIESCOMMON_API FMD5Hash GetRasterMD5 () const
 
uint32 GetRasterWidth () const
 
uint32 GetRasterHeight () const
 
MESHUTILITIESCOMMON_API void ResetStats ()
 
MESHUTILITIESCOMMON_API void PublishStats (int32 ChartIndex, int32 Orientation, bool bFound, const FRect &Rect, const FRect &BestRect, const FMD5Hash &ChartMD5, TFunctionRef< bool(const FAllocator2D::FRect &)> IsBestRect)
 

Protected Member Functions

MESHUTILITIESCOMMON_API bool TestOneRun (const FRun &Run, const FRun &OtherRun, uint32 RectOffset, uint32 RectLength, uint32 PrimaryResolution, uint32 &OutFailedLength) const
 
MESHUTILITIESCOMMON_API bool TestAllRows (const FRect &Rect, const FAllocator2D &Other, uint32 &FailedLength) const
 
MESHUTILITIESCOMMON_API bool TestAllColumns (const FRect &Rect, const FAllocator2D &Other, uint32 &FailedLength) const
 
MESHUTILITIESCOMMON_API void InitRuns (TArray< FRun > &Runs, uint32 PrimaryResolution, uint32 PerpendicularRasterSize)
 
MESHUTILITIESCOMMON_API void InitSegments ()
 
MESHUTILITIESCOMMON_API void AddUsedSegment (FRun &Run, uint32 StartPos, uint32 Length)
 

Protected Attributes

const EMode Mode
 
const uint32 Width
 
const uint32 Height
 
const uint32 Pitch
 
const ELightmapUVVersion LayoutVersion
 
uint32 RasterWidth
 
uint32 RasterHeight
 
TArray< FRunRows
 
TArray< FRunColumns
 
TArray< uint64Bits
 
TArray< uint16SortedRowsIndex
 
TArray< uint16SortedColumnsIndex
 

Member Enumeration Documentation

◆ EMode

enum class FAllocator2D::EMode
strong
Enumerator
FreeSegments 
UsedSegments 

Constructor & Destructor Documentation

◆ FAllocator2D() [1/2]

FAllocator2D::FAllocator2D ( FAllocator2D::EMode  InMode,
uint32  Width,
uint32  Height,
ELightmapUVVersion  LayoutVersion 
)

◆ FAllocator2D() [2/2]

FAllocator2D::FAllocator2D ( const FAllocator2D Other)
default

Member Function Documentation

◆ AddUsedSegment()

void FAllocator2D::AddUsedSegment ( FRun Run,
uint32  StartPos,
uint32  Length 
)
protected

◆ Alloc() [1/2]

void FAllocator2D::Alloc ( FRect  Rect)

◆ Alloc() [2/2]

void FAllocator2D::Alloc ( FRect  Rect,
const FAllocator2D Other 
)

◆ Clear()

void FAllocator2D::Clear ( )

◆ ClearBit()

void FAllocator2D::ClearBit ( uint32  x,
uint32  y 
)
inline

◆ CopyRuns()

void FAllocator2D::CopyRuns ( TArray< FRun > &  Runs,
const TArray< FRun > &  OtherRuns,
int32  MaxSize 
)

◆ CreateUsedSegments()

void FAllocator2D::CreateUsedSegments ( )

◆ Find()

bool FAllocator2D::Find ( FRect Rect)

◆ FindBitByBit()

bool FAllocator2D::FindBitByBit ( FRect Rect,
const FAllocator2D Other 
)

◆ FindWithSegments()

bool FAllocator2D::FindWithSegments ( FRect Rect,
const FAllocator2D Other,
TFunctionRef< bool(const FAllocator2D::FRect &)>  IsBestRect 
) const

◆ FlipX()

void FAllocator2D::FlipX ( const FRect Rect)

◆ FlipY()

void FAllocator2D::FlipY ( const FRect Rect)

◆ GetBit()

uint64 FAllocator2D::GetBit ( uint32  x,
uint32  y 
) const
inline

◆ GetRasterHeight()

uint32 FAllocator2D::GetRasterHeight ( ) const
inline

◆ GetRasterMD5()

FMD5Hash FAllocator2D::GetRasterMD5 ( ) const

◆ GetRasterWidth()

uint32 FAllocator2D::GetRasterWidth ( ) const
inline

◆ GetUsedTexels()

uint32 FAllocator2D::GetUsedTexels ( ) const

◆ InitRuns()

void FAllocator2D::InitRuns ( TArray< FRun > &  Runs,
uint32  PrimaryResolution,
uint32  PerpendicularRasterSize 
)
protected

◆ InitSegments()

void FAllocator2D::InitSegments ( )
protected

◆ MergeRun()

void FAllocator2D::MergeRun ( FRun Run,
const FRun OtherRun,
uint32  RectOffset,
uint32  RectLength,
uint32  PrimaryResolution,
uint32  PerpendicularResolution 
)

◆ MergeSegments()

void FAllocator2D::MergeSegments ( const FRect Rect,
const FAllocator2D Other 
)

◆ operator=()

FAllocator2D & FAllocator2D::operator= ( const FAllocator2D Other)

◆ PublishStats()

void FAllocator2D::PublishStats ( int32  ChartIndex,
int32  Orientation,
bool  bFound,
const FRect Rect,
const FRect BestRect,
const FMD5Hash ChartMD5,
TFunctionRef< bool(const FAllocator2D::FRect &)>  IsBestRect 
)

◆ ResetStats()

void FAllocator2D::ResetStats ( )

◆ SetBit()

void FAllocator2D::SetBit ( uint32  x,
uint32  y 
)
inline

◆ Test() [1/2]

bool FAllocator2D::Test ( FRect  Rect)
inline

◆ Test() [2/2]

bool FAllocator2D::Test ( FRect  Rect,
const FAllocator2D Other 
)
inline

◆ TestAllColumns()

bool FAllocator2D::TestAllColumns ( const FRect Rect,
const FAllocator2D Other,
uint32 FailedLength 
) const
protected

◆ TestAllRows()

bool FAllocator2D::TestAllRows ( const FRect Rect,
const FAllocator2D Other,
uint32 FailedLength 
) const
protected

◆ TestOneRun()

bool FAllocator2D::TestOneRun ( const FRun Run,
const FRun OtherRun,
uint32  RectOffset,
uint32  RectLength,
uint32  PrimaryResolution,
uint32 OutFailedLength 
) const
protected

◆ ToString()

FString FAllocator2D::ToString ( ) const

Member Data Documentation

◆ Bits

TArray< uint64 > FAllocator2D::Bits
protected

◆ Columns

TArray< FRun > FAllocator2D::Columns
protected

◆ Height

const uint32 FAllocator2D::Height
protected

◆ LayoutVersion

const ELightmapUVVersion FAllocator2D::LayoutVersion
protected

◆ Mode

const EMode FAllocator2D::Mode
protected

◆ Pitch

const uint32 FAllocator2D::Pitch
protected

◆ RasterHeight

uint32 FAllocator2D::RasterHeight
protected

◆ RasterWidth

uint32 FAllocator2D::RasterWidth
protected

◆ Rows

TArray< FRun > FAllocator2D::Rows
protected

◆ SortedColumnsIndex

TArray< uint16 > FAllocator2D::SortedColumnsIndex
protected

◆ SortedRowsIndex

TArray< uint16 > FAllocator2D::SortedRowsIndex
protected

◆ Width

const uint32 FAllocator2D::Width
protected

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