FTextureLayout

An incremental texture space allocator.

Windows
MacOS
Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Public/TextureLayout.h

Include

#include "TextureLayout.h"

Syntax

class FTextureLayout

Remarks

An incremental texture space allocator. For best results, add the elements ordered descending in size.

Constructors

Name Description

Public function

FTextureLayout

(
    uint32 MinSizeX,
    uint32 MinSizeY,
    uint32 MaxSizeX,
    uint32 MaxSizeY,
    bool bInPowerOfTwoSize,
    ETextureLayoutAspectRatio InAspect,
    bool bInAlignByFour
)

Minimal initialization constructor.

Functions

Name Description

Public function

bool

 

AddElement

(
    uint32& OutBaseX,
    uint32& OutBaseY,
    uint32 ElementSizeX,
    uint32 ElementSizeY
)

Finds a free area in the texture large enough to contain a surface with the given size.

Public function Const

uint32

 

GetSizeX()

Returns the minimum texture width which will contain the allocated surfaces.

Public function Const

uint32

 

GetSizeY()

Returns the minimum texture height which will contain the allocated surfaces.

Public function

bool

 

RemoveElement

(
    uint32 ElementBaseX,
    uint32 ElementBaseY,
    uint32 ElementSizeX,
    uint32 ElementSizeY
)

Removes a previously allocated element from the layout and collapses the tree as much as possible, In order to create the largest free block possible and return the tree to its state before the element was added.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss