VFX-JS
    Preparing search index...

    Class JPEGGlitchEffect

    Real (codec-level) JPEG glitch. Reads the element back to the CPU,
    re-encodes it as a JPEG with the browser's native encoder, corrupts
    random bytes in the compressed scan stream, and draws the browser's
    decode of the broken file — so the artifacts are produced by an actual
    JPEG decoder rather than approximated in a shader.

    Mutate params directly or via setParams. With speed: 0 the effect
    settles on a single stable glitched frame and only re-glitches when
    params change; with speed > 0 it keeps re-corrupting for a live,
    animated glitch.

    Note: the encode/decode round trip is asynchronous and runs off the
    render loop. The source passes through until the first result lands.

    Implements

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    enabled: boolean = true

    Whether this effect renders. (Default: true)

    Set to false to skip this effect's render(): the chain passes
    its input straight through to the next stage (or to the canvas if
    it is the last stage), with no draw. Re-checked every frame, so it
    is a cheap runtime toggle — the effect stays attached and keeps its
    buffers, paying no re-init cost.

    init and update still run while disabled, so stateful effects
    stay warm and re-enable seamlessly. Omitting the field (or
    undefined) means enabled.

    Accessors

    Methods

    • State-update phase. ctx.src / ctx.target may point to stale /
      previous-frame handles here, so ctx.draw() MUST NOT be called.
      If called, the orchestrator silently ignores it.

      Returns void