skia
    Preparing search index...

    Interface ImageFilterFactory

    See //include/effects/SkImageFilters.h for more.

    interface ImageFilterFactory {
        MakeBlend(
            blend: EmbindEnumEntity,
            background: ImageFilter | null,
            foreground: ImageFilter | null,
        ): ImageFilter;
        MakeBlur(
            sigmaX: number,
            sigmaY: number,
            mode: EmbindEnumEntity,
            input: ImageFilter | null,
        ): ImageFilter;
        MakeColorFilter(cf: ColorFilter, input: ImageFilter | null): ImageFilter;
        MakeCompose(
            outer: ImageFilter | null,
            inner: ImageFilter | null,
        ): ImageFilter;
        MakeDilate(
            radiusX: number,
            radiusY: number,
            input: ImageFilter | null,
        ): ImageFilter;
        MakeDisplacementMap(
            xChannel: EmbindEnumEntity,
            yChannel: EmbindEnumEntity,
            scale: number,
            displacement: ImageFilter | null,
            color: ImageFilter | null,
        ): ImageFilter;
        MakeDropShadow(
            dx: number,
            dy: number,
            sigmaX: number,
            sigmaY: number,
            color: Color,
            input: ImageFilter | null,
        ): ImageFilter;
        MakeDropShadowOnly(
            dx: number,
            dy: number,
            sigmaX: number,
            sigmaY: number,
            color: Color,
            input: ImageFilter | null,
        ): ImageFilter;
        MakeErode(
            radiusX: number,
            radiusY: number,
            input: ImageFilter | null,
        ): ImageFilter;
        MakeImage(
            img: Image,
            sampling: CubicResampler | FilterOptions,
        ): ImageFilter | null;
        MakeImage(
            img: Image,
            sampling: CubicResampler | FilterOptions,
            srcRect: InputRect,
            dstRect: InputRect,
        ): ImageFilter | null;
        MakeMatrixTransform(
            matr: InputMatrix,
            sampling: CubicResampler | FilterOptions,
            input: ImageFilter | null,
        ): ImageFilter;
        MakeOffset(dx: number, dy: number, input: ImageFilter | null): ImageFilter;
        MakeShader(shader: Shader): ImageFilter;
    }
    Index

    Methods

    • Create a filter that takes a BlendMode and uses it to composite the two filters together.

      At least one of background and foreground should be non-null in nearly all circumstances.

      Parameters

      • blend: EmbindEnumEntity

        The blend mode that defines the compositing operation

      • background: ImageFilter | null

        The Dst pixels used in blending; if null, use the dynamic source image (e.g. a saved layer).

      • foreground: ImageFilter | null

        The Src pixels used in blending; if null, use the dynamic source image.

      Returns ImageFilter

    • Create a filter that blurs its input by the separate X and Y sigmas. The provided tile mode is used when the blur kernel goes outside the input image.

      Parameters

      • sigmaX: number

        The Gaussian sigma value for blurring along the X axis.

      • sigmaY: number

        The Gaussian sigma value for blurring along the Y axis.

      • mode: EmbindEnumEntity
      • input: ImageFilter | null

        if null, it will use the dynamic source image (e.g. a saved layer)

      Returns ImageFilter

    • Create a filter that composes 'inner' with 'outer', such that the results of 'inner' are treated as the source bitmap passed to 'outer'. If either param is null, the other param will be returned.

      Parameters

      • outer: ImageFilter | null
      • inner: ImageFilter | null

        if null, it will use the dynamic source image (e.g. a saved layer)

      Returns ImageFilter

    • Create a filter that dilates each input pixel's channel values to the max value within the given radii along the x and y axes.

      Parameters

      • radiusX: number

        The distance to dilate along the x axis to either side of each pixel.

      • radiusY: number

        The distance to dilate along the y axis to either side of each pixel.

      • input: ImageFilter | null

        if null, it will use the dynamic source image (e.g. a saved layer).

      Returns ImageFilter

    • Create a filter that moves each pixel in its color input based on an (x,y) vector encoded in its displacement input filter. Two color components of the displacement image are mapped into a vector as scale * (color[xChannel], color[yChannel]), where the channel selectors are one of R, G, B, or A. The mapping takes the 0-255 RGBA values of the image and scales them to be [-0.5 to 0.5], in a similar fashion to https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feDisplacementMap

      At least one of displacement and color should be non-null in nearly all circumstances.

      Parameters

      • xChannel: EmbindEnumEntity

        RGBA channel that encodes the x displacement per pixel.

      • yChannel: EmbindEnumEntity

        RGBA channel that encodes the y displacement per pixel.

      • scale: number

        Scale applied to displacement extracted from image.

      • displacement: ImageFilter | null

        The filter defining the displacement image, or null to use source.

      • color: ImageFilter | null

        The filter providing the color pixels to be displaced, or null to use source.

      Returns ImageFilter

    • Create a filter that draws a drop shadow under the input content. This filter produces an image that includes the inputs' content.

      Parameters

      • dx: number

        The X offset of the shadow.

      • dy: number

        The Y offset of the shadow.

      • sigmaX: number

        The blur radius for the shadow, along the X axis.

      • sigmaY: number

        The blur radius for the shadow, along the Y axis.

      • color: Color

        The color of the drop shadow.

      • input: ImageFilter | null

        The input filter; if null, it will use the dynamic source image.

      Returns ImageFilter

    • Just like MakeDropShadow, except the input content is not in the resulting image.

      Parameters

      • dx: number

        The X offset of the shadow.

      • dy: number

        The Y offset of the shadow.

      • sigmaX: number

        The blur radius for the shadow, along the X axis.

      • sigmaY: number

        The blur radius for the shadow, along the Y axis.

      • color: Color

        The color of the drop shadow.

      • input: ImageFilter | null

        The input filter; if null, it will use the dynamic source image.

      Returns ImageFilter

    • Create a filter that erodes each input pixel's channel values to the minimum channel value within the given radii along the x and y axes.

      Parameters

      • radiusX: number

        The distance to erode along the x axis to either side of each pixel.

      • radiusY: number

        The distance to erode along the y axis to either side of each pixel.

      • input: ImageFilter | null

        if null, it will use the dynamic source image (e.g. a saved layer).

      Returns ImageFilter

    • Create a filter that offsets the input filter by the given vector.

      Parameters

      • dx: number

        The x offset in local space that the image is shifted.

      • dy: number

        The y offset in local space that the image is shifted.

      • input: ImageFilter | null

        The input that will be moved, if null, will use the dynamic source image.

      Returns ImageFilter