Class Pixelate

Pixelate filter class

Example

const filter = new Pixelate({
blocksize: 8
});
object.filters.push(filter);
object.applyFilters();

Hierarchy

Constructors

Properties

blocksize: number
mainParameter?: keyof Pixelate

Name of the parameter that can be changed in the filter. Some filters have more than one parameter and there is no mainParameter

vertexSource: string = vertexSource

Array of attributes to send with buffers. do not modify

defaults: Partial<TClassProperties<Pixelate>> = pixelateDefaultValues
type: string = 'Pixelate'

The class type. Used to identify which class this is. This is used for serialization purposes and internally it can be used to identify classes. As a developer you could use instance of Class but to avoid importing all the code and blocking tree shaking we try to avoid doing that.

Accessors

Methods

  • Returns a string that represent the current selected shader code for the filter. Used to force recompilation when parameters change or to retrieve the shader from cache

    Returns string

  • Returns undefined | string | number | ((gl, program) => TWebGLAttributeLocationMap) | ((options) => TWebGLProgramCacheItem) | (() => {
        type: string;
    }) | (() => {
        type: string;
    }) | ((gl, program) => TWebGLUniformLocationMap) | ((gl, uniformLocations) => void) | (() => string) | ((options) => void) | (() => boolean) | ((options) => void) | ((gl, fragmentSource?, vertexSource?) => {
        attributeLocations: TWebGLAttributeLocationMap;
        program: WebGLProgram;
        uniformLocations: TWebGLUniformLocationMap;
    }) | ((gl, attributeLocations, aPositionData) => void) | ((options) => void) | ((options) => void) | ((options) => void) | ((gl, texture, textureUnit) => void) | ((gl, textureUnit) => void) | (() => undefined | string | number | ((gl, program) => TWebGLAttributeLocationMap) | ((options) => TWebGLProgramCacheItem) | (() => {
        type: string;
    }) | (() => {
        type: string;
    }) | ((gl, program) => TWebGLUniformLocationMap) | ((gl, uniformLocations) => void) | (() => string) | ((options) => void) | (() => boolean) | ((options) => void) | ((gl, fragmentSource?, vertexSource?) => {
        attributeLocations: TWebGLAttributeLocationMap;
        program: WebGLProgram;
        uniformLocations: TWebGLUniformLocationMap;
    }) | ((gl, attributeLocations, aPositionData) => void) | ((options) => void) | ((options) => void) | ((options) => void) | ((gl, texture, textureUnit) => void) | ((gl, textureUnit) => void) | (() => string | number | ((gl: WebGLRenderingContext, program: WebGLProgram) => TWebGLAttributeLocationMap) | ... 19 more ... | undefined) | ((value) => void) | ((options) => void)) | ((value) => void) | ((options) => void)

  • Send attribute data from this filter to its shader program on the GPU.

    Parameters

    • gl: WebGLRenderingContext

      The canvas context used to compile the shader program.

    • attributeLocations: Record<string, number>

      A map of shader attribute names to their locations.

    • aPositionData: Float32Array

    Returns void

  • Send data from this filter to its shader program's uniforms.

    Parameters

    • gl: WebGLRenderingContext

      The GL canvas context used to compile this filter's shader.

    • uniformLocations: TWebGLUniformLocationMap

      A map of string uniform names to WebGLUniformLocation objects

    Returns void

  • Returns object representation of an instance

    Returns {
        type: string;
    }

    Object representation of an instance

    • type: string

Generated using TypeDoc