Use the texture swizzle mask to reorder the color channel values returned by the texture function in a shader. More...
#include <kanzi/core.ui/platform/graphics_backend/gl/graphics_swizzle_mask.hpp>
Public Types | |
enum class | ColorComponent : uint8_t { Zero , One , Red , Green , Blue , Alpha , Count } |
Wraps the color components of the graphics library. More... | |
Public Member Functions | |
GLSwizzleMask | getMask () const |
Gets the swizzle mask. | |
constexpr | TextureSwizzleMask (ColorComponent mask) |
Constructs the mask using the same value for each color channel. | |
constexpr | TextureSwizzleMask (ColorComponent redChannelMask, ColorComponent greenChannelMask, ColorComponent blueChannelMask, ColorComponent alphaChannelMask) |
Constructs the mask using separate value for each channel. | |
~TextureSwizzleMask ()=default | |
Default destructor. | |
Use the texture swizzle mask to reorder the color channel values returned by the texture function in a shader.
See https://www.khronos.org/opengl/wiki/Texture#Swizzle_mask.
This mask maps the red channel in a texture to the alpha channel:
Wraps the color components of the graphics library.
Enumerator | |
---|---|
Zero | The component is disabled. Maps to KZS_GL_ZERO. |
One | The component is kept as-is. Maps to KZS_GL_ONE. |
Red | The value for this component comes from the red channel of the texture. All texture color formats have at least a red channel. Maps to KZS_GL_RED. |
Green | The value for this component comes from the green channel of the texture, or 0 if it has no green channel. Maps to KZS_GL_GREEN. |
Blue | The value for this component comes from the blue channel of the texture, or 0 if it has no blue channel. Maps to KZS_GL_BLUE. |
Alpha | The value for this component comes from the alpha channel of the texture, or 1 if it has no alpha channel. Maps to KZS_GL_ALPHA. |
Count | The number of supported color components. |
|
inlineconstexpr |
Constructs the mask using separate value for each channel.
redChannelMask | Mask for red channel. |
greenChannelMask | Mask for green channel. |
blueChannelMask | Mask for blue channel. |
alphaChannelMask | Mask for alpha channel. |
|
inlineconstexpr |
Constructs the mask using the same value for each color channel.
mask | Swizzle mask for all the channels. |
|
default |
Default destructor.
GLSwizzleMask kanzi::TextureSwizzleMask::getMask | ( | ) | const |
Gets the swizzle mask.