Kitty Graphics Protocol in OCaml
terminal graphics ocaml

TODO

+6 -5
+1
TODO.md
··· 1 + - Support zlib via decompress or similar
+1 -1
example/example.ml
··· 3 3 SPDX-License-Identifier: ISC 4 4 ---------------------------------------------------------------------------*) 5 5 6 - (* Kitty Graphics Protocol Demo - Matching kgp/examples/demo *) 6 + (* Kitty Graphics Protocol Demo *) 7 7 8 8 module K = Kgp 9 9
+4 -4
example/tiny_anim.ml
··· 31 31 (* Clear any existing images *) 32 32 send (K.delete ~free:true ~quiet:`Errors_only `All_visible) ~data:""; 33 33 34 - (* Step 1: Transmit base frame (red) - matching Go's sequence *) 34 + (* Step 1: Transmit base frame (red) *) 35 35 let red_frame = solid_color_rgba ~width ~height ~r:255 ~g:0 ~b:0 ~a:255 in 36 36 send 37 37 (K.transmit ~image_id ~format:`Rgba32 ~width ~height ~quiet:`Errors_only ()) 38 38 ~data:red_frame; 39 39 40 - (* Step 2: Add frame (orange) with 100ms gap - like Go *) 40 + (* Step 2: Add frame (orange) with 100ms gap *) 41 41 let orange_frame = 42 42 solid_color_rgba ~width ~height ~r:255 ~g:165 ~b:0 ~a:255 43 43 in ··· 65 65 ~quiet:`Errors_only ()) 66 66 ~data:green_frame; 67 67 68 - (* Step 5: Create placement - exactly like Go *) 68 + (* Step 5: Create placement *) 69 69 send 70 70 (K.display ~image_id 71 71 ~placement: ··· 74 74 ~quiet:`Errors_only ()) 75 75 ~data:""; 76 76 77 - (* Step 6: Start animation - exactly like Go (NO root frame gap) *) 77 + (* Step 6: Start animation *) 78 78 send (K.animate ~image_id (K.Animation.set_state ~loops:1 `Run)) ~data:""; 79 79 80 80 print_endline "";