Class Decoder

The GIF Decoder.

Constructors

  • Create a new decoder.

    Parameters

    • buffer: Uint8Array

      The GIF buffer to decode.

    • Optionaloptions: null | DecodeOptions

      The options to use for decoding.

    Returns Decoder

Accessors

  • get bgColor(): null | number

    Index of the background color in the global palette In practice this is not used, and the background is always transparent

    Returns null | number

  • get bufferSize(): number

    Output buffer size.

    Returns number

  • get globalPalette(): null | Uint8Array<ArrayBufferLike>

    The global color palette.

    Returns null | Uint8Array<ArrayBufferLike>

  • get height(): number

    Height of the GIF.

    Returns number

  • get lineLength(): number

    Line length of the current frame.

    Returns number

  • get loops(): number

    Number of loop repetitions.

    Returns number

  • get palette(): Uint8Array

    The color palette relevant for the frame that has been decoded.

    Returns Uint8Array

  • get width(): number

    Width of the GIF.

    Returns number

Methods

  • Returns the next frame info. (skips the buffer)

    Returns null | Frame

  • Reads the next frame from the GIF. Do not call <Decoder>.nextFrameInfo beforehand. Deinterlaces the result.

    Returns null | Frame