skia
    Preparing search index...

    Interface ShaderFactory

    For more information, see SkShaders.h.

    interface ShaderFactory {
        MakeBlend(mode: EmbindEnumEntity, one: Shader, two: Shader): Shader;
        MakeColor(color: InputColor, space: ColorSpace): Shader;
        MakeFractalNoise(
            baseFreqX: number,
            baseFreqY: number,
            octaves: number,
            seed: number,
            tileW: number,
            tileH: number,
        ): Shader;
        MakeLinearGradient(
            start: InputPoint,
            end: InputPoint,
            colors: InputFlexibleColorArray,
            pos: number[] | null,
            mode: EmbindEnumEntity,
            localMatrix?: InputMatrix,
            flags?: number,
            colorSpace?: ColorSpace,
        ): Shader;
        MakeRadialGradient(
            center: InputPoint,
            radius: number,
            colors: InputFlexibleColorArray,
            pos: number[] | null,
            mode: EmbindEnumEntity,
            localMatrix?: InputMatrix,
            flags?: number,
            colorSpace?: ColorSpace,
        ): Shader;
        MakeSweepGradient(
            cx: number,
            cy: number,
            colors: InputFlexibleColorArray,
            pos: number[] | null,
            mode: EmbindEnumEntity,
            localMatrix?: InputMatrix | null,
            flags?: number,
            startAngle?: number,
            endAngle?: number,
            colorSpace?: ColorSpace,
        ): Shader;
        MakeTurbulence(
            baseFreqX: number,
            baseFreqY: number,
            octaves: number,
            seed: number,
            tileW: number,
            tileH: number,
        ): Shader;
        MakeTwoPointConicalGradient(
            start: InputPoint,
            startRadius: number,
            end: InputPoint,
            endRadius: number,
            colors: InputFlexibleColorArray,
            pos: number[] | null,
            mode: EmbindEnumEntity,
            localMatrix?: InputMatrix,
            flags?: number,
            colorSpace?: ColorSpace,
        ): Shader;
    }
    Index

    Methods

    • Returns a shader with Perlin Fractal Noise. See SkPerlinNoiseShader.h for more details

      Parameters

      • baseFreqX: number

        base frequency in the X direction; range [0.0, 1.0]

      • baseFreqY: number

        base frequency in the Y direction; range [0.0, 1.0]

      • octaves: number
      • seed: number
      • tileW: number

        if this and tileH are non-zero, the frequencies will be modified so that the noise will be tileable for the given size.

      • tileH: number

        if this and tileW are non-zero, the frequencies will be modified so that the noise will be tileable for the given size.

      Returns Shader

    • Returns a shader that generates a linear gradient between the two specified points. See SkGradient.h for more.

      Parameters

      • start: InputPoint
      • end: InputPoint
      • colors: InputFlexibleColorArray

        colors to be distributed between start and end.

      • pos: number[] | null

        May be null. The relative positions of colors. If supplied must be same length as colors.

      • mode: EmbindEnumEntity
      • OptionallocalMatrix: InputMatrix
      • Optionalflags: number

        By default gradients will interpolate their colors in unpremul space and then premultiply each of the results. By setting this to 1, the gradients will premultiply their colors first, and then interpolate between them.

      • OptionalcolorSpace: ColorSpace

      Returns Shader

    • Returns a shader that generates a sweep gradient given a center. See SkGradient.h for more.

      Parameters

      • cx: number
      • cy: number
      • colors: InputFlexibleColorArray

        colors to be distributed around the center, within the provided angles.

      • pos: number[] | null

        May be null. The relative positions of colors. If supplied must be same length as colors. Range [0.0, 1.0]

      • mode: EmbindEnumEntity
      • OptionallocalMatrix: InputMatrix | null
      • Optionalflags: number

        0 to interpolate colors in unpremul, 1 to interpolate colors in premul.

      • OptionalstartAngle: number

        angle corresponding to 0.0. Defaults to 0 degrees.

      • OptionalendAngle: number

        angle corresponding to 1.0. Defaults to 360 degrees.

      • OptionalcolorSpace: ColorSpace

      Returns Shader

    • Returns a shader with Perlin Turbulence. See SkPerlinNoiseShader.h for more details

      Parameters

      • baseFreqX: number

        base frequency in the X direction; range [0.0, 1.0]

      • baseFreqY: number

        base frequency in the Y direction; range [0.0, 1.0]

      • octaves: number
      • seed: number
      • tileW: number

        if this and tileH are non-zero, the frequencies will be modified so that the noise will be tileable for the given size.

      • tileH: number

        if this and tileW are non-zero, the frequencies will be modified so that the noise will be tileable for the given size.

      Returns Shader