···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(* Kitty Graphics Protocol Demo - Matching kgp/examples/demo *)
2738module K = Kgp
+5
example/tiny_anim.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(* Tiny animation test - no chunking needed *)
27(* Uses 20x20 images which are ~1067 bytes base64 (well under 4096) *)
38
+5
lib-cli/kgp_cli.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(* Cmdliner Support for Kitty Graphics Protocol *)
2738open Cmdliner
+5
lib-cli/kgp_cli.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Cmdliner Support for Kitty Graphics Protocol
2738 This module provides Cmdliner terms for configuring graphics output mode
+5
lib/kgp.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(* Type modules *)
27module Format = Kgp_format
38module Transmission = Kgp_transmission
+5
lib/kgp.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Kitty Terminal Graphics Protocol
2738 This library implements the Kitty terminal graphics protocol, allowing
+5
lib/kgp_animation.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t =
27 [ `Set_state of Kgp_animation_state.t * int option
38 | `Set_gap of int * int
+5
lib/kgp_animation.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Animation Control
2738 Operations for controlling animation playback. The protocol supports
+5
lib/kgp_animation_state.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `Stop | `Loading | `Run ]
2738let to_int : t -> int = function
+5
lib/kgp_animation_state.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Animation Playback State
2738 Controls the playback state of animated images.
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Kitty Graphics Protocol Commands
2738 This module provides functions for building and serializing graphics
+5
lib/kgp_compose.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = {
27 source_frame : int;
38 dest_frame : int;
+5
lib/kgp_compose.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Frame Composition
2738 Operations for compositing rectangular regions between animation frames.
+5
lib/kgp_composition.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `Alpha_blend | `Overwrite ]
2738let to_int : t -> int = function
+5
lib/kgp_composition.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Pixel Composition Mode
2738 Controls how pixels are blended when compositing images or animation frames.
+5
lib/kgp_compression.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `None | `Zlib ]
2738let to_char : t -> char option = function
+5
lib/kgp_compression.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Data Compression
2738 Specifies compression applied to image data before transmission.
+5
lib/kgp_cursor.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `Move | `Static ]
2738let to_int : t -> int = function
+5
lib/kgp_cursor.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Cursor Movement Behavior
2738 Controls cursor position after displaying an image.
+5
lib/kgp_delete.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t =
27 [ `All_visible
38 | `By_id of int * int option
+5
lib/kgp_delete.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Image Deletion Target
2738 Specifies which images or placements to delete.
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Kitty Graphics Protocol Detection
2738 Detect terminal graphics support capabilities. *)
+5
lib/kgp_format.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `Rgba32 | `Rgb24 | `Png ]
2738let to_int : t -> int = function
+5
lib/kgp_format.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Image Data Format
2738 Specifies the pixel format of image data being transmitted to the terminal.
+5
lib/kgp_frame.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = {
27 x : int option;
38 y : int option;
+5
lib/kgp_frame.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Animation Frame Configuration
2738 Configuration for adding or editing animation frames. Frames can be
+5
lib/kgp_placement.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = {
27 source_x : int option;
38 source_y : int option;
+5
lib/kgp_placement.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Image Placement Configuration
2738 Configuration for where and how to display images. Placements control
+5
lib/kgp_quiet.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `Noisy | `Errors_only | `Silent ]
2738let to_int : t -> int = function
+5
lib/kgp_quiet.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Response Suppression Level
2738 Controls which terminal responses are sent back to the application.
+5
lib/kgp_response.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(* Kitty Graphics Protocol Response - Implementation *)
2738type t = {
+5
lib/kgp_response.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Kitty Graphics Protocol Response
2738 Parse and interpret terminal responses to graphics commands. *)
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Terminal Environment Detection
2738 Detect terminal capabilities and environment for graphics protocol support.
+5
lib/kgp_tmux.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(* Tmux Passthrough Support - Implementation *)
2738let is_active () =
+5
lib/kgp_tmux.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Tmux Passthrough Support
2738 Support for passing graphics protocol escape sequences through tmux
+5
lib/kgp_transmission.ml
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16type t = [ `Direct | `File | `Tempfile ]
2738let to_char : t -> char = function
+5
lib/kgp_transmission.mli
···11+(*---------------------------------------------------------------------------
22+ Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
33+ SPDX-License-Identifier: ISC
44+ ---------------------------------------------------------------------------*)
55+16(** Data Transmission Method
2738 Specifies how image data is transmitted to the terminal.