Interface IBlend<T, F>

interface IBlend<T, F> {
    blend(op, dest, opts?): void;
    isPremultiplied(): boolean;
    postmultiply(): this;
    premultiply(): this;
}

Type Parameters

Implemented by

Methods

  • Uses given op function to blend / composite pixels of this buffer with those of dest and writes results into dest. Supports same options as blit().

    Parameters

    Returns void

  • Returns true if all pixels in the buffer are likely to be already using pre-multiplied alpha, i.e. if all channel values of a pixel are less than or equal to that pixel's alpha value.

    Returns boolean

  • Postmultiplies alpha of all pixels (requires a pixel format with alpha channel).

    Returns this

    Remarks

    Usually called after the final compositing/blending step. See IBlend.premultiply for reverse operation.

  • Premultiplies alpha of all pixels (requires a pixel format with alpha channel).

    Returns this

    Remarks

    Usually called before starting a compositing/blending process. See IBlend.postmultiply for reverse operation.

Generated using TypeDoc