GREM 3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
grem::graphics::TextureAspects Class Reference

Set of aspects of a texture format. More...

#include <GREM/graphics/Texture.hpp>

Public Member Functions

constexpr TextureAspects () noexcept=default
 Construct an empty aspect set.
constexpr TextureAspects (TextureAspect aspect)
 Construct an aspect set containing only one specific aspect.
constexpr bool operator== (const TextureAspects &other) const noexcept=default
 Compare this aspect set to another for equality.
constexpr bool empty () const noexcept
 Check if the aspect set is empty.
constexpr bool contains (TextureAspect aspect) const noexcept
 Check if the aspect set contains the given aspect.
constexpr bool containsAnyOf (TextureAspects aspects) const noexcept
 Check if the aspect set contains at least one of the given aspects.
constexpr bool containsAllOf (TextureAspects aspects) const noexcept
 Check if the aspect set contains all of the given aspects.

Static Public Attributes

static const TextureAspects ALL = ~TextureAspects{}
 Set containing all possible texture aspects.
static const TextureAspects DEPTH_STENCIL = TextureAspect::DEPTH | TextureAspect::STENCIL
 Set containing both the depth and stencil texture aspects.
static const TextureAspects COLOR_DEPTH_STENCIL = TextureAspect::COLOR | TextureAspect::DEPTH | TextureAspect::STENCIL
 Set containing the color, depth and stencil texture aspects.

Friends

constexpr TextureAspects operator~ (TextureAspects a) noexcept
 Get the complement of an aspect set.
constexpr TextureAspects operator& (TextureAspects a, TextureAspects b) noexcept
 Get the intersection of two aspect sets.
constexpr TextureAspects operator| (TextureAspects a, TextureAspects b) noexcept
 Get the union of two aspect sets.
constexpr TextureAspects operator^ (TextureAspects a, TextureAspects b) noexcept
 Get the symmetric difference of two aspect sets.
constexpr TextureAspects & operator&= (TextureAspects &a, TextureAspects b) noexcept
 Assign the intersection of two aspect sets to the first set.
constexpr TextureAspects & operator|= (TextureAspects &a, TextureAspects b) noexcept
 Assign the union of two aspect sets to the first set.
constexpr TextureAspects & operator^= (TextureAspects &a, TextureAspects b) noexcept
 Assign the symmetric difference of two aspect sets to the first set.

Detailed Description

Set of aspects of a texture format.

Constructor & Destructor Documentation

◆ TextureAspects() [1/2]

grem::graphics::TextureAspects::TextureAspects ( )
constexprdefaultnoexcept

Construct an empty aspect set.

◆ TextureAspects() [2/2]

grem::graphics::TextureAspects::TextureAspects ( TextureAspect aspect)
inlineconstexpr

Construct an aspect set containing only one specific aspect.

Parameters
aspecttexture aspect to include.
Note
Aspect sets can be combined using operator|(TextureAspects, TextureAspects).

Member Function Documentation

◆ operator==()

bool grem::graphics::TextureAspects::operator== ( const TextureAspects & other) const
nodiscardconstexprdefaultnoexcept

Compare this aspect set to another for equality.

Parameters
otherthe aspect set to compare this one to.
Returns
true if the aspect sets are equal, false otherwise.

◆ empty()

bool grem::graphics::TextureAspects::empty ( ) const
inlinenodiscardconstexprnoexcept

Check if the aspect set is empty.

Returns
true if the set contains no aspects, false otherwise.

◆ contains()

bool grem::graphics::TextureAspects::contains ( TextureAspect aspect) const
inlinenodiscardconstexprnoexcept

Check if the aspect set contains the given aspect.

Parameters
aspectaspect identifier to check for.
Returns
true if the set contains the given aspect, false otherwise.

◆ containsAnyOf()

bool grem::graphics::TextureAspects::containsAnyOf ( TextureAspects aspects) const
inlinenodiscardconstexprnoexcept

Check if the aspect set contains at least one of the given aspects.

Parameters
aspectsaspect set to check for.
Returns
true if the set contains at least one of the given aspects, false otherwise.

◆ containsAllOf()

bool grem::graphics::TextureAspects::containsAllOf ( TextureAspects aspects) const
inlinenodiscardconstexprnoexcept

Check if the aspect set contains all of the given aspects.

Parameters
aspectsaspect set to check for.
Returns
true if the set contains all of the given aspects, false otherwise.

◆ operator~

TextureAspects operator~ ( TextureAspects a)
friend

Get the complement of an aspect set.

Parameters
athe set to invert.
Returns
a set containing all possible aspects except those in the given set.

◆ operator&

TextureAspects operator& ( TextureAspects a,
TextureAspects b )
friend

Get the intersection of two aspect sets.

Parameters
afirst aspect set.
bsecond aspect set.
Returns
a set containing all aspects contained in both a and b.

◆ operator|

TextureAspects operator| ( TextureAspects a,
TextureAspects b )
friend

Get the union of two aspect sets.

Parameters
afirst aspect set.
bsecond aspect set.
Returns
a set containing all aspects contained in a or b or both.

◆ operator^

TextureAspects operator^ ( TextureAspects a,
TextureAspects b )
friend

Get the symmetric difference of two aspect sets.

Parameters
afirst aspect set.
bsecond aspect set.
Returns
a set containing all aspects contained in either a or b, but not both.

◆ operator&=

TextureAspects & operator&= ( TextureAspects & a,
TextureAspects b )
friend

Assign the intersection of two aspect sets to the first set.

Parameters
afirst aspect set.
bsecond aspect set.
Returns
a reference to the first set, which was assigned to.

◆ operator|=

TextureAspects & operator|= ( TextureAspects & a,
TextureAspects b )
friend

Assign the union of two aspect sets to the first set.

Parameters
afirst aspect set.
bsecond aspect set.
Returns
a reference to the first set, which was assigned to.

◆ operator^=

TextureAspects & operator^= ( TextureAspects & a,
TextureAspects b )
friend

Assign the symmetric difference of two aspect sets to the first set.

Parameters
afirst aspect set.
bsecond aspect set.
Returns
a reference to the first set, which was assigned to.

Member Data Documentation

◆ ALL

TextureAspects grem::graphics::TextureAspects::ALL = ~TextureAspects{}
inlinestaticconstexpr

Set containing all possible texture aspects.

◆ DEPTH_STENCIL

TextureAspects grem::graphics::TextureAspects::DEPTH_STENCIL = TextureAspect::DEPTH | TextureAspect::STENCIL
inlinestaticconstexpr

Set containing both the depth and stencil texture aspects.

◆ COLOR_DEPTH_STENCIL

TextureAspects grem::graphics::TextureAspects::COLOR_DEPTH_STENCIL = TextureAspect::COLOR | TextureAspect::DEPTH | TextureAspect::STENCIL
inlinestaticconstexpr

Set containing the color, depth and stencil texture aspects.


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