Raxol.Terminal.ANSI.Behaviours.KittyGraphics behaviour (Raxol Terminal v2.6.0)

Copy Markdown View Source

Behaviour for Kitty graphics protocol support.

The Kitty Graphics Protocol enables pixel-level graphics rendering with superior features to Sixel including native animation support, better compression, and more flexible placement.

Summary

Types

action()

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

compression()

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

format()

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

t()

@type t() :: map()

Callbacks

add_animation_frame(t, binary)

(optional)
@callback add_animation_frame(t(), binary()) :: t()

decode(binary)

@callback decode(binary()) :: t()

delete_image(t, non_neg_integer)

(optional)
@callback delete_image(t(), non_neg_integer()) :: t()

encode(t)

@callback encode(t()) :: binary()

get_data(t)

@callback get_data(t()) :: binary()

new()

@callback new() :: t()

new(pos_integer, pos_integer)

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

place_image(t, map)

(optional)
@callback place_image(t(), map()) :: t()

process_sequence(t, binary)

@callback process_sequence(t(), binary()) :: {t(), :ok | {:error, term()}}

query_image(t, non_neg_integer)

(optional)
@callback query_image(t(), non_neg_integer()) :: {:ok, map()} | {:error, term()}

set_data(t, binary)

@callback set_data(t(), binary()) :: t()

supported?()

@callback supported?() :: boolean()

transmit_image(t, map)

(optional)
@callback transmit_image(t(), map()) :: t()