Math v0.2.0
SIMD optimized C++ mathematics library
Loading...
Searching...
No Matches
Sampler4D Class Reference

Texture (image) sampler 4D. (Includes 3D textures and mipmap levels). More...

#include <sampler.hpp>

Public Member Functions

 Sampler4D (const void *const *mips, uint3 size, uint8 mipCount=1) noexcept
 Creates a new 4D texture (image) sampler.
template<class T = f32x4>
get (uint3 position, uint8 mip) const noexcept
 Returns texel at specified position and mip level.
template<class T = f32x4>
sampleNearest (float3 uv, float mip, bool repeatMode=false) const noexcept
 Samples nearest texel from an image.

Detailed Description

Texture (image) sampler 4D. (Includes 3D textures and mipmap levels).

Constructor & Destructor Documentation

◆ Sampler4D()

Sampler4D ( const void *const * mips,
uint3 size,
uint8 mipCount = 1 )
inlinenoexcept

Creates a new 4D texture (image) sampler.

Parameters
[in]mipstarget texture mipmap pixel data
sizetarget texture 3D size in texels
mipCounttexture mipmap level count

Member Function Documentation

◆ get()

template<class T = f32x4>
T get ( uint3 position,
uint8 mip ) const
inlinenoexcept

Returns texel at specified position and mip level.

Parameters
positiontexel 3D position and mipmap level
miptexture mipmap level (default = 0)
Template Parameters
Ttype of the texture pixel

◆ sampleNearest()

template<class T = f32x4>
T sampleNearest ( float3 uv,
float mip,
bool repeatMode = false ) const
inlinenoexcept

Samples nearest texel from an image.

Parameters
uv3D texture coordinates where to sample
mipmipmap level to sample (default = 0.0)
repeatModeclamp to border or repeat sampling mode
Template Parameters
Ttype of the texture pixel