Kitty Graphics Protocol in OCaml
terminal graphics ocaml

TODO

Changed files
+6 -5
example
+1
TODO.md
···
+
- Support zlib via decompress or similar
+1 -1
example/example.ml
···
SPDX-License-Identifier: ISC
---------------------------------------------------------------------------*)
-
(* Kitty Graphics Protocol Demo - Matching kgp/examples/demo *)
+
(* Kitty Graphics Protocol Demo *)
module K = Kgp
+4 -4
example/tiny_anim.ml
···
(* Clear any existing images *)
send (K.delete ~free:true ~quiet:`Errors_only `All_visible) ~data:"";
-
(* Step 1: Transmit base frame (red) - matching Go's sequence *)
+
(* Step 1: Transmit base frame (red) *)
let red_frame = solid_color_rgba ~width ~height ~r:255 ~g:0 ~b:0 ~a:255 in
send
(K.transmit ~image_id ~format:`Rgba32 ~width ~height ~quiet:`Errors_only ())
~data:red_frame;
-
(* Step 2: Add frame (orange) with 100ms gap - like Go *)
+
(* Step 2: Add frame (orange) with 100ms gap *)
let orange_frame =
solid_color_rgba ~width ~height ~r:255 ~g:165 ~b:0 ~a:255
in
···
~quiet:`Errors_only ())
~data:green_frame;
-
(* Step 5: Create placement - exactly like Go *)
+
(* Step 5: Create placement *)
send
(K.display ~image_id
~placement:
···
~quiet:`Errors_only ())
~data:"";
-
(* Step 6: Start animation - exactly like Go (NO root frame gap) *)
+
(* Step 6: Start animation *)
send (K.animate ~image_id (K.Animation.set_state ~loops:1 `Run)) ~data:"";
print_endline "";