Skip to main content

Slice

The Slice struct defines a specific subset of a texture or image, using faces, layers, and mipmaps. It can be configured to represent a single face, layer, or mipmap level of an image. The struct includes methods for checking if the slice has multiple faces, layers, or mipmaps, and for adjusting or replacing slice sizes and bases.

#include <TellusimTypes.h>

Constructors

Slice()
Slice(const Face &f)
Slice(const Layer &l)
Slice(const Mipmap &m)
Slice(const Layer &l, const Face &f)
Slice(const Face &f, const Mipmap &m)
Slice(const Layer &l, const Mipmap &m)
Slice(const Layer &l, const Face &f, const Mipmap &m)

Methods

Slice parameters.

bool hasFaces() const
bool hasLayers() const
bool hasMipmaps() const
Face getFace() const
Layer getLayer() const
Mipmap getMipmap() const

Set slice parameters.

Slice setFace(uint32_t base, uint32_t size = 1) const
Slice setLayer(uint32_t base, uint32_t size = 1) const
Slice setMipmap(uint32_t base, uint32_t size = 1) const

Replace slice sizes.

Slice setSize(const Slice &s) const

Increment slice bases.

Slice addBase(const Slice &s) const

Variables

TypeNameValue
uint32_tface0
uint32_tfaces1
uint32_tlayer0
uint32_tlayers1
uint32_tmipmap0
uint32_tmipmaps1