import type { FnN2 } from "@thi.ng/api"; import type { BlendFnF, BlendFnI, Color, ReadonlyColor } from "./api.js"; export declare const ZERO: FnN2; export declare const ONE: FnN2; export declare const A: FnN2; export declare const B: FnN2; export declare const ONE_MINUS_A: FnN2; export declare const ONE_MINUS_B: FnN2; /** * General Porter-Duff HOF operator for **pre-multiplied** RGBA. Use * {@link porterDuffP} for applying pre & post multiplication of input and * output colors. The returned function takes 3 arguments: * * - `out` color (if `null` or `undefined` writes to `dest`) * - `src` color (background) * - `dest` color (foreground) * * Unlike the packed int version, here only the alpha channel of the result * color will be clamped. RGB components can potentially go out of `[0,1]` range * (depending on coefficient functions used). * * Reference: https://keithp.com/~keithp/porterduff/p253-porter.pdf * * @param fa - fn for src coeff * @param fb - fn for dest coeff */ export declare const porterDuff: (fa: FnN2, fb: FnN2) => BlendFnF; export declare const porterDuffInt: (fa: FnN2, fb: FnN2) => BlendFnI; /** * Higher order function. Takes existing PD operator and returns * function which accepts same args as the operator, but pre-multiplies * alpha for both input colors and then returns post-multiplied alpha * output. * * @param mode - */ export declare const porterDuffP: (mode: BlendFnF) => BlendFnF; /** * Like {@link porterDuffP}, but for packed integers. * * @param mode - */ export declare const porterDuffPInt: (mode: BlendFnI) => BlendFnI; /** * Porter-Duff operator. None of the terms are used. Always results in * `[0,0,0,0]`. * * {@link porterDuff} * * @param out - * @param src - * @param dest - */ export declare const CLEAR_F: (out: Color, _: ReadonlyColor, dest: ReadonlyColor) => Color; /** * Porter-Duff operator. Always results in `src` color, `dest` ignored. * * {@link porterDuff} */ export declare const SRC_F: BlendFnF; /** * Porter-Duff operator. Always results in `dest` color, `src` ignored. * * {@link porterDuff} */ export declare const DEST_F: BlendFnF; /** * Porter-Duff operator. The source color is placed over the destination * color. * * {@link porterDuff} */ export declare const SRC_OVER_F: BlendFnF; /** * Porter-Duff operator. The destination color is placed over the source * color. * * {@link porterDuff} */ export declare const DEST_OVER_F: BlendFnF; /** * Porter-Duff operator. The source that overlaps the destination, * replaces the destination. * * {@link porterDuff} */ export declare const SRC_IN_F: BlendFnF; /** * Porter-Duff operator. The destination that overlaps the source, * replaces the source. * * {@link porterDuff} */ export declare const DEST_IN_F: BlendFnF; /** * Porter-Duff operator. The source that does not overlap the * destination replaces the destination. * * {@link porterDuff} */ export declare const SRC_OUT_F: BlendFnF; /** * Porter-Duff operator. The destination that does not overlap the * source replaces the source. * * {@link porterDuff} */ export declare const DEST_OUT_F: BlendFnF; /** * Porter-Duff operator. The source that overlaps the destination is * composited with the destination. * * {@link porterDuff} */ export declare const SRC_ATOP_F: BlendFnF; /** * Porter-Duff operator. The destination that overlaps the source is * composited with the source and replaces the destination. * * {@link porterDuff} */ export declare const DEST_ATOP_F: BlendFnF; /** * Porter-Duff operator. The non-overlapping regions of source and * destination are combined. * * {@link porterDuff} */ export declare const XOR_F: BlendFnF; /** * Porter-Duff operator. Source & destination regions are added. */ export declare const PLUS_F: BlendFnF; export declare const CLEAR_I: FnN2; /** * Porter-Duff operator for packed ints. Always results in `src` color, `dest` ignored. * * {@link porterDuff} */ export declare const SRC_I: FnN2; /** * Porter-Duff operator for packed ints. Always results in `dest` color, `src` ignored. * * {@link porterDuff} */ export declare const DEST_I: FnN2; /** * Porter-Duff operator for packed ints. The source color is placed over the destination * color. * * {@link porterDuff} */ export declare const SRC_OVER_I: FnN2; /** * Porter-Duff operator for packed ints. The destination color is placed over the source * color. * * {@link porterDuff} */ export declare const DEST_OVER_I: FnN2; /** * Porter-Duff operator for packed ints. The source that overlaps the destination, * replaces the destination. * * {@link porterDuff} */ export declare const SRC_IN_I: FnN2; /** * Porter-Duff operator for packed ints. The destination that overlaps the source, * replaces the source. * * {@link porterDuff} */ export declare const DEST_IN_I: FnN2; /** * Porter-Duff operator for packed ints. The source that does not overlap the * destination replaces the destination. * * {@link porterDuff} */ export declare const SRC_OUT_I: FnN2; /** * Porter-Duff operator for packed ints. The destination that does not overlap the * source replaces the source. * * {@link porterDuff} */ export declare const DEST_OUT_I: FnN2; /** * Porter-Duff operator for packed ints. The source that overlaps the destination is * composited with the destination. * * {@link porterDuff} */ export declare const SRC_ATOP_I: FnN2; /** * Porter-Duff operator for packed ints. The destination that overlaps the source is * composited with the source and replaces the destination. * * {@link porterDuff} */ export declare const DEST_ATOP_I: FnN2; /** * Porter-Duff operator for packed ints. The non-overlapping regions of source and * destination are combined. * * {@link porterDuff} */ export declare const XOR_I: FnN2; /** * Porter-Duff operator for packed ints. Source & destination regions * are added. */ export declare const PLUS_I: FnN2; /** * Porter-Duff darken modifier. Multiplies RGB components of `src` with * `t`. Alpha remains unchanged. Writes results to `out`, or if `null` * modifies `src` in-place. * * @param out - * @param src - * @param t - */ export declare const darken: (out: Color | null, src: ReadonlyColor, t: number) => Color; /** * Porter-Duff dissolve modifier. Multiplies all components of `src` with `t`. * Clamps alpha to `[0,1]` range, RGB unclamped. Writes results to `out`, or if * `null` modifies `src` in-place. * * @param out - * @param src - * @param t - */ export declare const dissolve: (out: Color | null, src: ReadonlyColor, t: number) => Color; /** * Porter-Duff opacity modifier. Multiplies alpha component of `src` with `t`, * clamped to `[0,1]` range. Writes results to `out`, or if `null` modifies * `src` in-place. * * @param out - * @param src - * @param t - */ export declare const opacity: (out: Color | null, src: ReadonlyColor, t: number) => Color; /** * Porter-Duff darken modifier for packed ints. Multiplies RGB components of * `src` with `t` (`[0,1]` range). * * @param src - * @param t - */ export declare const darkenInt: FnN2; /** * Porter-Duff dissolve modifier for packed ints. Multiplies all * components of `src` with `t` (`[0,1]` range). * * @param src - * @param t - */ export declare const dissolveInt: FnN2; /** * Porter-Duff opacity modifier for packed ints. Multiplies alpha component of * `src` with `t` (`[0,1]` range). * * @param src - * @param t - */ export declare const opacityInt: FnN2; //# sourceMappingURL=porter-duff.d.ts.map