Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
ColorSpaceConvert.h File Reference

Color-space conversion parameters, transfer table and precompiled shader projections. More...

#include <array>
#include <cmath>
#include <cstdint>
#include "donner/gpu/shader/CompiledShader.h"
Include dependency graph for ColorSpaceConvert.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::gpu::shader::programs::ColorSpaceConvertParams
 Uniform direction selector. More...
struct  donner::gpu::shader::programs::ColorTransferTable
 Read-only storage layout of the shared transfer table. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

const std::array< float, 2 *kColorTransferSampleCount > & donner::gpu::shader::programs::ColorTransferSamples ()
 Returns the process-lifetime transfer samples in the shader's table order.
const CompiledShaderView & donner::gpu::shader::programs::ColorSpaceConvertShader ()
 Returns the WGSL color-space artifact: straight-alpha channels pass through the selected half of the transfer table.
const CompiledShaderView & donner::gpu::shader::programs::ColorSpaceConvertNativeShader ()
 Returns only the platform-native ColorSpaceConvert projection.

Variables

constexpr uint32_t donner::gpu::shader::programs::kColorSpaceConvertSrgbToLinear = 0
 Direction value converting sRGB input to linear output.
constexpr uint32_t donner::gpu::shader::programs::kColorSpaceConvertLinearToSrgb = 1
 Direction value converting linear input to sRGB output.
constexpr uint32_t donner::gpu::shader::programs::kColorTransferSampleCount = 4096
 Samples per transfer direction; the table holds the forward then the inverse curve.

Detailed Description

Color-space conversion parameters, transfer table and precompiled shader projections.

Function Documentation

◆ ColorSpaceConvertNativeShader()

const CompiledShaderView & donner::gpu::shader::programs::ColorSpaceConvertNativeShader ( )

Returns only the platform-native ColorSpaceConvert projection.

Returns
Stable view into process-lifetime data.

◆ ColorSpaceConvertShader()

const CompiledShaderView & donner::gpu::shader::programs::ColorSpaceConvertShader ( )

Returns the WGSL color-space artifact: straight-alpha channels pass through the selected half of the transfer table.

Returns
Stable view into process-lifetime data.

◆ ColorTransferSamples()

const std::array< float, 2 *kColorTransferSampleCount > & donner::gpu::shader::programs::ColorTransferSamples ( )
inline

Returns the process-lifetime transfer samples in the shader's table order.

Returns
Stable reference to the shared table contents.