Skip to main content

Accelerators

Struct Accelerators 

Source
pub struct Accelerators { /* private fields */ }
Expand description

Dead-stripping bundle of optional SIMD accelerators.

Build a custom subset at compile time using const helpers (SCALAR, LAYOUT, WEB_SDR, WEB_HDR, HDR, OKLAB, GAINMAP, ROW_PIPELINE, ALL, .with_*(), .merge_prefer_self()).

§Bundle Composition

ConstantByte layoutStrip SIMDsRGB + 3×3 + srgb8 matrixBT.709 / γ2.2F16 + PQ/HLGOklabGainMap
SCALAR———————
LAYOUT✓——————
WEB_SDR✓✓✓————
WEB_HDR✓✓✓pow only*✓ (if feature)—✓ (if feature)
HDR—✓gamut 3×3 only—✓——
OKLAB—✓———✓—
GAINMAP———pow only——✓
ROW_PIPELINE (default w/ fast)✓✓✓✓✓✓ (if feature)—
ALL✓✓✓✓✓✓ (if feature)✓ (if feature)

Implementations§

Source§

impl Accelerators

Source

pub const SCALAR: Self

Pure scalar baseline — zero SIMD code linked, exact parity oracle.

Source

pub const LAYOUT: Self

Byte-only layout swizzles (garb U8 layouts).

Source

pub const WEB_SDR: Self

Common web SDR workload: byte layouts + SIMD strip codec + sRGB + 3×3 gamut + fused U8 P3/sRGB matrix.

Links zero BT.709, Gamma 2.2, F16, PQ, HLG, gain-map, or Oklab SIMD code.

Source

pub const HDR: Self

HDR & half-float workload: SIMD strip codec + F16C/NEON-fp16 + PQ/HLG + 3×3 gamut.

Links zero gain-map SIMD code; chain .with_gainmap() (requires the gainmap feature) when reconstructing ISO 21496-1 / UltraHDR gain maps, or use WEB_HDR.

Source

pub const WEB_HDR: Self

Modern web HDR workload (AVIF, JXL, UltraHDR, WebP/PNG/JPEG): WEB_SDR + HDR + GAINMAP (when feature = "gainmap" is enabled).

Accelerates byte layouts, SIMD strip codecs, sRGB, 3×3 gamut, fused U8 P3/sRGB matrix, hardware F16C/NEON-fp16, PQ/HLG SIMD (when hdr-transfers is enabled), and ISO 21496-1 / UltraHDR gain maps (when gainmap is enabled). Dead-strips BT.709, Gamma 2.2, and Oklab.

Source

pub const GAINMAP: Self

ISO 21496-1 / UltraHDR gain-map SIMD kernels only (opt-in so RowPlan-only binaries dead-strip them).

Included in WEB_HDR and ALL, excluded from ROW_PIPELINE and Accelerators::default(). Combine with Self::WEB_SDR.merge_prefer_self(Self::GAINMAP) when minimizing binary size.

Source

pub const OKLAB: Self

Oklab perceptual SIMD + strip codec.

Source

pub const ROW_PIPELINE: Self

Every enabled RowPlan / ImagePlan SIMD accelerator in this build (excludes opt-in gain-map SIMD so non-gainmap binaries dead-strip it completely; this is also Accelerators::default() when feature = "fast" is enabled).

Source

pub const ALL: Self

Every compiled SIMD accelerator in this build, including GAINMAP when the gainmap feature is enabled.

For RowPlan-only binaries that want to dead-strip gain-map SIMD (+0 B), use ROW_PIPELINE instead.

Source

pub fn install_global(self) -> bool

Install this bundle process-wide. Returns whether this call installed it.

The first call wins. Later calls leave the installed bundle in place.

Source

pub const fn has_byte_layout(&self) -> bool

Whether garb SIMD byte-layout fast paths are enabled.

Source

pub const fn has_strip_simd(&self) -> bool

Whether native-width SIMD strip unpack/pack and depth codecs are enabled.

Source

pub const fn with_byte_layout(self) -> Self

Enable garb byte-only layout fast paths & SIMD U8 premultiplication.

Source

pub const fn with_strip_simd(self) -> Self

Enable native-width SIMD AoS↔SoA strip unpack/pack and contiguous depth codecs.

Source

pub const fn with_srgb(self) -> Self

Enable SIMD sRGB EOTF & OETF (linear-srgb) + fused linear F32 → sRGB U8.

Source

pub const fn with_bt709(self) -> Self

Enable SIMD BT.709 EOTF & OETF (magemath::Powf).

Source

pub const fn with_gamma22(self) -> Self

Enable SIMD Gamma 2.2 (2.2), Adobe RGB (563/256), and DCI Cinema (2.6) EOTF & OETF (magemath::Powf).

Source

pub const fn with_gamut_3x3(self) -> Self

Enable SIMD 3×3 linear gamut matrix multiply.

Source

pub const fn with_gainmap(self) -> Self

Enable ISO 21496-1 / UltraHDR gain-map SIMD kernels (vertical resampling blend, magemath::Expf gain decode, and linear RGB(A) multiply-add combine).

Kept opt-in (excluded from ROW_PIPELINE and HDR, included in WEB_HDR and ALL) so non-gainmap RowPlan binaries dead-strip gain-map SIMD completely (+0 B).

Source

pub const fn with_f16(self) -> Self

Enable hardware f16 ↔ f32 slice conversion (F16C / NEON-fp16).

Source

pub const fn with_oklab(self) -> Self

Enable SIMD Oklab conversions (magemath::Cbrtf) & SoftCompress.

Source

pub const fn with_hdr_simd(self) -> Self

Enable SIMD PQ, HLG Scene, and BT.2100-3 HLG display rendering.

Source

pub const fn merge_prefer_self(self, fallback: Self) -> Self

Combine two accelerator bundles (self takes precedence where both enable the same slot).

Trait Implementations§

Source§

impl Clone for Accelerators

Source§

fn clone(&self) -> Accelerators

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Accelerators

Source§

impl Debug for Accelerators

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Accelerators

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Accelerators

Source§

impl PartialEq for Accelerators

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.