ShaderSamplerKit

class HPS::ShaderSamplerKit : public HPS::Kit

ShaderSamplerKit class is a user space object. It is used for specifying all settings related to a ShaderSamplerKey.

Public Functions

virtual bool Empty() const

Indicates whether this ShaderSamplerKit has any values set on it.

Returns

true if no values are set on this ShaderSamplerKit, false otherwise.

bool Equals(ShaderSamplerKit const &in_kit) const

Check if the source ShaderSamplerKit is equivalent to this ShaderSamplerKit.

Parameters

in_kit – The source ShaderSamplerKit to compare to this ShaderSamplerKit.

Returns

true if the objects are equivalent, false otherwise.

inline virtual HPS::Type ObjectType() const

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns

The declared type of the object in question, which may differ from the true, underlying type.

bool operator!=(ShaderSamplerKit const &in_kit) const

Check if the source ShaderSamplerKit is not equivalent to this ShaderSamplerKit.

Parameters

in_kit – The source ShaderSamplerKit to compare to this ShaderSamplerKit.

Returns

true if the objects are not equivalent, false otherwise.

ShaderSamplerKit &operator=(ShaderSamplerKit &&in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this ShaderSamplerKit thereby avoiding a copy.

Parameters

in_that – An rvalue reference to a ShaderSamplerKit to take the impl from.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &operator=(ShaderSamplerKit const &in_kit)

Copies the source ShaderSamplerKit into this ShaderSamplerKit.

Parameters

in_kit – The source ShaderSamplerKit to copy.

Returns

A reference to this ShaderSamplerKit.

bool operator==(ShaderSamplerKit const &in_kit) const

Check if the source ShaderSamplerKit is equivalent to this ShaderSamplerKit.

Parameters

in_kit – The source ShaderSamplerKit to compare to this ShaderSamplerKit.

Returns

true if the objects are equivalent, false otherwise.

void Set(ShaderSamplerKit const &in_kit)

Copies the source ShaderSamplerKit into this ShaderSamplerKit.

Parameters

in_kit – The source ShaderSamplerKit to copy.

ShaderSamplerKit &SetBorderColor(HPS::Shader::Sampler::BorderColor in_border_color)

Sets the border color to use when clamp to border is set for width address or height address. transparent black will use the RGBA value (0, 0, 0, 0). opaque black will use the RGBA value (0, 0, 0, 1). opaque white will use the RGBA value (1, 1, 1, 1). Default is transparent black. Note that even though transparent black can be returned, it does not mean that the resulting object will be treated as transparent - merely that the sampler will return values with an alpha of 0 if it ends up needing to return the border color.

Parameters

in_border_color – The border color.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetHeightAddress(HPS::Shader::Sampler::AddressMode in_height_address)

Sets the behavior of the sampler when the texture coordinates used for sampling are outside the range [0, 1] in the vertical texture coordinate direction. repeat will repeat the texture vertically indefinitely. mirror repeat will mirror the texture vertically indefinitely. clamp to edge will clamp the vertical coordinate to the range [0, 1]. clamp to border will clamp the vertical coordinate to the range [0, 1] and return the specified border color for values of 0 and 1. mirror clamp to edge will mirror the texture once vertically and then clamp the vertical coordinate to the range [0, 1]. Default is repeat.

Parameters

in_height_address – The behavior of the sampler.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetMagFilter(HPS::Shader::Sampler::Filter in_mag_filter)

Sets the type of filtering to use when textures need to be magnified, i.e., when adjacent screen pixels span less than a single texel.

Parameters

in_mag_filter – The type of filtering.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetMaxAnisotropy(int in_max_anisotropy)

Sets the maximum number of anisotropy samples to use. 1 disables anisotropic filtering, larger values enable anisotropic filtering up to a maximum number of samples of 16.

Parameters

in_max_anisotropy – The maximum number of anisotropy samples to use.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetMaxLOD(float in_max_lod)

Sets the maximum mipmap level to sample. 0 is the mip level of the original image, larger values correspond to smaller textures in the mip chain. The default is FLT_MAX, i.e., no upper limit, and the value should be greater than or equal to min lod.

Parameters

in_max_lod – The lowest mipmap level to sample.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetMinFilter(HPS::Shader::Sampler::Filter in_min_filter)

Sets the type of filtering to use when textures need to be minified, i.e., when adjacent screen pixels span multiple texels.

Parameters

in_min_filter – The type of filtering.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetMinLOD(float in_min_lod)

Sets the lowest mipmap level to sample. 0 is the mip level of the original image, larger values correspond to smaller textures in the mip chain. The default is 0, and the value should be less than or equal to max lod.

Parameters

in_min_lod – The lowest mipmap level to sample.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetMipFilter(HPS::Shader::Sampler::Filter in_mip_filter)

Sets the type of filtering to use when mipmaps are present for a texture.

Parameters

in_mip_filter – The type of filtering.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetName(char const *in_name)

Sets the name for the sampler.

Parameters

in_width – The name of the sampler.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit &SetWidthAddress(HPS::Shader::Sampler::AddressMode in_width_address)

Sets the behavior of the sampler when the texture coordinates used for sampling are outside the range [0, 1] in the horizontal texture coordinate direction. repeat will repeat the texture horizontally indefinitely. mirror repeat will mirror the texture horizontally indefinitely. clamp to edge will clamp the horizontal coordinate to the range [0, 1]. clamp to border will clamp the horizontal coordinate to the range [0, 1] and return the specified border color for values of 0 and 1. mirror clamp to edge will mirror the texture once horizontally and then clamp the horizontal coordinate to the range [0, 1]. Default is repeat.

Parameters

in_width_address – The behavior of the sampler.

Returns

A reference to this ShaderTextureKit.

ShaderSamplerKit()

The default constructor creates an empty ShaderSamplerKit object.

ShaderSamplerKit(ShaderSamplerKit &&in_that)

The move constructor creates a ShaderSamplerKit by transferring the underlying impl of the rvalue reference to this ShaderSamplerKit thereby avoiding a copy and allocation.

Parameters

in_that – An rvalue reference to a ShaderSamplerKit to take the impl from.

ShaderSamplerKit(ShaderSamplerKit const &in_kit)

The copy constructor creates a new ShaderSamplerKit object that contains the same settings as the source ShaderSamplerKit.

Parameters

in_kit – The source ShaderSamplerKit to copy.

void Show(ShaderSamplerKit &out_kit) const

Copies this ShaderSamplerKit into the given ShaderSamplerKit.

Parameters

out_kit – The ShaderSamplerKit to populate with the contents of this ShaderSamplerKit.

bool ShowBorderColor(HPS::Shader::Sampler::BorderColor &out_border_color) const

Shows the border color.

Parameters

out_border_color – The border color.

Returns

true if the name is valid, false otherwise.

bool ShowHeightAddress(HPS::Shader::Sampler::AddressMode &out_height_address) const

Shows the behavior of the sampler when the texture coordinates used for sampling are outside the range [0, 1] vertically.

Parameters

out_height_address – The behavior of the sampler.

Returns

true if the name is valid, false otherwise.

bool ShowMagFilter(HPS::Shader::Sampler::Filter &out_mag_filter) const

Shows the type of filtering to use when textures need to be magnified.

Parameters

out_mag_filter – The type of filtering.

Returns

true if the name is valid, false otherwise.

bool ShowMaxAnisotropy(int &out_max_anisotropy) const

Shows the maximum number of anisotropy samples to use.

Parameters

out_max_anisotropy – The maximum number of anisotropy samples to use.

Returns

true if the name is valid, false otherwise.

bool ShowMaxLOD(float &out_max_lod) const

Shows the maximum mipmap level to sample.

Parameters

out_max_lod – The maximum mipmap level to sample.

Returns

true if the name is valid, false otherwise.

bool ShowMinFilter(HPS::Shader::Sampler::Filter &out_min_filter) const

Shows the type of filtering to use when textures need to be minified.

Parameters

out_min_filter – The type of filtering.

Returns

true if the name is valid, false otherwise.

bool ShowMinLOD(float &out_min_lod) const

Shows the lowest mipmap level to sample.

Parameters

out_min_lod – The lowest mipmap level to sample.

Returns

true if the name is valid, false otherwise.

bool ShowMipFilter(HPS::Shader::Sampler::Filter &out_mip_filter) const

Shows the type of filtering to use when mipmaps are present for a texture.

Parameters

out_mip_filter – The type of filtering.

Returns

true if the name is valid, false otherwise.

bool ShowName(UTF8 &out_name) const

Shows the name of the sampler.

Parameters

out_name – The name the sampler.

Returns

true if the name is valid, false otherwise.

bool ShowWidthAddress(HPS::Shader::Sampler::AddressMode &out_width_address) const

Shows the behavior of the sampler when the texture coordinates used for sampling are outside the range [0, 1] horizontally.

Parameters

out_width_address – The behavior of the sampler.

Returns

true if the name is valid, false otherwise.

ShaderSamplerKit &UnsetBorderColor()

Removes the border color.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetEverything()

Removes all settings from this ShaderSamplerKit.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetHeightAddress()

Removes the behavior of the sampler when the texture coordinates used for sampling are outside the range [0, 1] vertically.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetMagFilter()

Removes the type of filtering to use when textures need to be magnified.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetMaxAnisotropy()

Removes the maximum number of anisotropy samples to use.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetMaxLOD()

Removes the maximum mipmap level to sample.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetMinFilter()

Removes the type of filtering to use when textures need to be minified.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetMinLOD()

Removes the lowest mipmap level to sample.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetMipFilter()

Removes the type of filtering to use when mipmaps are present for a texture.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetName()

Removes the name for the sampler.

Returns

A reference to this ShaderSamplerKit.

ShaderSamplerKit &UnsetWidthAddress()

Removes the behavior of the sampler when the texture coordinates used for sampling are outside the range [0, 1] horizontally.

Returns

A reference to this ShaderSamplerKit.

virtual ~ShaderSamplerKit()

Public Static Attributes

static const HPS::Type staticType = HPS::Type::ShaderSamplerKit