react-native-image-filter-kit
Version:
Various image filters for iOS & Android
58 lines • 3.9 kB
JavaScript
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
t[p[i]] = s[p[i]];
return t;
};
const asNativeBlendConfig = (name) => (_a) => {
var { dstImage, srcImage, dstResizeMode, srcResizeMode, dstAnchor, srcAnchor, dstPosition, srcPosition } = _a, config = __rest(_a, ["dstImage", "srcImage", "dstResizeMode", "srcResizeMode", "dstAnchor", "srcAnchor", "dstPosition", "srcPosition"]);
return (Object.assign({ inputImage: srcImage, inputImageResizeMode: srcResizeMode, inputImageAnchor: srcAnchor, inputImagePosition: srcPosition, inputBackgroundImage: dstImage, inputBackgroundImageResizeMode: dstResizeMode, inputBackgroundImageAnchor: dstAnchor, inputBackgroundImagePosition: dstPosition }, config, { name }));
};
const asNativeBlendColorConfig = (name) => (_a) => {
var { srcColor, dstImage, disableIntermediateCaches = true } = _a, config = __rest(_a, ["srcColor", "dstImage", "disableIntermediateCaches"]);
return (Object.assign({}, config, { name, inputImage: {
name: 'CIConstantColorGenerator',
inputColor: srcColor,
disableCache: disableIntermediateCaches
}, resizeCanvasTo: 'dstImage', inputBackgroundImage: dstImage }));
};
export const shapeTransforms = {
PlusBlend: asNativeBlendConfig('CIAdditionCompositing'),
DarkenBlend: asNativeBlendConfig('CIDarkenBlendMode'),
LightenBlend: asNativeBlendConfig('CILightenBlendMode'),
OverlayBlend: asNativeBlendConfig('CIOverlayBlendMode'),
ScreenBlend: asNativeBlendConfig('CIScreenBlendMode'),
ModulateBlend: asNativeBlendConfig('CIMultiplyCompositing'),
MultiplyBlend: asNativeBlendConfig('CIMultiplyBlendMode'),
ColorDodgeBlend: asNativeBlendConfig('CIColorDodgeBlendMode'),
ExclusionBlend: asNativeBlendConfig('CIExclusionBlendMode'),
ColorBurnBlend: asNativeBlendConfig('CIColorBurnBlendMode'),
SoftLightBlend: asNativeBlendConfig('CISoftLightBlendMode'),
HueBlend: asNativeBlendConfig('CIHueBlendMode'),
ColorBlend: asNativeBlendConfig('CIColorBlendMode'),
HardLightBlend: asNativeBlendConfig('CIHardLightBlendMode'),
DifferenceBlend: asNativeBlendConfig('CIDifferenceBlendMode'),
SaturationBlend: asNativeBlendConfig('CISaturationBlendMode'),
LuminosityBlend: asNativeBlendConfig('CILuminosityBlendMode'),
PlusBlendColor: asNativeBlendColorConfig('CIAdditionCompositing'),
DarkenBlendColor: asNativeBlendColorConfig('CIDarkenBlendMode'),
LightenBlendColor: asNativeBlendColorConfig('CILightenBlendMode'),
ModulateBlendColor: asNativeBlendColorConfig('CIMultiplyCompositing'),
MultiplyBlendColor: asNativeBlendColorConfig('CIMultiplyBlendMode'),
OverlayBlendColor: asNativeBlendColorConfig('CIOverlayBlendMode'),
ScreenBlendColor: asNativeBlendColorConfig('CIScreenBlendMode'),
ColorDodgeBlendColor: asNativeBlendColorConfig('CIColorDodgeBlendMode'),
ExclusionBlendColor: asNativeBlendColorConfig('CIExclusionBlendMode'),
ColorBurnBlendColor: asNativeBlendColorConfig('CIColorBurnBlendMode'),
SoftLightBlendColor: asNativeBlendColorConfig('CISoftLightBlendMode'),
HueBlendColor: asNativeBlendColorConfig('CIHueBlendMode'),
ColorBlendColor: asNativeBlendColorConfig('CIColorBlendMode'),
SaturationBlendColor: asNativeBlendColorConfig('CISaturationBlendMode'),
LuminosityBlendColor: asNativeBlendColorConfig('CILuminosityBlendMode'),
DifferenceBlendColor: asNativeBlendColorConfig('CIDifferenceBlendMode'),
HardLightBlendColor: asNativeBlendColorConfig('CIHardLightBlendMode')
};
//# sourceMappingURL=shape-transforms.ios.js.map