class TSpriteImageAllocation

template<bool IsRenderProxy>

Provides information about a sprite image rendered into a texture.

Also tracks lifetime of such allocations. One sprite image may have one or multiple such allocations, resulting from different scale/size requirements.

Public

Methods

~TSpriteImageAllocation<IsRenderProxy>

virtual ~TSpriteImageAllocation<IsRenderProxy>() = default

GetTexture

const TextureType &GetTexture() const

Retrieves the texture where the image is stored.

GetSize

Size2I GetSize() const

Returns the pixel size of the UV subrange covered in the texture atlas.

If the image includes animation, this will return the size of the entire animation grid.

GetUVRange

Area2 GetUVRange() const

Determines the UV range that the image is referencing.

TransformUV

Vector2 TransformUV(const Vector2 &uv) const

Transforms local UV coordinates into atlas UV coordinates.

Protected

Constructors

TSpriteImageAllocation<IsRenderProxy>

TSpriteImageAllocation<IsRenderProxy>() = default

TSpriteImageAllocation<IsRenderProxy>

TSpriteImageAllocation<IsRenderProxy>(const WeakSPtr<SpriteImageType> &owner, const TextureType &atlasTexture, const Area2 &uvRange)

Fields

mOwner

WeakSPtr<SpriteImageType> mOwner

Owner sprite image that this allocation is a part of.

mTexture

TextureType mTexture

Texture within which the image is allocated.

mUVRange

Area2 mUVRange

Range in the atlas texture that the image is to be read from, in [0, 1] range.