Antkeeper  0.0.1
Public Member Functions | Friends | List of all members
gl::sampler Class Reference

Sampler object. More...

#include <sampler.hpp>

Public Member Functions

 sampler (sampler_filter mag_filter=sampler_filter::linear, sampler_filter min_filter=sampler_filter::nearest, sampler_mipmap_mode mipmap_mode=sampler_mipmap_mode::linear, sampler_address_mode address_mode_u=sampler_address_mode::repeat, sampler_address_mode address_mode_v=sampler_address_mode::repeat, sampler_address_mode address_mode_w=sampler_address_mode::repeat, float mip_lod_bias=0.0f, float max_anisotropy=0.0f, bool compare_enabled=false, gl::compare_op compare_op=gl::compare_op::less, float min_lod=-1000.0f, float max_lod=1000.0f, const std::array< float, 4 > &border_color={0.0f, 0.0f, 0.0f, 0.0f})
 Constructs a sampler object. More...
 
 ~sampler ()
 Destroys a sampler object. More...
 
 sampler (const sampler &)=delete
 
 sampler (sampler &&)=delete
 
sampleroperator= (const sampler &)=delete
 
sampleroperator= (sampler &&)=delete
 
void set_mag_filter (sampler_filter filter)
 Sets the magnification filter to apply to lookups. More...
 
void set_min_filter (sampler_filter filter)
 Sets the minification filter to apply to lookups. More...
 
void set_mipmap_mode (sampler_mipmap_mode mode)
 Sets the mipmap filter to apply to lookups. More...
 
void set_address_mode_u (sampler_address_mode mode)
 Sets the addressing mode for U-coordinates outside [0, 1). More...
 
void set_address_mode_v (sampler_address_mode mode)
 Sets the addressing mode for V-coordinates outside [0, 1). More...
 
void set_address_mode_w (sampler_address_mode mode)
 Sets the addressing mode for W-coordinates outside [0, 1). More...
 
void set_mip_lod_bias (float bias)
 Sets the bias to be added to mipmap LOD calculation. More...
 
void set_max_anisotropy (float anisotropy)
 Sets the anisotropy clamp value. More...
 
void set_compare_enabled (bool enabled)
 Enables or disables a comparison against a reference value during lookups. More...
 
void set_compare_op (gl::compare_op op)
 Sets the comparison operator to apply to fetched data, if compare is enabled. More...
 
void set_min_lod (float lod)
 Sets the minimum clamp value of the computed LOD. More...
 
void set_max_lod (float lod)
 Sets the maximum clamp value of the computed LOD. More...
 
void set_border_color (const std::array< float, 4 > &color)
 Sets the border color used for texture lookups. More...
 
constexpr sampler_filter get_mag_filter () const noexcept
 Returns the magnification filter to apply to lookups. More...
 
constexpr sampler_filter get_min_filter () const noexcept
 Returns the minification filter to apply to lookups. More...
 
constexpr sampler_mipmap_mode get_mipmap_mode () const noexcept
 Returns the mipmap filter to apply to lookups. More...
 
constexpr sampler_address_mode get_address_mode_u () const noexcept
 Returns the addressing mode for U-coordinates outside [0, 1). More...
 
constexpr sampler_address_mode get_address_mode_v () const noexcept
 Returns the addressing mode for V-coordinates outside [0, 1). More...
 
constexpr sampler_address_mode get_address_mode_w () const noexcept
 Returns the addressing mode for W-coordinates outside [0, 1). More...
 
constexpr float get_mip_lod_bias () const noexcept
 Returns the bias to be added to mipmap LOD calculation. More...
 
constexpr float get_max_anisotropy () const noexcept
 Returns the anisotropy clamp value. More...
 
constexpr float get_compare_enabled () const noexcept
 Returns true if comparison against a reference value during lookups is enabled, false otherwise. More...
 
constexpr compare_op get_compare_op () const noexcept
 Returns the comparison operator to apply to fetched data, if compare is enabled. More...
 
constexpr float get_min_lod () const noexcept
 Returns the minimum clamp value of the computed LOD. More...
 
constexpr float get_max_lod () const noexcept
 Returns the maximum clamp value of the computed LOD. More...
 
constexpr const std::array< float, 4 > & get_border_color () const noexcept
 Returns the border color used for texture lookups. More...
 

Friends

class pipeline
 
class gl_shader_texture_1d
 
class gl_shader_texture_2d
 
class gl_shader_texture_3d
 
class gl_shader_texture_cube
 

Detailed Description

Sampler object.

Definition at line 34 of file sampler.hpp.

Constructor & Destructor Documentation

◆ sampler() [1/3]

gl::sampler::sampler ( sampler_filter  mag_filter = sampler_filter::linear,
sampler_filter  min_filter = sampler_filter::nearest,
sampler_mipmap_mode  mipmap_mode = sampler_mipmap_mode::linear,
sampler_address_mode  address_mode_u = sampler_address_mode::repeat,
sampler_address_mode  address_mode_v = sampler_address_mode::repeat,
sampler_address_mode  address_mode_w = sampler_address_mode::repeat,
float  mip_lod_bias = 0.0f,
float  max_anisotropy = 0.0f,
bool  compare_enabled = false,
gl::compare_op  compare_op = gl::compare_op::less,
float  min_lod = -1000.0f,
float  max_lod = 1000.0f,
const std::array< float, 4 > &  border_color = {0.0f, 0.0f, 0.0f, 0.0f} 
)
explicit

Constructs a sampler object.

Parameters
mag_filterMagnification filter to apply to lookups.
min_filterMinification filter to apply to lookups.
mipmap_modeMipmap filter to apply to lookups.
address_mode_uAddressing mode for U-coordinates outside [0, 1).
address_mode_vAddressing mode for V-coordinates outside [0, 1).
address_mode_wAddressing mode for W-coordinates outside [0, 1).
mip_lod_biasBias to be added to mipmap LOD calculation.
max_anisotropyAnisotropy clamp value.
compare_enabledtrue to enable comparison against a reference value during lookups, false otherwise.
compare_opComparison operator to apply to fetched data, if compare is enabled.
min_lodMinimum clamp value of the computed LOD.
max_lodMaximum clamp value of the computed LOD.
border_colorBorder color used for texture lookups.

Definition at line 67 of file sampler.cpp.

◆ ~sampler()

gl::sampler::~sampler ( )

Destroys a sampler object.

Definition at line 101 of file sampler.cpp.

◆ sampler() [2/3]

gl::sampler::sampler ( const sampler )
delete

◆ sampler() [3/3]

gl::sampler::sampler ( sampler &&  )
delete

Member Function Documentation

◆ get_address_mode_u()

constexpr sampler_address_mode gl::sampler::get_address_mode_u ( ) const
inlineconstexprnoexcept

Returns the addressing mode for U-coordinates outside [0, 1).

Definition at line 189 of file sampler.hpp.

◆ get_address_mode_v()

constexpr sampler_address_mode gl::sampler::get_address_mode_v ( ) const
inlineconstexprnoexcept

Returns the addressing mode for V-coordinates outside [0, 1).

Definition at line 195 of file sampler.hpp.

◆ get_address_mode_w()

constexpr sampler_address_mode gl::sampler::get_address_mode_w ( ) const
inlineconstexprnoexcept

Returns the addressing mode for W-coordinates outside [0, 1).

Definition at line 201 of file sampler.hpp.

◆ get_border_color()

constexpr const std::array<float, 4>& gl::sampler::get_border_color ( ) const
inlineconstexprnoexcept

Returns the border color used for texture lookups.

Definition at line 243 of file sampler.hpp.

◆ get_compare_enabled()

constexpr float gl::sampler::get_compare_enabled ( ) const
inlineconstexprnoexcept

Returns true if comparison against a reference value during lookups is enabled, false otherwise.

Definition at line 219 of file sampler.hpp.

◆ get_compare_op()

constexpr compare_op gl::sampler::get_compare_op ( ) const
inlineconstexprnoexcept

Returns the comparison operator to apply to fetched data, if compare is enabled.

Definition at line 225 of file sampler.hpp.

◆ get_mag_filter()

constexpr sampler_filter gl::sampler::get_mag_filter ( ) const
inlineconstexprnoexcept

Returns the magnification filter to apply to lookups.

Definition at line 171 of file sampler.hpp.

◆ get_max_anisotropy()

constexpr float gl::sampler::get_max_anisotropy ( ) const
inlineconstexprnoexcept

Returns the anisotropy clamp value.

Definition at line 213 of file sampler.hpp.

◆ get_max_lod()

constexpr float gl::sampler::get_max_lod ( ) const
inlineconstexprnoexcept

Returns the maximum clamp value of the computed LOD.

Definition at line 237 of file sampler.hpp.

◆ get_min_filter()

constexpr sampler_filter gl::sampler::get_min_filter ( ) const
inlineconstexprnoexcept

Returns the minification filter to apply to lookups.

Definition at line 177 of file sampler.hpp.

◆ get_min_lod()

constexpr float gl::sampler::get_min_lod ( ) const
inlineconstexprnoexcept

Returns the minimum clamp value of the computed LOD.

Definition at line 231 of file sampler.hpp.

◆ get_mip_lod_bias()

constexpr float gl::sampler::get_mip_lod_bias ( ) const
inlineconstexprnoexcept

Returns the bias to be added to mipmap LOD calculation.

Definition at line 207 of file sampler.hpp.

◆ get_mipmap_mode()

constexpr sampler_mipmap_mode gl::sampler::get_mipmap_mode ( ) const
inlineconstexprnoexcept

Returns the mipmap filter to apply to lookups.

Definition at line 183 of file sampler.hpp.

◆ operator=() [1/2]

sampler& gl::sampler::operator= ( const sampler )
delete

◆ operator=() [2/2]

sampler& gl::sampler::operator= ( sampler &&  )
delete

◆ set_address_mode_u()

void gl::sampler::set_address_mode_u ( sampler_address_mode  mode)

Sets the addressing mode for U-coordinates outside [0, 1).

Parameters
Addressingmode for U-coordinates outside [0, 1).

Definition at line 136 of file sampler.cpp.

◆ set_address_mode_v()

void gl::sampler::set_address_mode_v ( sampler_address_mode  mode)

Sets the addressing mode for V-coordinates outside [0, 1).

Parameters
Addressingmode for V-coordinates outside [0, 1).

Definition at line 146 of file sampler.cpp.

◆ set_address_mode_w()

void gl::sampler::set_address_mode_w ( sampler_address_mode  mode)

Sets the addressing mode for W-coordinates outside [0, 1).

Parameters
Addressingmode for W-coordinates outside [0, 1).

Definition at line 156 of file sampler.cpp.

◆ set_border_color()

void gl::sampler::set_border_color ( const std::array< float, 4 > &  color)

Sets the border color used for texture lookups.

Parameters
colorBorder color used for texture lookups.

Definition at line 221 of file sampler.cpp.

◆ set_compare_enabled()

void gl::sampler::set_compare_enabled ( bool  enabled)

Enables or disables a comparison against a reference value during lookups.

Parameters
enabledtrue to enable comparison against a reference value during lookups, false otherwise.

Definition at line 184 of file sampler.cpp.

◆ set_compare_op()

void gl::sampler::set_compare_op ( gl::compare_op  op)

Sets the comparison operator to apply to fetched data, if compare is enabled.

Parameters
opComparison operator to apply to fetched data, if compare is enabled.

Definition at line 193 of file sampler.cpp.

◆ set_mag_filter()

void gl::sampler::set_mag_filter ( sampler_filter  filter)

Sets the magnification filter to apply to lookups.

Parameters
filterMagnification filter to apply to lookups.

Definition at line 106 of file sampler.cpp.

◆ set_max_anisotropy()

void gl::sampler::set_max_anisotropy ( float  anisotropy)

Sets the anisotropy clamp value.

Parameters
anisotropyAnisotropy clamp value.

Definition at line 175 of file sampler.cpp.

◆ set_max_lod()

void gl::sampler::set_max_lod ( float  lod)

Sets the maximum clamp value of the computed LOD.

Parameters
lodMaximum clamp value of the computed LOD.

Definition at line 212 of file sampler.cpp.

◆ set_min_filter()

void gl::sampler::set_min_filter ( sampler_filter  filter)

Sets the minification filter to apply to lookups.

Parameters
filterMinification filter to apply to lookups.

Definition at line 116 of file sampler.cpp.

◆ set_min_lod()

void gl::sampler::set_min_lod ( float  lod)

Sets the minimum clamp value of the computed LOD.

Parameters
lodMinimum clamp value of the computed LOD.

Definition at line 203 of file sampler.cpp.

◆ set_mip_lod_bias()

void gl::sampler::set_mip_lod_bias ( float  bias)

Sets the bias to be added to mipmap LOD calculation.

Parameters
biasBias to be added to mipmap LOD calculation.

Definition at line 166 of file sampler.cpp.

◆ set_mipmap_mode()

void gl::sampler::set_mipmap_mode ( sampler_mipmap_mode  mode)

Sets the mipmap filter to apply to lookups.

Parameters
modeMipmap filter to apply to lookups.

Definition at line 126 of file sampler.cpp.

Friends And Related Function Documentation

◆ gl_shader_texture_1d

friend class gl_shader_texture_1d
friend

Definition at line 250 of file sampler.hpp.

◆ gl_shader_texture_2d

friend class gl_shader_texture_2d
friend

Definition at line 251 of file sampler.hpp.

◆ gl_shader_texture_3d

friend class gl_shader_texture_3d
friend

Definition at line 252 of file sampler.hpp.

◆ gl_shader_texture_cube

friend class gl_shader_texture_cube
friend

Definition at line 253 of file sampler.hpp.

◆ pipeline

friend class pipeline
friend

Definition at line 249 of file sampler.hpp.


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