TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::VisualColorStyle Class Reference

GPU form of a ColorStyle, uploaded as is: the gradient is baked into an atlas slot that colorUV / gradientPage point at. More...

#include <gui_core/style/gui_style.h>

Public Member Functions

void SetTransformation (float3 x, float3 y)
 See ColorStyle::SetTransformation.
void SetAnimSpeed (float x, float y=0.0f)
 See ColorStyle::SetAnimSpeed.
uint64_t GetHashCode () const noexcept
bool operator== (const VisualColorStyle &other) const noexcept

Public Attributes

short4 transformationX = { one, 0, 0, 0 }
 as ColorStyle, with the gradient angle applied
short4 transformationY = { 0, one, 0, 0 }
 as ColorStyle, with the gradient angle applied
ushort2 colorUV = {}
 texel of the gradient in its atlas page
ColorType type = (ColorType)0
uint16_t gradientPage = 0
 Logical gradient atlas page (0..GradientManager::PageCount()-1) that colorUV is in; the renderer maps it to its bindless image slot when uploading.
ImageIndex textureIndex = ImageIndex::Invalid
 texture of the texture types
short2 animSpeed = { 0, 0 }
 half floats, see ColorStyle::SetAnimSpeed

Static Public Attributes

static constexpr int16_t one = 15360
 1.0 as a half float

Factories

As the ColorStyle::Create overloads, baked: each acquires a gradient atlas slot from gradientManager and returns it in outHandle, which the caller owns.

static VisualColorStyle Create (GradientManager &gradientManager, color4b color, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4f color, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4b color1, color4b color2, ColorType type, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4f color1, color4f color2, ColorType type, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4b color1, color4b color2, color4b color3, ColorType type, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4f color1, color4f color2, color4f color3, ColorType type, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4b color1, color4b color2, color4b color3, color4b color4, ColorType type, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, color4f color1, color4f color2, color4f color3, color4f color4, ColorType type, GradientHandle &outHandle)
static VisualColorStyle Create (GradientManager &gradientManager, Gradient gradient, ColorType type, GradientHandle &outHandle)

Detailed Description

GPU form of a ColorStyle, uploaded as is: the gradient is baked into an atlas slot that colorUV / gradientPage point at.

StyleManager owns the atlas slot of registered ones.

Member Function Documentation

◆ SetTransformation()

void tachyon::VisualColorStyle::SetTransformation ( float3 x,
float3 y )

◆ SetAnimSpeed()

void tachyon::VisualColorStyle::SetAnimSpeed ( float x,
float y = 0.0f )

◆ GetHashCode()

uint64_t tachyon::VisualColorStyle::GetHashCode ( ) const
inlinenoexcept

◆ operator==()

bool tachyon::VisualColorStyle::operator== ( const VisualColorStyle & other) const
inlinenoexcept

◆ Create() [1/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4b color,
GradientHandle & outHandle )
static

◆ Create() [2/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4f color,
GradientHandle & outHandle )
static

◆ Create() [3/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4b color1,
color4b color2,
ColorType type,
GradientHandle & outHandle )
static

◆ Create() [4/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4f color1,
color4f color2,
ColorType type,
GradientHandle & outHandle )
static

◆ Create() [5/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4b color1,
color4b color2,
color4b color3,
ColorType type,
GradientHandle & outHandle )
static

◆ Create() [6/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4f color1,
color4f color2,
color4f color3,
ColorType type,
GradientHandle & outHandle )
static

◆ Create() [7/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4b color1,
color4b color2,
color4b color3,
color4b color4,
ColorType type,
GradientHandle & outHandle )
static

◆ Create() [8/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
color4f color1,
color4f color2,
color4f color3,
color4f color4,
ColorType type,
GradientHandle & outHandle )
static

◆ Create() [9/9]

VisualColorStyle tachyon::VisualColorStyle::Create ( GradientManager & gradientManager,
Gradient gradient,
ColorType type,
GradientHandle & outHandle )
static

Member Data Documentation

◆ one

int16_t tachyon::VisualColorStyle::one = 15360
staticconstexpr

1.0 as a half float

◆ transformationX

short4 tachyon::VisualColorStyle::transformationX = { one, 0, 0, 0 }

as ColorStyle, with the gradient angle applied

◆ transformationY

short4 tachyon::VisualColorStyle::transformationY = { 0, one, 0, 0 }

as ColorStyle, with the gradient angle applied

◆ colorUV

ushort2 tachyon::VisualColorStyle::colorUV = {}

texel of the gradient in its atlas page

◆ type

ColorType tachyon::VisualColorStyle::type = (ColorType)0

◆ gradientPage

uint16_t tachyon::VisualColorStyle::gradientPage = 0

Logical gradient atlas page (0..GradientManager::PageCount()-1) that colorUV is in; the renderer maps it to its bindless image slot when uploading.

◆ textureIndex

ImageIndex tachyon::VisualColorStyle::textureIndex = ImageIndex::Invalid

texture of the texture types

◆ animSpeed

short2 tachyon::VisualColorStyle::animSpeed = { 0, 0 }

half floats, see ColorStyle::SetAnimSpeed


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