Type alias RasterOperation

RasterOperation: ((data, obj) => number[] | ImageData)

Type declaration

    • (data, obj): number[] | ImageData
    • A function that takes an array of input data, performs some operation, and returns an array of ouput data. For pixel type operations, the function will be called with an array of pixels, where each pixel is an array of four numbers ([r, g, b, a]) in the range of 0 - 255. It should return a single pixel array. For 'image' type operations, functions will be called with an array of ImageData https://developer.mozilla.org/en-US/docs/Web/API/ImageData and should return a single ImageData https://developer.mozilla.org/en-US/docs/Web/API/ImageData. The operations are called with a second "data" argument, which can be used for storage. The data object is accessible from raster events, where it can be initialized in "beforeoperations" and accessed again in "afteroperations".

      Parameters

      • data: number[][] | ImageData[]
      • obj: GlobalObject

      Returns number[] | ImageData

Generated using TypeDoc