Raxol.Terminal.ANSI.KittyParser.ParserState (Raxol Terminal v2.6.0)

Copy Markdown View Source

Represents the state during parsing of a Kitty graphics data stream. Tracks control parameters, chunked data, and image buffers.

Summary

Functions

Create a new parser state with default values.

Create a new parser state with initial dimensions.

Reset the parser state for a new image while preserving accumulated data.

Types

action()

@type action() :: :transmit | :transmit_display | :display | :delete | :query | :frame

compression()

@type compression() :: :none | :zlib

format()

@type format() :: :rgb | :rgba | :png | :unknown

t()

@type t() :: %Raxol.Terminal.ANSI.KittyParser.ParserState{
  action: action(),
  cell_x: non_neg_integer() | nil,
  cell_y: non_neg_integer() | nil,
  chunk_data: binary(),
  compression: compression(),
  errors: [term()],
  format: format(),
  height: non_neg_integer() | nil,
  image_id: non_neg_integer() | nil,
  more_data: boolean(),
  pixel_buffer: binary(),
  placement_id: non_neg_integer() | nil,
  quiet: 0 | 1 | 2,
  raw_control: binary(),
  transmission: transmission(),
  width: non_neg_integer() | nil,
  x_offset: non_neg_integer(),
  y_offset: non_neg_integer(),
  z_index: integer()
}

transmission()

@type transmission() :: :direct | :file | :temp_file | :shared_memory

Functions

new()

@spec new() :: %Raxol.Terminal.ANSI.KittyParser.ParserState{
  action: :transmit,
  cell_x: nil,
  cell_y: nil,
  chunk_data: <<_::0>>,
  compression: :none,
  errors: [],
  format: :rgba,
  height: nil,
  image_id: nil,
  more_data: false,
  pixel_buffer: <<_::0>>,
  placement_id: nil,
  quiet: 0,
  raw_control: <<_::0>>,
  transmission: :direct,
  width: nil,
  x_offset: 0,
  y_offset: 0,
  z_index: 0
}

Create a new parser state with default values.

new(width, height)

@spec new(pos_integer(), pos_integer()) :: t()

Create a new parser state with initial dimensions.

reset(state)

@spec reset(t()) :: t()

Reset the parser state for a new image while preserving accumulated data.