meo-skia-canvas
    Preparing search index...

    Class MaskFilter

    Coverage-mask filter (styled Gaussian blur). Unlike an ImageFilter blur, the BlurStyle controls how the blur relates to the geometry: glow, halo, inner shadow, feathered fill. Set on a context via ctx.maskFilter. Mirrors CanvasKit's MaskFilter.

    🧪 Not in the HTML Canvas standard.

    Index
    • Create a coverage-mask blur.

      A blur is the only kind of mask filter Skia offers, so the first argument is the blur style rather than a kind. Where MaskFilter.MakeBlur returns null for a sigma Skia rejects, this throws instead.

      ctx.maskFilter = new MaskFilter("outer", 6)
      

      Parameters

      • style: "normal" | "solid" | "outer" | "inner"

        "normal" (both sides), "solid" (glow keeping the shape), "outer" (halo only), "inner" (inner shadow only)

      • sigma: number

        blur standard deviation in pixels, greater than 0

      • OptionalrespectCTM: boolean

        scale the blur with the canvas transform (default true); pass false to keep it screen-fixed

      Returns MaskFilter

      TypeError if the arguments describe no filter

    • Mark filter as deleted. Use-after-delete throws Error.

      Returns void

    • Gaussian coverage blur.

      Parameters

      • style: "normal" | "solid" | "outer" | "inner"

        "normal" (both sides), "solid" (glow keeping the shape), "outer" (halo only), "inner" (inner shadow only)

      • sigma: number

        blur standard deviation in pixels

      • OptionalrespectCTM: boolean

        scale the blur with the canvas transform (default true); pass false to keep it screen-fixed

      Returns MaskFilter | null