//
//  GSCompositingOperation.h
//  GlyphsCore
//
//  Created by Florian Pircher on 22.03.24.
//  Copyright © 2024 schriftgestaltung.de. All rights reserved.
//

#ifndef GSCompositingOperation_h
#define GSCompositingOperation_h

/// Compositing operation, documented with the OpenType, Core Graphics, and NSGraphics constants.
///
/// <https://www.w3.org/TR/compositing/>
typedef NSString * GSCompositingOperation NS_TYPED_ENUM;
/// `COMPOSITE_SRC_OVER`        `kCGBlendModeNormal`           `NSCompositingOperationSourceOver`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSourceOver;
/// `COMPOSITE_DEST_OVER`       `kCGBlendModeDestinationOver`  `NSCompositingOperationDestinationOver`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDestinationOver;
/// `COMPOSITE_SRC_IN`          `kCGBlendModeSourceIn`         `NSCompositingOperationSourceIn`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSourceIn;
/// `COMPOSITE_DEST_IN`         `kCGBlendModeDestinationIn`    `NSCompositingOperationDestinationIn`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDestinationIn;
/// `COMPOSITE_SRC_OUT`         `kCGBlendModeSourceOut`        `NSCompositingOperationSourceOut`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSourceOut;
/// `COMPOSITE_DEST_OUT`        `kCGBlendModeDestinationOut`   `NSCompositingOperationDestinationOut`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDestinationOut;
/// `COMPOSITE_SRC_ATOP`        `kCGBlendModeSourceAtop`       `NSCompositingOperationSourceAtop`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSourceAtop;
/// `COMPOSITE_DEST_ATOP`       `kCGBlendModeDestinationAtop`  `NSCompositingOperationDestinationAtop`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDestinationAtop;
/// `COMPOSITE_SRC`             `kCGBlendModeCopy`             `NSCompositingOperationCopy`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSource;
/// `COMPOSITE_DEST`             --                             --
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDestination;
/// `COMPOSITE_CLEAR`           `kCGBlendModeClear`            `NSCompositingOperationClear`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationClear;
/// `COMPOSITE_XOR`             `kCGBlendModeXOR`              `NSCompositingOperationXOR`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationXOR;
/// `COMPOSITE_PLUS`            `kCGBlendModePlusLighter`      `NSCompositingOperationPlusLighter`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationPlusLighter;
/// --                          `kCGBlendModePlusDarker`       `NSCompositingOperationPlusDarker`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationPlusDarker;
/// `COMPOSITE_MULTIPLY`        `kCGBlendModeMultiply`         `NSCompositingOperationMultiply`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationMultiply;
/// `COMPOSITE_SCREEN`          `kCGBlendModeScreen`           `NSCompositingOperationScreen`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationScreen;
/// `COMPOSITE_OVERLAY`         `kCGBlendModeOverlay`          `NSCompositingOperationOverlay`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationOverlay;
/// `COMPOSITE_DARKEN`          `kCGBlendModeDarken`           `NSCompositingOperationDarken`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDarken;
/// `COMPOSITE_LIGHTEN`         `kCGBlendModeLighten`          `NSCompositingOperationLighten`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationLighten;
/// `COMPOSITE_COLOR_DODGE`     `kCGBlendModeColorDodge`       `NSCompositingOperationColorDodge`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationColorDodge;
/// `COMPOSITE_COLOR_BURN`      `kCGBlendModeColorBurn`        `NSCompositingOperationColorBurn`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationColorBurn;
/// `COMPOSITE_HARD_LIGHT`      `kCGBlendModeHardLight`        `NSCompositingOperationHardLight`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationHardLight;
/// `COMPOSITE_SOFT_LIGHT`      `kCGBlendModeSoftLight`        `NSCompositingOperationSoftLight`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSoftLight;
/// `COMPOSITE_DIFFERENCE`      `kCGBlendModeDifference`       `NSCompositingOperationDifference`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationDifference;
/// `COMPOSITE_EXCLUSION`       `kCGBlendModeExclusion`        `NSCompositingOperationExclusion`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationExclusion;
/// `COMPOSITE_HSL_HUE`         `kCGBlendModeHue`              `NSCompositingOperationHue`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationHue;
/// `COMPOSITE_HSL_SATURATION`  `kCGBlendModeSaturation`       `NSCompositingOperationSaturation`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationSaturation;
/// `COMPOSITE_HSL_COLOR`       `kCGBlendModeColor`            `NSCompositingOperationColor`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationColor;
/// `COMPOSITE_HSL_LUMINOSITY`  `kCGBlendModeLuminosity`       `NSCompositingOperationLuminosity`
FOUNDATION_EXPORT GSCompositingOperation const GSCompositingOperationLuminosity;

/// Returns `-1` for values not supported by `CGBlendMode`.
int32_t CGBlendModeFromGSCompositingOperation(GSCompositingOperation op);

#ifndef GLYPHS_VIEWER
/// Returns `-1` for values not supported by `OTCompositeMode`.
int32_t OTCompositeModeFromGSCompositingOperation(GSCompositingOperation op);
#endif

#endif /* GSCompositingOperation_h */
