Skip to main content

Module color

Module color 

Source
Expand description

Full re-export of zenpixels core types (zero module name collisions!). Algebraic color-space model, image specification, provenance, and gain-map metadata.

ColorSpace is an algebraic enum so mutually exclusive states — such as Oklab carrying BT.709 primaries, CMYK carrying a PQ transfer curve, or an authoritative ICC profile paired with conflicting primaries — are unrepresentable by construction.

Modules§

formats
Built-in 'static PixelFormat preset instances for zero-allocation borrowed views.

Structs§

Chromaticity
Validated CIE 1931 (x, y) chromaticity coordinate with bit-exact equality & hashing.
Color
Single-pixel color value used for explicit alpha matting and fills.
ColorOrigin
Immutable provenance of what the original file claimed on disk.
CustomPrimaries
Validated custom tristimulus RGB primaries + white point (ICC cicpType amendment, JXL, OpenEXR, PNG cHRM, HAGC Mode 3 / SMPTE ST 2094-50).
GainMapComponent
Per-channel ISO 21496-1 gain-map parameters in exact rational form.
GainMapMetadata
ISO 21496-1 / UltraHDR gain-map reconstruction parameters in exact rational form.
Gamma
Validated pure power decoding gamma (L = v^gamma, OETF v^(1/gamma)).
HdrMetadata
Descriptive HDR container metadata (CLL / ST 2086 mastering display).
PixelFormat
Complete, validated description of an interleaved pixel: physical SampleLayout + algebraic ColorSpace.
SignedFraction
Exact unreduced signed rational (i32 / NonZeroU32) per ISO 21496-1 wire format.
UnsignedFraction
Exact unreduced unsigned rational (u32 / NonZeroU32) per ISO 21496-1 wire format.

Enums§

AlphaMode
Interpretation of an image’s alpha (or padding) channel.
ColorError
Validation errors for PixelFormat and ColorSpace.
ColorSpace
Authoritative color meaning of pixel samples — an algebraic enum with zero contradictory or impossible combinations.
FormatCow
Borrowed-or-owned PixelFormat carried inside PixelView<'a> and PixelViewMut<'a>.
GainMapChannels
Metadata record arity per ISO 21496-1 §5.2.5.1 — strictly independent of gain-map image channels (1 or 3).
GainMapColorSpace
Which rendition’s linear RGB primaries host channelwise gain application (ISO 21496-1 use_base_colour_space).
GainMapDirection
Rendition headroom ordering derived from exact rational comparison of base_hdr_headroom vs alternate_hdr_headroom.
HlgMode
Interpretation of an HLG signal: bare scene-referred vs explicit BT.2100-3 display rendering.
IccColorSpace
High-level data color space recorded in an ICC profile header (bytes 16..20).
IccValidationError
Structural validation error for raw ICC profile bytes (ISO 15076-1 / ICC.1).
OriginKind
How the original file signaled its color space.
PerceptualSpace
Perceptual / cylindrical color spaces beyond Oklab.
Primaries
Standardized 1-byte Copy + const chromaticity primaries (and reference white point) for tristimulus RGB color spaces.
RenderingIntent
ICC rendering intent.
SignalRange
Signal quantization range for integer samples.
Transfer
Electro-optical transfer function (non-linear curve between stored values and light).
WhitePoint
Reference white point for XYZ, Gray, or custom-primary RGB spaces.

Functions§

bradford_adapt_f64
Bradford chromatic adaptation matrix from source_white (x, y) to destination_white (x, y).
validate_icc_structure
Validate an ICC profile’s structural framing per ISO 15076-1 / ICC.1: