|
| concept | ufo::Color |
| | Identifies any UFO color instantiation (Gray, Lab, Lch, Lrgb, Rgb).
|
| |
| concept | ufo::FloatingPointColor |
| | Colors with a floating-point channel type.
|
| |
| concept | ufo::IntegralColor |
| | Colors with an integral channel type.
|
| |
| concept | ufo::ColorWithAlpha |
| | Colors that include an alpha channel.
|
| |
| concept | ufo::ColorWithWeight |
| | Colors that include a weight channel.
|
| |
| concept | ufo::ColorWithAlphaAndWeight |
| | Colors with both alpha and weight channels.
|
| |
| concept | ufo::BasicColor |
| | Colors without optional channels (no alpha, no weight).
|
| |
| concept | ufo::GrayColor |
| | Grayscale colors (Gray<T, Flags>).
|
| |
| concept | ufo::RgbColor |
| | Gamma-encoded sRgb colors (Rgb<T, Flags>).
|
| |
| concept | ufo::LinearRgbColor |
| | Linear-light Rgb colors (Lrgb<T, Flags>).
|
| |
| concept | ufo::LabColor |
| | Oklab perceptual colors (Lab<T, Flags>).
|
| |
| concept | ufo::LchColor |
| | OkLch cylindrical colors (Lch<T, Flags>).
|
| |
| concept | ufo::RgbFamilyColor |
| | Rgb-family colors (gamma-encoded or linear: Rgb or Lrgb).
|
| |
| concept | ufo::PerceptualColor |
| | Perceptual color models (Lab or Lch).
|
| |
| concept | ufo::DisplayColor |
| | Color models suitable for display (Rgb, Lrgb, or Gray).
|
| |
| concept | ufo::HueBasedColor |
| | Color models with a hue component (Lch).
|
| |
| concept | ufo::LightnessBasedColor |
| | Color models with a lightness component (Lab or Lch).
|
| |
| concept | ufo::AccumulableColor |
| | Colors that support weighted accumulation (floating-point with weight).
|
| |
| concept | ufo::ImageColor |
| | Colors suitable for image processing (integral, or floating-point display colors).
|
| |
| concept | ufo::HDRColor |
| | Colors suitable for high dynamic range operations (floating-point display colors).
|
| |
| concept | ufo::TransparentColor |
| | Colors with transparency support.
|
| |
| concept | ufo::CompactColor |
| | Colors optimized for compact storage (integral, at most 16 bits per channel).
|
| |
| concept | ufo::SameValueType |
| | Two colors with the same underlying channel type.
|
| |
| concept | ufo::SameColorModel |
| | Two colors with the same color model.
|
| |
| concept | ufo::SameColorFlags |
| | Two colors with the same flags.
|
| |
| concept | ufo::EquivalentColors |
| | Two colors that are equivalent (same model, channel type, and flags).
|
| |
| concept | ufo::ConvertibleColor |
| | Colors with compatible channel types for conversion.
|
| |
| concept | ufo::BlendableColors |
| | Colors that can be blended together (same model and mutually convertible types).
|
| |
| concept | ufo::ColorWithValueType |
| | Colors with a specific channel type.
|
| |
| concept | ufo::Color8Bit |
| | Colors with an 8-bit channel type.
|
| |
| concept | ufo::Color16Bit |
| | Colors with a 16-bit channel type.
|
| |
| concept | ufo::ColorFloat |
| | Colors with a 32-bit float channel type.
|
| |
| concept | ufo::ColorDouble |
| | Colors with a 64-bit double channel type.
|
| |
| concept | ufo::GammaCorrectable |
| | Colors that support gamma correction (Rgb family).
|
| |
| concept | ufo::ColorSpaceConvertible |
| | Colors that support color space conversion between display color models.
|
| |
| concept | ufo::PerceptuallyUniform |
| | Colors that operate in a perceptually uniform space.
|
| |
| concept | ufo::IsColor |
| | Convenience alias: any UFO color instantiation.
|
| |
|
| struct | ufo::Gray< T, Flags > |
| | Grayscale color. More...
|
| |
| class | ufo::Image< T > |
| | Image class for storing and manipulating 2D pixel data. More...
|
| |
| struct | ufo::Lab< T, Flags > |
| | Oklab perceptual color. More...
|
| |
| struct | ufo::Lch< T, Flags > |
| | OkLch color. More...
|
| |
| struct | ufo::Lrgb< T, Flags > |
| | Linear-light RGB color. More...
|
| |
| struct | ufo::OrthogonalCamera |
| | Orthogonal camera model for ray-generation and projection. More...
|
| |
| struct | ufo::OrthogonalIntrinsics |
| | Stores the intrinsic parameters of an orthogonal camera. More...
|
| |
| struct | ufo::PerspectiveCamera |
| | Perspective camera model for ray-generation and projection. More...
|
| |
| struct | ufo::PerspectiveIntrinsics |
| | Stores the intrinsic parameters of a perspective camera. More...
|
| |
| struct | ufo::Rgb< T, Flags > |
| | Gamma-encoded sRGB color. More...
|
| |
| enum class | ColorDeltaE { EUCLIDEAN
, OK
} |
| |
| template<Color C> |
| constexpr float | ufo::deltaEEuclideanSquared (C const &color, C const &sample) |
| | Computes the squared Euclidean distance between two colors.
|
| |
| template<Color C> |
| constexpr float | ufo::deltaEEuclidean (C const &color, C const &sample) |
| | Computes the Euclidean distance between two colors.
|
| |
| template<Color C> |
| constexpr float | ufo::deltaEOkSquared (C const &color, C const &sample, float const ab_scale=2.0f) |
| | Computes the squared Ok delta E distance between two colors.
|
| |
| template<Color C> |
| constexpr float | ufo::deltaEOk (C const &color, C const &sample, float const ab_scale=2.0f) |
| | Computes the Ok delta E distance between two colors.
|
| |
| template<Color C> |
| constexpr float | ufo::deltaESquared (C const &color, C const &sample, ColorDeltaE method=ColorDeltaE::EUCLIDEAN, ColorSpace space=ColorSpace::NATIVE) |
| | Computes the squared distance between two colors using a specified method.
|
| |
| template<Color C> |
| constexpr float | ufo::deltaE (C const &color, C const &sample, ColorDeltaE method=ColorDeltaE::EUCLIDEAN, ColorSpace space=ColorSpace::NATIVE) |
| | Computes the distance between two colors using a specified method.
|
| |
| enum class | ufo::ColorFlags : std::uint8_t { ufo::ColorFlags::None = 0
, ufo::ColorFlags::Alpha = 1 << 0
, ufo::ColorFlags::Weight = 1 << 1
, ufo::ColorFlags::All = Alpha | Weight
} |
| | Bitmask controlling optional fields in a Color specialisation. More...
|
| |
| constexpr ColorFlags | ufo::operator| (ColorFlags a, ColorFlags b) noexcept |
| | Bitwise OR for combining ColorFlags.
|
| |
| constexpr ColorFlags | ufo::operator& (ColorFlags a, ColorFlags b) noexcept |
| | Bitwise AND for testing ColorFlags.
|
| |
| constexpr ColorFlags | ufo::operator~ (ColorFlags a) noexcept |
| | Bitwise complement - inverts all valid ColorFlags bits.
|
| |
| consteval bool | ufo::alphaset (ColorFlags flags) noexcept |
| | Returns true if the Alpha flag is set.
|
| |
| consteval bool | ufo::weightset (ColorFlags flags) noexcept |
| | Returns true if the Weight flag is set.
|
| |
| constexpr std::string_view | ufo::toString (ColorFlags flags) noexcept |
| | Returns a human-readable string for a ColorFlags value.
|
| |
| std::ostream & | ufo::operator<< (std::ostream &os, ColorFlags flags) |
| | Stream-insertion operator for ColorFlags.
|
| |
| enum class | ufo::ColorSpace {
NATIVE
, Rgb
, Oklab
, Oklab2
,
Oklch
} |
| | Selects the working color space for color operations. More...
|
| |
| constexpr std::string_view | ufo::toString (ColorSpace cs) noexcept |
| | Returns a human-readable name for cs.
|
| |
| std::ostream & | ufo::operator<< (std::ostream &out, ColorSpace cs) |
| | Writes the color-space name to out.
|
| |
| enum class | ufo::ColorModel {
Gray
, Lab
, Lch
, Lrgb
,
Rgb
} |
| | Tag identifying the color model of a color type. More...
|
| |
| template<class... Ts> |
| using | ufo::first_color_t = typename first_color< Ts... >::type |
| |
| template<class T > |
| using | ufo::value_type_t = typename color_traits< T >::value_type |
| | Extracts the channel scalar type of a color.
|
| |
| template<class T > |
| using | ufo::alpha_type_t = typename color_traits< T >::value_type |
| | Extracts the alpha scalar type of a color.
|
| |
| template<class T > |
| using | ufo::add_alpha_t = typename color_traits< T >::template rebind_flags< color_traits< T >::flags|ColorFlags::Alpha > |
| | Adds ColorFlags::Alpha to a color type.
|
| |
| template<class T > |
| using | ufo::remove_alpha_t = typename color_traits< T >::template rebind_flags< color_traits< T >::flags &~ColorFlags::Alpha > |
| | Removes ColorFlags::Alpha from a color type.
|
| |
| template<class T > |
| using | ufo::weight_type_t = typename color_traits< T >::weight_type |
| | Extracts the weight scalar type of a color.
|
| |
| template<class T > |
| using | ufo::add_weight_t = typename color_traits< T >::template rebind_flags< color_traits< T >::flags|ColorFlags::Weight > |
| | Adds ColorFlags::Weight to a color type.
|
| |
| template<class T > |
| using | ufo::remove_weight_t = typename color_traits< T >::template rebind_flags< color_traits< T >::flags &~ColorFlags::Weight > |
| | Removes ColorFlags::Weight from a color type.
|
| |
| template<class T > |
| constexpr bool | ufo::is_color_v = is_color<T>::value |
| |
| template<class... Ts> |
| constexpr bool | ufo::contains_color_v = contains_color<Ts...>::value |
| |
| template<class T > |
| constexpr bool | ufo::has_alpha_v = has_alpha<T>::value |
| |
| template<class T > |
| constexpr auto | ufo::init_alpha_v = init_alpha<T>::value |
| |
| template<class T > |
| constexpr bool | ufo::has_weight_v = has_weight<T>::value |
| |
| template<Color C> |
| constexpr C & | ufo::operator+= (C &lhs, C const &rhs) |
| | Adds two colors component-wise.
|
| |
| template<Color C> |
| constexpr C | ufo::operator+ (C lhs, C const &rhs) |
| | Adds two colors component-wise.
|
| |
| template<Color C> |
| constexpr C & | ufo::operator-= (C &lhs, C const &rhs) |
| | Subtracts two colors component-wise.
|
| |
| template<Color C> |
| constexpr C | ufo::operator- (C lhs, C const &rhs) |
| | Subtracts two colors component-wise.
|
| |
| template<Color C> |
| constexpr C & | ufo::operator*= (C &lhs, float rhs) |
| | Multiplies a color by a scalar.
|
| |
| template<Color C> |
| constexpr C & | ufo::operator*= (C &lhs, C const &rhs) |
| | Multiplies two colors component-wise.
|
| |
| template<Color C> |
| constexpr C | ufo::operator* (C lhs, C const &rhs) |
| | Multiplies two colors component-wise.
|
| |
| template<Color C> |
| constexpr C | ufo::operator* (C lhs, float rhs) |
| | Multiplies a color by a scalar.
|
| |
| template<Color C> |
| constexpr C | ufo::operator* (float lhs, C rhs) |
| | Multiplies a scalar by a color.
|
| |
| template<Color C> |
| constexpr C & | ufo::operator/= (C &lhs, C const &rhs) |
| | Divides a color by another color component-wise.
|
| |
| template<Color C> |
| constexpr C & | ufo::operator/= (C &lhs, float rhs) |
| | Divides a color by a scalar.
|
| |
| template<Color C> |
| constexpr C | ufo::operator/ (C lhs, C const &rhs) |
| | Divides two colors component-wise.
|
| |
| template<Color C> |
| constexpr C | ufo::operator/ (C lhs, float rhs) |
| | Divides a color by a scalar.
|
| |
| template<Color C> |
| constexpr C | ufo::operator/ (float lhs, C rhs) |
| | Divides a scalar by a color.
|
| |
| template<Color C> |
| constexpr C | ufo::average (C a, C const &b) |
| | Computes the average of two colors.
|
| |
template<std::ranges::input_range R>
requires Color<std::ranges::range_value_t<R>> |
| constexpr std::ranges::range_value_t< R > | ufo::average (R &&r) |
| | Computes the average of a range of colors.
|
| |
template<std::input_iterator InputIt, std::sentinel_for< InputIt > Sentinel>
requires Color<std::iter_value_t<InputIt>> |
| constexpr std::iter_value_t< InputIt > | ufo::average (InputIt first, Sentinel last) |
| | Computes the average of a range of colors.
|
| |
| template<Color C> |
| constexpr C | ufo::average (std::initializer_list< C > il) |
| | Computes the average of an initializer list of colors.
|
| |
| template<Color C> |
| constexpr C | ufo::blend (C a, C const &b, float t) |
| | Blends two colors using a factor t.
|
| |
template<std::ranges::input_range R, std::ranges::input_range W>
requires Color<std::ranges::range_value_t<R>> && std::floating_point<std::ranges::range_value_t<W>> |
| constexpr std::ranges::range_value_t< R > | ufo::blend (R &&r, W &&w) |
| | Blends multiple colors using a range of weights.
|
| |
template<std::input_iterator InputIt1, std::sentinel_for< InputIt1 > Sentinel, std::input_iterator InputIt2>
requires Color<std::iter_value_t<InputIt1>> && std::floating_point<std::iter_value_t<InputIt2>> |
| constexpr std::iter_value_t< InputIt1 > | ufo::blend (InputIt1 first, Sentinel last, InputIt2 first_weight) |
| | Blends multiple colors using a range of weights.
|
| |
template<std::ranges::input_range R, std::floating_point T>
requires Color<std::ranges::range_value_t<R>> |
| constexpr std::ranges::range_value_t< R > | ufo::blend (R &&r, std::initializer_list< T > w) |
| | Blends multiple colors using an initializer list of weights.
|
| |
| template<Color C, std::floating_point T> |
| constexpr C | ufo::blend (std::initializer_list< C > r, std::initializer_list< T > w) |
| | Blends multiple colors using an initializer list of colors and weights.
|
| |
| template<Color To, Color From> |
| constexpr To | ufo::convert (From const &color) |
| | Convert a color from one type to another.
|
| |
template<typename T , ColorFlags F, Color From>
requires (std::floating_point<T> || std::integral<T>) |
| constexpr auto | ufo::convert (From const &color) |
| | Convert a color from one type to another.
|
| |
| template<Color From, Color To> |
| constexpr void | ufo::convert (From const &in, To &out) |
| | Convert a color from one type to another and assign to an output variable.
|
| |
| template<Color C, std::size_t N> |
| constexpr C | ufo::colorMap (std::array< C, N > const &map, float value, float min_value, float max_value) |
| | Maps a value to a color using a color map.
|
| |
| template<Color C> |
| constexpr weight_type_t< C > | ufo::weight (C color) noexcept |
| | Returns the weight of color, or 1 if color has no weight field.
|
| |
| template<Color C> |
| constexpr add_weight_t< C > | ufo::addWeight (C color, float w=1.0f) noexcept |
| | Returns a copy of color with a weight field set to w.
|
| |
| template<Color C> |
| constexpr remove_weight_t< C > | ufo::removeWeight (C color) noexcept |
| | Returns a copy of color with the weight field removed.
|
| |
All vision-related classes and functions.
Copyright (c) 2020-2026, Daniel Duberg All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.