Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
Offset.h File Reference

SVG offset parameters and precompiled shader projections. More...

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

Classes

struct  donner::gpu::shader::programs::PixelShiftSplit
 Whole-pixel base and constant blend weight of a pixel shift along one axis: output pixel x blends input pixels x - shift and x - shift + 1 by weight. The split is made once, in double precision, so every pixel of a translation uses the same weight wherever the raster sits. More...
struct  donner::gpu::shader::programs::OffsetParams
 Uniform layout for finite pixel shifts in the admitted [-4096, 4096] range, split per axis by SplitPixelShift. More...

Namespaces

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

Functions

PixelShiftSplit donner::gpu::shader::programs::SplitPixelShift (double pixels)
 Splits a finite pixel shift in the admitted [-4096, 4096] range.
OffsetParams donner::gpu::shader::programs::MakeOffsetParams (double dx, double dy)
 Builds the uniform for a shift of (dx, dy) pixels.
const CompiledShaderView & donner::gpu::shader::programs::OffsetShader ()
 Returns the authored WGSL offset shader and its reflected resource/compute interface. Source texels outside the input extent become transparent black. Invocations outside the destination extent do not write. Callers provide finite shifts in [-4096, 4096].
const CompiledShaderView & donner::gpu::shader::programs::OffsetNativeShader ()
 Returns only the platform's native MSL or SPIR-V projection and the reflected interface.

Detailed Description

SVG offset parameters and precompiled shader projections.

Function Documentation

◆ OffsetNativeShader()

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

Returns only the platform's native MSL or SPIR-V projection and the reflected interface.

Returns
Stable view into a process-lifetime artifact.

◆ OffsetShader()

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

Returns the authored WGSL offset shader and its reflected resource/compute interface. Source texels outside the input extent become transparent black. Invocations outside the destination extent do not write. Callers provide finite shifts in [-4096, 4096].

Returns
Stable view into a process-lifetime artifact.

◆ SplitPixelShift()

PixelShiftSplit donner::gpu::shader::programs::SplitPixelShift ( double pixels)
inline

Splits a finite pixel shift in the admitted [-4096, 4096] range.

Parameters
pixelsShift in pixels; positive moves content toward larger coordinates.