Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "dither"

Index

Functions

Const defBayer

Const ditherPixels

  • ditherPixels(dest: NumericArray | null, src: NumericArray, width: number, height: number, mat: BayerMatrix, dsteps: number, drange: number, srange: number): number[] | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array
  • Applies ordered dither to given single-channel raw pixel array src and writes results to dest (will be created if null).

    remarks

    Also see defBayer for Bayer matrix creation.

    Parameters

    • dest: NumericArray | null
    • src: NumericArray
    • width: number
    • height: number
    • mat: BayerMatrix

      bayer dither matrix

    • dsteps: number

      target number of color steps

    • drange: number

      target color resolution (e.g. 256)

    • srange: number

      source color resolution

    Returns number[] | Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array

Const init

  • init(x: number, y: number, size: number, val: number, step: number, mat: number[][]): number[][]
  • Parameters

    • x: number
    • y: number
    • size: number
    • val: number
    • step: number
    • mat: number[][]

    Returns number[][]

Const orderedDither

  • orderedDither(__namedParameters: { invSize: number; mask: number; mat: number[][] }, dsteps: number, drange: number, srange: number, x: number, y: number, val: number): number
  • Single-channel/value ordered dither using provided Bayer matrix.

    Parameters

    • __namedParameters: { invSize: number; mask: number; mat: number[][] }
      • invSize: number
      • mask: number
      • mat: number[][]
    • dsteps: number

      number of dest colors

    • drange: number

      dest color range

    • srange: number

      src color range

    • x: number

      x pos

    • y: number

      y pos

    • val: number

      src value

    Returns number

Generated using TypeDoc