Skip to main content

Module blend

Module blend 

Source
Expand description

PDF blend modes (PDF spec §11.3.5).

All separable modes operate per-channel with src and dst in [0, 255] and return a blended value in [0, 255]. For CMYK/DeviceN the caller inverts the channel values before calling (255 - v) and inverts again after — the subtractive complement trick used by the C++ splashOutBlend* functions.

Non-separable modes (Hue, Saturation, Color, Luminosity) operate on full RGB triples (always in additive space); CMYK callers convert first.

Functions§

apply_nonseparable_rgb
Apply a non-separable blend mode (Hue/Saturation/Color/Luminosity) to an RGB triple.
apply_separable
Apply a separable blend mode to each corresponding byte pair from src and dst.
blend_color_burn
Color burn: darken dst to reflect src.
blend_color_dodge
Color dodge: brighten dst to reflect src.
blend_color_rgb
Non-separable Color blend: hue and saturation of src, luminosity of dst.
blend_darken
Darken: min(src, dst).
blend_difference
Difference: |src - dst|.
blend_exclusion
Exclusion: src + dst - 2 × div255(src × dst).
blend_hard_light
Hard light: Overlay(dst, src) — the src/dst roles are swapped vs Overlay.
blend_hue_rgb
Non-separable Hue blend: hue of src, saturation and luminosity of dst.
blend_lighten
Lighten: max(src, dst).
blend_luminosity_rgb
Non-separable Luminosity blend: luminosity of src, hue and saturation of dst.
blend_multiply
Multiply: div255(src * dst).
blend_normal
Normal: result is the source (Porter-Duff over handled in the pipe, not here).
blend_overlay
Overlay: hard-light of dst over src.
blend_saturation_rgb
Non-separable Saturation blend: saturation of src, hue and luminosity of dst.
blend_screen
Screen: src + dst - div255(src * dst).
blend_soft_light
Soft light (PDF spec §11.3.5.3).