Template Struct BasicColor

Inheritance Relationships

Derived Type

Struct Documentation

template<typename T>
struct BasicColor

Graphics API agnostic representation of a four channel color.

Param <T>

The type of data for each of this BasicColor<>'s channel values

Subclassed by gpa::api_types::detail::Color< T >

Public Functions

inline BasicColor(T const &_r = {}, T const &_g = {}, T const &_b = {}, T const &_a = {})

Constructs an instance of BasicColor<>

Parameters
  • [in, optional -- = { }] r This BasicColor<>'s red channel value

  • [in, optional -- = { }] g This BasicColor<>'s green channel value

  • [in, optional -- = { }] b This BasicColor<>'s blue channel value

  • [in, optional -- = { }] a This BasicColor<>'s alpha channel value

BasicColor(BasicColor<T> const &other) = default

Constructs an instance of BasicColor<>

Parameters

other -- [in] The BasicColor<> to copy from

Returns

This BasicColor<> after being copied to

BasicColor<T> &operator=(BasicColor<T> const &other) = default

Constructs an instance of BasicColor<>

Parameters

other -- [in] The BasicColor<> to copy from

Returns

This BasicColor<> after being copied to

inline T const &operator[](size_t index) const

Gets a const reference to the channel value at a given index.

Parameters

index -- [in] The index of the channel value to get

Returns

A const reference to the channel value at the given index

inline T &operator[](size_t index)

Gets a reference to the channel value at a given index.

Parameters

index -- [in] The index of the channel value to get

Returns

A reference to the channel value at the given index

Public Members

T r = {}

This BasicColor<>'s red channel value.

T g = {}

This BasicColor<>'s green channel value.

T b = {}

This BasicColor<>'s blue channel value.

T a = {}

This BasicColor<>'s alpha channel value.

Public Static Attributes

static size_t constexpr ChannelCount = {4}

The number of channels in a BasicColor<>