Skip to main content

Module correction

Module correction 

Source
Expand description

Correction layers (色調補正レイヤー): Layer.FilterLayerInfo holds u32 type, u32 size and the settings; CSP stores no pixels and applies the correction to the image below the layer when it draws.

Big endian. Types and payloads:

1 brightness/contrast   i32 brightness, contrast (-100..100)
2 levels                32 slots × u16 [input black, gamma point, input
                        white, output black, output white] (0..0xffff);
                        slot 0 is the master, 1..3 red, green, blue
3 tone curve            32 slots × (u16 count, 32 × (u16 x, u16 y))
4 hue/saturation/value  i32 hue (degrees), saturation, value (-100..100)
5 colour balance        i32 preserve luminosity, then shadows, midtones
                        and highlights as i32 R, G, B (-100..100)
6 invert                (nothing)
7 posterize             i32 levels
8 threshold             i32 threshold
9 gradient map          a GradationData (see crate::gradient)

The rules were measured against CSP exports of generated test files (docs/validation/V6b-generated-layers.md). Colour balance without “preserve luminosity” is an empirical fit (within 3 levels at every tested setting); with it, it is exact per channel (within 1). Correction::is_approximate says when a setting falls outside what was measured closely.

Structs§

Filter
A Correction ready to apply: per-channel tables where the correction is one, otherwise the per-pixel rule.

Enums§

Correction
The settings of a correction layer, by type.