UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FSlateTextureAtlas Class Referenceabstract

#include <TextureAtlas.h>

+ Inheritance diagram for FSlateTextureAtlas:

Classes

struct  FCopyRowData
 

Public Member Functions

SLATECORE_API FSlateTextureAtlas (uint32 InWidth, uint32 InHeight, uint32 InBytesPerPixel, ESlateTextureAtlasPaddingStyle InPaddingStyle, bool bInUpdatesAfterInitialization)
 
virtual SLATECORE_API ~FSlateTextureAtlas ()
 
SLATECORE_API void EmptyAtlasData ()
 
SLATECORE_API const FAtlasedTextureSlotAddTexture (uint32 TextureWidth, uint32 TextureHeight, const TArray< uint8 > &Data)
 
uint32 GetWidth () const
 
uint32 GetHeight () const
 
SLATECORE_API void MarkTextureDirty ()
 
virtual void ConditionalUpdateTexture ()=0
 
virtual void ReleaseResources ()=0
 
virtual FSlateShaderResourceGetAtlasTexture () const =0
 

Protected Member Functions

SLATECORE_API const FAtlasedTextureSlotFindSlotForTexture (uint32 InWidth, uint32 InHeight)
 
void AddFreeSlot (uint32 InX, uint32 InY, uint32 InWidth, uint32 InHeight)
 
SLATECORE_API void InitAtlasData ()
 
SLATECORE_API void CopyRow (const FCopyRowData &CopyRowData)
 
SLATECORE_API void ZeroRow (const FCopyRowData &CopyRowData)
 
SLATECORE_API void CopyDataIntoSlot (const FAtlasedTextureSlot *SlotToCopyTo, const TArray< uint8 > &Data)
 

Static Protected Member Functions

static int32 GetFreeSlotSearchIndex (uint32 InWidth, uint32 InHeight)
 

Protected Attributes

TArray< uint8AtlasData
 
FAtlasedTextureSlotAtlasUsedSlots
 
TArray< FAtlasedTextureSlot * > AtlasEmptySlotsMap
 
uint32 AtlasWidth
 
uint32 AtlasHeight
 
uint32 BytesPerPixel
 
ESlateTextureAtlasPaddingStyle PaddingStyle
 
bool bNeedsUpdate
 
bool bUpdatesAfterInitialization
 
ESlateTextureAtlasThreadId AtlasOwnerThread
 

Detailed Description

Base class texture atlases in Slate

Constructor & Destructor Documentation

◆ FSlateTextureAtlas()

FSlateTextureAtlas::FSlateTextureAtlas ( uint32  InWidth,
uint32  InHeight,
uint32  InBytesPerPixel,
ESlateTextureAtlasPaddingStyle  InPaddingStyle,
bool  bInUpdatesAfterInitialization 
)

◆ ~FSlateTextureAtlas()

FSlateTextureAtlas::~FSlateTextureAtlas ( )
virtual

Member Function Documentation

◆ AddFreeSlot()

void FSlateTextureAtlas::AddFreeSlot ( uint32  InX,
uint32  InY,
uint32  InWidth,
uint32  InHeight 
)
protected

Adds a new slot to the free slot list.

◆ AddTexture()

const FAtlasedTextureSlot * FSlateTextureAtlas::AddTexture ( uint32  TextureWidth,
uint32  TextureHeight,
const TArray< uint8 > &  Data 
)

Adds a texture to the atlas

Parameters
TextureWidthWidth of the texture
TextureHeightHeight of the texture
DataRaw texture data

◆ ConditionalUpdateTexture()

virtual void FSlateTextureAtlas::ConditionalUpdateTexture ( )
pure virtual

Updates the texture used for rendering if needed

Implemented in FSlateTextureAtlasRHI, FSlateFontAtlasNull, and FSlateFontAtlasRHI.

◆ CopyDataIntoSlot()

void FSlateTextureAtlas::CopyDataIntoSlot ( const FAtlasedTextureSlot SlotToCopyTo,
const TArray< uint8 > &  Data 
)
protected

Copies texture data into the atlas at a given slot

Parameters
SlotToCopyToThe occupied slot in the atlas where texture data should be copied to
DataThe data to copy into the atlas

◆ CopyRow()

void FSlateTextureAtlas::CopyRow ( const FCopyRowData CopyRowData)
protected

Copies a single row from a source texture to a dest texture, respecting the padding.

Parameters
CopyRowDataInformation for how to copy a row

◆ EmptyAtlasData()

void FSlateTextureAtlas::EmptyAtlasData ( )

Clears atlas cpu data. It does not clear rendering data

◆ FindSlotForTexture()

const FAtlasedTextureSlot * FSlateTextureAtlas::FindSlotForTexture ( uint32  InWidth,
uint32  InHeight 
)
protected

Finds the optimal slot for a texture in the atlas

Parameters
WidthThe width of the texture we are adding
HeightThe height of the texture we are adding

◆ GetAtlasTexture()

virtual FSlateShaderResource * FSlateTextureAtlas::GetAtlasTexture ( ) const
pure virtual

Implemented in FSlateFontAtlas, and FSlateTextureAtlasRHI.

◆ GetFreeSlotSearchIndex()

int32 FSlateTextureAtlas::GetFreeSlotSearchIndex ( uint32  InWidth,
uint32  InHeight 
)
staticprotected

Get the index to start looking for a free slot.

◆ GetHeight()

uint32 FSlateTextureAtlas::GetHeight ( ) const
inline
Returns
the height of the atlas

◆ GetWidth()

uint32 FSlateTextureAtlas::GetWidth ( ) const
inline
Returns
the width of the atlas

◆ InitAtlasData()

void FSlateTextureAtlas::InitAtlasData ( )
protected

Creates enough space for a single texture the width and height of the atlas

◆ MarkTextureDirty()

void FSlateTextureAtlas::MarkTextureDirty ( )

Marks the texture as dirty and needing its rendering resources updated

◆ ReleaseResources()

virtual void FSlateTextureAtlas::ReleaseResources ( )
pure virtual

Releases rendering resources of this texture

Implemented in FSlateFontAtlasNull, FSlateFontAtlasRHI, and FSlateTextureAtlasRHI.

◆ ZeroRow()

void FSlateTextureAtlas::ZeroRow ( const FCopyRowData CopyRowData)
protected

Zeros out a row in the dest texture (used with PaddingStyle == PadWithZero). respecting the padding.

Parameters
CopyRowDataInformation for how to copy a row

Member Data Documentation

◆ AtlasData

TArray<uint8> FSlateTextureAtlas::AtlasData
protected

Actual texture data contained in the atlas

◆ AtlasEmptySlotsMap

TArray<FAtlasedTextureSlot*> FSlateTextureAtlas::AtlasEmptySlotsMap
protected

The list of atlas slots pointing to empty texture data in the atlas

◆ AtlasHeight

uint32 FSlateTextureAtlas::AtlasHeight
protected

Height of the atlas

◆ AtlasOwnerThread

ESlateTextureAtlasThreadId FSlateTextureAtlas::AtlasOwnerThread
protected

The type of thread that owns this atlas - this is the only thread that can safely update it NOTE: We don't use the thread ID here, as the render thread can be recreated if it gets suspended and resumed, giving it a new ID

◆ AtlasUsedSlots

FAtlasedTextureSlot* FSlateTextureAtlas::AtlasUsedSlots
protected

The list of atlas slots pointing to used texture data in the atlas

◆ AtlasWidth

uint32 FSlateTextureAtlas::AtlasWidth
protected

Width of the atlas

◆ bNeedsUpdate

bool FSlateTextureAtlas::bNeedsUpdate
protected

True if this texture needs to have its rendering resources updated

◆ bUpdatesAfterInitialization

bool FSlateTextureAtlas::bUpdatesAfterInitialization
protected

True if this texture can update after initialziation and we should preserve the atlas slots and cpu memory

◆ BytesPerPixel

uint32 FSlateTextureAtlas::BytesPerPixel
protected

Bytes per pixel in the atlas

◆ PaddingStyle

ESlateTextureAtlasPaddingStyle FSlateTextureAtlas::PaddingStyle
protected

Padding style


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