// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
namespace SixLabors.Fonts.Rendering {
///
/// Defines compositing and blending operations used when combining source and destination colors.
///
/// Values 0–12 correspond to standard Porter–Duff compositing modes. These determine how source and
/// destination alpha interact to produce transparency. The remaining values (13–27) correspond to
/// separable and non-separable blend modes used in modern graphics systems such as ImageSharp.
///
///
public enum CompositeMode
{
// --- Porter–Duff compositing modes ---
///
/// Clears both the source and destination.
/// The output is fully transparent regardless of the input colors.
///
Clear = 0,
///
/// Replaces the destination entirely with the source.
/// The destination pixels are ignored.
///
Src = 1,
///
/// Keeps the destination as-is and ignores the source.
/// Equivalent to no drawing operation.
///
Dest = 2,
///
/// Draws the source over the destination using standard alpha compositing.
/// The source appears on top and the destination shows through transparent areas.
///
SrcOver = 3,
///
/// Draws the destination over the source.
/// The destination appears on top and the source shows through transparent areas.
///
DestOver = 4,
///
/// Shows the source only where it overlaps the destination.
/// The destination’s alpha acts as a mask for the source.
///
SrcIn = 5,
///
/// Shows the destination only where it overlaps the source.
/// The source’s alpha acts as a mask for the destination.
///
DestIn = 6,
///
/// Shows the source only where it does not overlap the destination.
/// Produces the inverse of .
///
SrcOut = 7,
///
/// Shows the destination only where it does not overlap the source.
/// Produces the inverse of .
///
DestOut = 8,
///
/// Draws the source over the destination but only within the destination’s alpha region.
/// Outside that region, the destination remains unchanged.
///
SrcAtop = 9,
///
/// Draws the destination over the source but only within the source’s alpha region.
/// Outside that region, the source is visible.
///
DestAtop = 10,
///
/// Exclusive OR.
/// Shows the source and destination only where they do not overlap.
/// Overlapping regions become transparent.
///
Xor = 11,
///
/// Adds the source and destination color values.
/// Alpha is also added, producing a brightening effect.
///
Plus = 12,
// --- Separable and non-separable blend modes ---
///
/// Combines colors using an inverse multiply.
/// Formula: 1 − (1 − S) × (1 − D).
/// Produces a lighter result similar to photographic screen exposure.
///
Screen = 13,
///
/// Multiplies or screens colors depending on destination lightness.
/// Preserves highlights and shadows while mixing source and destination tones.
///
Overlay = 14,
///
/// Chooses the darker of source and destination values per color channel.
///
Darken = 15,
///
/// Chooses the lighter of source and destination values per color channel.
///
Lighten = 16,
///
/// Brightens the destination to reflect the source.
/// Formula: D / (1 − S).
///
ColorDodge = 17,
///
/// Darkens the destination to reflect the source.
/// Formula: 1 − (1 − D) / S.
///
ColorBurn = 18,
///
/// Applies overlay logic using the source’s lightness.
/// Used for strong highlight and shadow effects.
///
HardLight = 19,
///
/// Similar to , but with reduced contrast.
/// Produces a softer transition between tones.
///
SoftLight = 20,
///
/// Subtracts darker colors from lighter ones to highlight differences.
/// Often used for comparison or edge detection effects.
///
Difference = 21,
///
/// Similar to , but with reduced contrast.
/// Midtones are preserved, producing a lower-contrast difference.
///
Exclusion = 22,
///
/// Multiplies source and destination colors.
/// Always results in a darker composite.
///
Multiply = 23,
///
/// Combines the hue of the source with the saturation and luminosity of the destination.
///
Hue = 24,
///
/// Combines the saturation of the source with the hue and luminosity of the destination.
///
Saturation = 25,
///
/// Combines the hue and saturation of the source with the luminosity of the destination.
///
Color = 26,
///
/// Combines the luminosity of the source with the hue and saturation of the destination.
///
Luminosity = 27
}
}