Kanzi 4.0.0-beta2
kanzi::Sampler::CreateInfo Struct Reference

Sampler create info structure. More...

#include <kanzi/core.ui/graphics2d/sampler.hpp>

Public Member Functions

constexpr CreateInfo (MipmapMode mipmapMode, Filter minificationFilter, Filter magnificationFilter, AddressingMode addressingMode, GraphicsCompareFunction depthCompareFunction, float anisotropy, float mipLodBias, float minLod, float maxLod)
 Constructor.
 
constexpr AddressingMode getAddressingMode () const
 Gets the addressing mode.
 
constexpr float getAnisotropyLevel () const
 Gets the anisotropy level.
 
constexpr GraphicsCompareFunction getDepthCompareFunction () const
 Gets the depth compare function.
 
constexpr Filter getMagnificationFilter () const
 Gets the magnification filter.
 
constexpr float getMaxLod () const
 Gets maximum texture level of detail.
 
constexpr Filter getMinificationFilter () const
 Gets the minification filter.
 
constexpr float getMinLod () const
 Gets minimum texture level of detail.
 
constexpr float getMipLodBias () const
 Gets the mipmap LoD bias.
 
constexpr MipmapMode getMipmapMode () const
 Gets the mipmamp mode.
 
bool operator< (const CreateInfo &other) const
 Less than -operator.
 
constexpr void setAddressingMode (AddressingMode addressingMode)
 Sets the addressing mode.
 
constexpr void setAnisotropyLevel (float anisotropy)
 Sets the anisotropy level.
 
constexpr void setDepthCompareFunction (GraphicsCompareFunction depthCompareFunction)
 Sets the depth compare function.
 
constexpr void setMagnificationFilter (Filter magnificationFilter)
 Sets the magnification filter.
 
constexpr void setMaxLod (float maxLod)
 Sets maximum texture level of detail.
 
constexpr void setMinificationFilter (Filter minificationFilter)
 Sets the minfication filter.
 
constexpr void setMinLod (float minLod)
 Sets minimum texture level of detail.
 
constexpr void setMipLodBias (float mipLodBias)
 Sets the mipmap LoD bias.
 
constexpr void setMipmapMode (MipmapMode mipmapMode)
 Sets the mipmap mode.
 

Protected Member Functions

template<typename T >
constexpr T getBits (uint32_t mask, uint32_t shift) const
 Gets bits from the first element of the data array.
 
template<typename T >
constexpr void setBits (T value, uint32_t mask, uint32_t shift)
 Sets bits in the first element of the data array.
 

Protected Attributes

union { 
 
   array< uint64_t, 2 >   arrayData 
 Flat array data for fast comparison. More...
 
   struct { 
 
      uint32_t   bitmask 
 Bitmask for packed integer values. More...
 
      float   floatValues [3] 
 Remaining float values. More...
 
   }   structData 
 Separated struct. More...
 
m_data 
 Internal key data that received the packed data.
 

Detailed Description

Sampler create info structure.

The full sampler settings are packed into a key that can be used to easily compare it as opposed to comparing every field separately.

Since
Kanzi 4.0.0 removed the addressingMode, anisotropy, depthCompareFunction, magnificationFilter, maxLod, minificationFilter, minLod, mipLodBias and mipmapMode fields.

Constructor & Destructor Documentation

◆ CreateInfo()

constexpr kanzi::Sampler::CreateInfo::CreateInfo ( MipmapMode mipmapMode,
Filter minificationFilter,
Filter magnificationFilter,
AddressingMode addressingMode,
GraphicsCompareFunction depthCompareFunction,
float anisotropy,
float mipLodBias,
float minLod,
float maxLod )
inlineexplicitconstexpr

Constructor.

Parameters
mipmapModeMipmap mode.
minificationFilterMinification filter.
magnificationFilterMagnification filter.
addressingModeAddressing mode.
depthCompareFunctionDepth compare function.
anisotropyAnisotropy level.
mipLodBiasMipmapping LOD bias.
minLodMinimum LOD level.
maxLodMaximum LOD level.

Member Function Documentation

◆ getBits()

template<typename T >
constexpr T kanzi::Sampler::CreateInfo::getBits ( uint32_t mask,
uint32_t shift ) const
inlineconstexprprotected

Gets bits from the first element of the data array.

Parameters
maskMask for all possible values.
shiftShift index from beginning of data.

◆ setBits()

template<typename T >
constexpr void kanzi::Sampler::CreateInfo::setBits ( T value,
uint32_t mask,
uint32_t shift )
inlineconstexprprotected

Sets bits in the first element of the data array.

Parameters
valueValue to set.
maskMask for all possible values.
shiftShift index from beginning of data.

◆ getMipmapMode()

constexpr MipmapMode kanzi::Sampler::CreateInfo::getMipmapMode ( ) const
inlineconstexpr

Gets the mipmamp mode.

Returns
Mipmap mode.

◆ setMipmapMode()

constexpr void kanzi::Sampler::CreateInfo::setMipmapMode ( MipmapMode mipmapMode)
inlineconstexpr

Sets the mipmap mode.

Parameters
mipmapModeMimap mode.

◆ getMinificationFilter()

constexpr Filter kanzi::Sampler::CreateInfo::getMinificationFilter ( ) const
inlineconstexpr

Gets the minification filter.

Returns
Minification filter.

◆ setMinificationFilter()

constexpr void kanzi::Sampler::CreateInfo::setMinificationFilter ( Filter minificationFilter)
inlineconstexpr

Sets the minfication filter.

Parameters
minificationFilterMinification filter.

◆ getMagnificationFilter()

constexpr Filter kanzi::Sampler::CreateInfo::getMagnificationFilter ( ) const
inlineconstexpr

Gets the magnification filter.

Returns
Magnification filter.

◆ setMagnificationFilter()

constexpr void kanzi::Sampler::CreateInfo::setMagnificationFilter ( Filter magnificationFilter)
inlineconstexpr

Sets the magnification filter.

Parameters
magnificationFilterMagnification filter.

◆ getAddressingMode()

constexpr AddressingMode kanzi::Sampler::CreateInfo::getAddressingMode ( ) const
inlineconstexpr

Gets the addressing mode.

Returns
Addressing mode.

◆ setAddressingMode()

constexpr void kanzi::Sampler::CreateInfo::setAddressingMode ( AddressingMode addressingMode)
inlineconstexpr

Sets the addressing mode.

Parameters
addressingModeAddressing mode.

◆ getDepthCompareFunction()

constexpr GraphicsCompareFunction kanzi::Sampler::CreateInfo::getDepthCompareFunction ( ) const
inlineconstexpr

Gets the depth compare function.

Returns
Depth compare function.

◆ setDepthCompareFunction()

constexpr void kanzi::Sampler::CreateInfo::setDepthCompareFunction ( GraphicsCompareFunction depthCompareFunction)
inlineconstexpr

Sets the depth compare function.

Parameters
depthCompareFunctionDepth compare function.

◆ getAnisotropyLevel()

constexpr float kanzi::Sampler::CreateInfo::getAnisotropyLevel ( ) const
inlineconstexpr

Gets the anisotropy level.

Returns
Anisotropy level.

◆ setAnisotropyLevel()

constexpr void kanzi::Sampler::CreateInfo::setAnisotropyLevel ( float anisotropy)
inlineconstexpr

Sets the anisotropy level.

Parameters
anisotropyAnisotropy level.

◆ getMipLodBias()

constexpr float kanzi::Sampler::CreateInfo::getMipLodBias ( ) const
inlineconstexpr

Gets the mipmap LoD bias.

Returns
Mipmap LoD bias.
Note
Using texture Lod controls requires OpenGL ES 3.0.

◆ setMipLodBias()

constexpr void kanzi::Sampler::CreateInfo::setMipLodBias ( float mipLodBias)
inlineconstexpr

Sets the mipmap LoD bias.

Default CreateInfo constructor initializes this to 0.

Parameters
mipLodBiasMipmap LoD bias.
Note
Using texture Lod controls requires OpenGL ES 3.0.

◆ getMinLod()

constexpr float kanzi::Sampler::CreateInfo::getMinLod ( ) const
inlineconstexpr

Gets minimum texture level of detail.

Returns
Minimum texture level of detail.
Note
Using texture Lod controls requires OpenGL ES 3.0.

◆ setMinLod()

constexpr void kanzi::Sampler::CreateInfo::setMinLod ( float minLod)
inlineconstexpr

Sets minimum texture level of detail.

Default CreateInfo constructor initializes this to -1000 (effectively no clamping for level of detail).

Parameters
minLodMinimum texture level of detail.
Note
Using texture Lod controls requires OpenGL ES 3.0.

◆ getMaxLod()

constexpr float kanzi::Sampler::CreateInfo::getMaxLod ( ) const
inlineconstexpr

Gets maximum texture level of detail.

Returns
Maximum texture level of detail.
Note
Using texture Lod controls requires OpenGL ES 3.0.

◆ setMaxLod()

constexpr void kanzi::Sampler::CreateInfo::setMaxLod ( float maxLod)
inlineconstexpr

Sets maximum texture level of detail.

Default CreateInfo constructor initializes this to 1000 (effectively no clamping for level of detail).

Parameters
maxLodMaximum texture level of detail.
Note
Using texture Lod controls requires OpenGL ES 3.0.

◆ operator<()

bool kanzi::Sampler::CreateInfo::operator< ( const CreateInfo & other) const
inline

Less than -operator.

Parameters
otherRight-hand-side operand.
Returns
If this object is considered smaller than right-hand-side true, false otherwise.

Member Data Documentation

◆ arrayData

array<uint64_t, 2> kanzi::Sampler::CreateInfo::arrayData

Flat array data for fast comparison.

◆ bitmask

uint32_t kanzi::Sampler::CreateInfo::bitmask

Bitmask for packed integer values.

◆ floatValues

float kanzi::Sampler::CreateInfo::floatValues[3]

Remaining float values.

◆ [struct]

struct { ... } kanzi::Sampler::CreateInfo::structData

Separated struct.

◆ [union]

union { ... } kanzi::Sampler::CreateInfo::m_data

Internal key data that received the packed data.

First element bits 0 to 1: Mipmap mode. First element bit 2: Minification filter. First element bit 3: Magnification filter. First element bits 4-6: Addressing mode. First element bits 7-10: Depth compare function. First element bits 11-16: Anisotropy level. First element bits 32-63: Mipmap LoD bias. Second element bits 0-31: Minimum LoD. Second element bits 31-63: Maximum LoD.


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