···2525 See {{:https://sw.kovidgoyal.net/kitty/graphics-protocol/} Kitty Graphics Protocol}
2626 for the full specification. *)
27272828-(** {1 Polymorphic Variant Types} *)
2929-3030-type format = Kgp_types.format
3131-(** Image data formats. [`Rgba32] is 32-bit RGBA (4 bytes per pixel),
3232- [`Rgb24] is 24-bit RGB (3 bytes per pixel), [`Png] is PNG encoded data. *)
3333-3434-type transmission = Kgp_types.transmission
3535-(** Transmission methods. [`Direct] sends data inline, [`File] reads from a path,
3636- [`Tempfile] reads from a temp file that the terminal deletes after reading. *)
3737-3838-type compression = Kgp_types.compression
3939-(** Compression options. [`None] for raw data, [`Zlib] for RFC 1950 compression. *)
4040-4141-type quiet = Kgp_types.quiet
4242-(** Response suppression. [`Noisy] sends all responses (default),
4343- [`Errors_only] suppresses OK responses, [`Silent] suppresses all. *)
4444-4545-type cursor = Kgp_types.cursor
4646-(** Cursor movement after displaying. [`Move] advances cursor (default),
4747- [`Static] keeps cursor in place. *)
4848-4949-type composition = Kgp_types.composition
5050-(** Composition modes. [`Alpha_blend] for full blending (default),
5151- [`Overwrite] for simple pixel replacement. *)
5252-5353-type delete = Kgp_types.delete
5454-(** Delete target specification. Each variant has two forms: one that only
5555- removes placements (e.g., [`All_visible]) and one that also frees the
5656- image data (e.g., [`All_visible_and_free]). *)
5757-5858-type animation_state = Kgp_types.animation_state
5959-(** Animation playback state. [`Stop] halts animation, [`Loading] runs but
6060- waits for new frames at end, [`Run] runs normally and loops. *)
6161-6228(** {1 Type Modules} *)
63296464-module Format = Kgp_types.Format
6565-module Transmission = Kgp_types.Transmission
6666-module Compression = Kgp_types.Compression
6767-module Quiet = Kgp_types.Quiet
6868-module Cursor = Kgp_types.Cursor
6969-module Composition = Kgp_types.Composition
7070-module Delete = Kgp_types.Delete
3030+module Format = Kgp_format
3131+module Transmission = Kgp_transmission
3232+module Compression = Kgp_compression
3333+module Quiet = Kgp_quiet
3434+module Cursor = Kgp_cursor
3535+module Composition = Kgp_composition
3636+module Delete = Kgp_delete
3737+module Animation_state = Kgp_animation_state
71387239(** {1 Configuration Modules} *)
7340
+1-5
lib/kgp_animation.ml
···11-(* Kitty Graphics Protocol Animation - Implementation *)
22-33-type state = Kgp_types.animation_state
44-51type t =
66- [ `Set_state of state * int option
22+ [ `Set_state of Kgp_animation_state.t * int option
73 | `Set_gap of int * int
84 | `Set_current of int ]
95
+2-5
lib/kgp_animation.mli
···2233 Animation control operations. *)
4455-type state = Kgp_types.animation_state
66-(** Animation playback state. *)
77-85type t =
99- [ `Set_state of state * int option
66+ [ `Set_state of Kgp_animation_state.t * int option
107 | `Set_gap of int * int
118 | `Set_current of int ]
129(** Animation control operations. *)
13101414-val set_state : ?loops:int -> state -> t
1111+val set_state : ?loops:int -> Kgp_animation_state.t -> t
1512(** Set animation state.
1613 @param loops Number of loops: 0 = ignored, 1 = infinite, n = n-1 loops *)
1714
+6
lib/kgp_animation_state.ml
···11+type t = [ `Stop | `Loading | `Run ]
22+33+let to_int : t -> int = function
44+ | `Stop -> 1
55+ | `Loading -> 2
66+ | `Run -> 3
+13
lib/kgp_animation_state.mli
···11+(** Animation Playback State
22+33+ Controls the playback state of animated images. *)
44+55+type t = [ `Stop | `Loading | `Run ]
66+(** Animation playback states.
77+88+ - [`Stop] - Halt animation playback
99+ - [`Loading] - Run animation but wait for new frames at end
1010+ - [`Run] - Run animation normally and loop *)
1111+1212+val to_int : t -> int
1313+(** Convert to protocol integer (1, 2, or 3). *)
+15-41
lib/kgp_command.ml
···11-(* Kitty Graphics Protocol Command - Implementation *)
22-31type action =
42 [ `Transmit
53 | `Transmit_and_display
···12101311type t = {
1412 action : action;
1515- format : Kgp_types.format option;
1616- transmission : Kgp_types.transmission option;
1717- compression : Kgp_types.compression option;
1313+ format : Kgp_format.t option;
1414+ transmission : Kgp_transmission.t option;
1515+ compression : Kgp_compression.t option;
1816 width : int option;
1917 height : int option;
2018 size : int option;
2119 offset : int option;
2222- quiet : Kgp_types.quiet option;
2020+ quiet : Kgp_quiet.t option;
2321 image_id : int option;
2422 image_number : int option;
2523 placement : Kgp_placement.t option;
2626- delete : Kgp_types.delete option;
2424+ delete : Kgp_delete.t option;
2725 frame : Kgp_frame.t option;
2826 animation : Kgp_animation.t option;
2927 compose : Kgp_compose.t option;
···148146 | `Animate -> 'a'
149147 | `Compose -> 'c'
150148151151-let delete_char : Kgp_types.delete -> char = function
152152- | `All_visible -> 'a'
153153- | `All_visible_and_free -> 'A'
154154- | `By_id _ -> 'i'
155155- | `By_id_and_free _ -> 'I'
156156- | `By_number _ -> 'n'
157157- | `By_number_and_free _ -> 'N'
158158- | `At_cursor -> 'c'
159159- | `At_cursor_and_free -> 'C'
160160- | `At_cell _ -> 'p'
161161- | `At_cell_and_free _ -> 'P'
162162- | `At_cell_z _ -> 'q'
163163- | `At_cell_z_and_free _ -> 'Q'
164164- | `By_column _ -> 'x'
165165- | `By_column_and_free _ -> 'X'
166166- | `By_row _ -> 'y'
167167- | `By_row_and_free _ -> 'Y'
168168- | `By_z_index _ -> 'z'
169169- | `By_z_index_and_free _ -> 'Z'
170170- | `By_id_range _ -> 'r'
171171- | `By_id_range_and_free _ -> 'R'
172172- | `Frames -> 'f'
173173- | `Frames_and_free -> 'F'
174174-175149let write_placement w (p : Kgp_placement.t) =
176150 kv_int_opt w 'x' (Kgp_placement.source_x p);
177151 kv_int_opt w 'y' (Kgp_placement.source_y p);
···185159 kv_int_opt w 'p' (Kgp_placement.placement_id p);
186160 Kgp_placement.cursor p
187161 |> Option.iter (fun c ->
188188- kv_int_if w 'C' ~default:0 (Some (Kgp_types.Cursor.to_int c)));
162162+ kv_int_if w 'C' ~default:0 (Some (Kgp_cursor.to_int c)));
189163 if Kgp_placement.unicode_placeholder p then kv_int w 'U' 1
190164191191-let write_delete w (d : Kgp_types.delete) =
192192- kv_char w 'd' (delete_char d);
165165+let write_delete w (d : Kgp_delete.t) =
166166+ kv_char w 'd' (Kgp_delete.to_char d);
193167 match d with
194168 | `By_id (id, pid) | `By_id_and_free (id, pid) ->
195169 kv_int w 'i' id;
···222196 kv_int_opt w 'z' (Kgp_frame.gap_ms f);
223197 Kgp_frame.composition f
224198 |> Option.iter (fun c ->
225225- kv_int_if w 'X' ~default:0 (Some (Kgp_types.Composition.to_int c)));
199199+ kv_int_if w 'X' ~default:0 (Some (Kgp_composition.to_int c)));
226200 kv_int32_opt w 'Y' (Kgp_frame.background_color f)
227201228202let write_animation w : Kgp_animation.t -> unit = function
229203 | `Set_state (state, loops) ->
230230- let s = match state with `Stop -> 1 | `Loading -> 2 | `Run -> 3 in
204204+ let s = Kgp_animation_state.to_int state in
231205 kv_int w 's' s;
232206 kv_int_opt w 'v' loops
233207 | `Set_gap (frame, gap_ms) ->
···246220 kv_int_opt w 'Y' (Kgp_compose.source_y c);
247221 Kgp_compose.composition c
248222 |> Option.iter (fun comp ->
249249- kv_int_if w 'C' ~default:0 (Some (Kgp_types.Composition.to_int comp)))
223223+ kv_int_if w 'C' ~default:0 (Some (Kgp_composition.to_int comp)))
250224251225let write_control_data buf cmd =
252226 let w = kv_writer buf in
···255229 (* Quiet - only if non-default *)
256230 cmd.quiet
257231 |> Option.iter (fun q ->
258258- kv_int_if w 'q' ~default:0 (Some (Kgp_types.Quiet.to_int q)));
232232+ kv_int_if w 'q' ~default:0 (Some (Kgp_quiet.to_int q)));
259233 (* Format *)
260234 cmd.format
261261- |> Option.iter (fun f -> kv_int w 'f' (Kgp_types.Format.to_int f));
235235+ |> Option.iter (fun f -> kv_int w 'f' (Kgp_format.to_int f));
262236 (* Transmission - only for transmit/frame actions, always include t=d for compatibility *)
263237 (match cmd.action with
264238 | `Transmit | `Transmit_and_display | `Frame -> (
265239 match cmd.transmission with
266266- | Some t -> kv_char w 't' (Kgp_types.Transmission.to_char t)
240240+ | Some t -> kv_char w 't' (Kgp_transmission.to_char t)
267241 | None -> kv_char w 't' 'd')
268242 | _ -> ());
269243 (* Compression *)
270244 cmd.compression
271245 |> Option.iter (fun c ->
272272- Kgp_types.Compression.to_char c |> Option.iter (kv_char w 'o'));
246246+ Kgp_compression.to_char c |> Option.iter (kv_char w 'o'));
273247 (* Dimensions *)
274248 kv_int_opt w 's' cmd.width;
275249 kv_int_opt w 'v' cmd.height;
···1414 ?source_y:int ->
1515 ?dest_x:int ->
1616 ?dest_y:int ->
1717- ?composition:Kgp_types.composition ->
1717+ ?composition:Kgp_composition.t ->
1818 unit ->
1919 t
2020(** Compose a rectangle from one frame onto another. *)
···2929val source_y : t -> int option
3030val dest_x : t -> int option
3131val dest_y : t -> int option
3232-val composition : t -> Kgp_types.composition option
3232+val composition : t -> Kgp_composition.t option
+5
lib/kgp_composition.ml
···11+type t = [ `Alpha_blend | `Overwrite ]
22+33+let to_int : t -> int = function
44+ | `Alpha_blend -> 0
55+ | `Overwrite -> 1
+12
lib/kgp_composition.mli
···11+(** Pixel Composition Mode
22+33+ Controls how pixels are blended when compositing images or animation frames. *)
44+55+type t = [ `Alpha_blend | `Overwrite ]
66+(** Composition modes.
77+88+ - [`Alpha_blend] - Full alpha blending (default)
99+ - [`Overwrite] - Simple pixel replacement *)
1010+1111+val to_int : t -> int
1212+(** Convert to protocol integer (0 or 1). *)
+5
lib/kgp_compression.ml
···11+type t = [ `None | `Zlib ]
22+33+let to_char : t -> char option = function
44+ | `None -> None
55+ | `Zlib -> Some 'z'
+13
lib/kgp_compression.mli
···11+(** Data Compression
22+33+ Specifies compression applied to image data before transmission. *)
44+55+type t = [ `None | `Zlib ]
66+(** Compression options.
77+88+ - [`None] - Raw uncompressed data
99+ - [`Zlib] - RFC 1950 zlib compression *)
1010+1111+val to_char : t -> char option
1212+(** Convert to protocol character. Returns [None] for no compression,
1313+ [Some 'z'] for zlib. *)
+5
lib/kgp_cursor.ml
···11+type t = [ `Move | `Static ]
22+33+let to_int : t -> int = function
44+ | `Move -> 0
55+ | `Static -> 1
+12
lib/kgp_cursor.mli
···11+(** Cursor Movement Behavior
22+33+ Controls cursor position after displaying an image. *)
44+55+type t = [ `Move | `Static ]
66+(** Cursor movement behavior.
77+88+ - [`Move] - Advance cursor past the displayed image (default)
99+ - [`Static] - Keep cursor in place *)
1010+1111+val to_int : t -> int
1212+(** Convert to protocol integer (0 or 1). *)
+47
lib/kgp_delete.ml
···11+type t =
22+ [ `All_visible
33+ | `All_visible_and_free
44+ | `By_id of int * int option
55+ | `By_id_and_free of int * int option
66+ | `By_number of int * int option
77+ | `By_number_and_free of int * int option
88+ | `At_cursor
99+ | `At_cursor_and_free
1010+ | `At_cell of int * int
1111+ | `At_cell_and_free of int * int
1212+ | `At_cell_z of int * int * int
1313+ | `At_cell_z_and_free of int * int * int
1414+ | `By_column of int
1515+ | `By_column_and_free of int
1616+ | `By_row of int
1717+ | `By_row_and_free of int
1818+ | `By_z_index of int
1919+ | `By_z_index_and_free of int
2020+ | `By_id_range of int * int
2121+ | `By_id_range_and_free of int * int
2222+ | `Frames
2323+ | `Frames_and_free ]
2424+2525+let to_char : t -> char = function
2626+ | `All_visible -> 'a'
2727+ | `All_visible_and_free -> 'A'
2828+ | `By_id _ -> 'i'
2929+ | `By_id_and_free _ -> 'I'
3030+ | `By_number _ -> 'n'
3131+ | `By_number_and_free _ -> 'N'
3232+ | `At_cursor -> 'c'
3333+ | `At_cursor_and_free -> 'C'
3434+ | `At_cell _ -> 'p'
3535+ | `At_cell_and_free _ -> 'P'
3636+ | `At_cell_z _ -> 'q'
3737+ | `At_cell_z_and_free _ -> 'Q'
3838+ | `By_column _ -> 'x'
3939+ | `By_column_and_free _ -> 'X'
4040+ | `By_row _ -> 'y'
4141+ | `By_row_and_free _ -> 'Y'
4242+ | `By_z_index _ -> 'z'
4343+ | `By_z_index_and_free _ -> 'Z'
4444+ | `By_id_range _ -> 'r'
4545+ | `By_id_range_and_free _ -> 'R'
4646+ | `Frames -> 'f'
4747+ | `Frames_and_free -> 'F'
+47
lib/kgp_delete.mli
···11+(** Image Deletion Target
22+33+ Specifies which images or placements to delete. Each deletion type has
44+ two variants: one that only removes placements and one that also frees
55+ the underlying image data. *)
66+77+type t =
88+ [ `All_visible
99+ | `All_visible_and_free
1010+ | `By_id of int * int option
1111+ | `By_id_and_free of int * int option
1212+ | `By_number of int * int option
1313+ | `By_number_and_free of int * int option
1414+ | `At_cursor
1515+ | `At_cursor_and_free
1616+ | `At_cell of int * int
1717+ | `At_cell_and_free of int * int
1818+ | `At_cell_z of int * int * int
1919+ | `At_cell_z_and_free of int * int * int
2020+ | `By_column of int
2121+ | `By_column_and_free of int
2222+ | `By_row of int
2323+ | `By_row_and_free of int
2424+ | `By_z_index of int
2525+ | `By_z_index_and_free of int
2626+ | `By_id_range of int * int
2727+ | `By_id_range_and_free of int * int
2828+ | `Frames
2929+ | `Frames_and_free ]
3030+(** Deletion target specification.
3131+3232+ - [`All_visible] - All visible placements
3333+ - [`By_id (id, placement_id)] - By image ID and optional placement ID
3434+ - [`By_number (n, placement_id)] - By image number and optional placement ID
3535+ - [`At_cursor] - Placement at cursor position
3636+ - [`At_cell (x, y)] - Placement at cell coordinates
3737+ - [`At_cell_z (x, y, z)] - Placement at cell with specific z-index
3838+ - [`By_column c] - All placements in column c
3939+ - [`By_row r] - All placements in row r
4040+ - [`By_z_index z] - All placements with z-index z
4141+ - [`By_id_range (min, max)] - All images with IDs in range
4242+ - [`Frames] - Animation frames only
4343+4444+ The [_and_free] variants also release the image data from memory. *)
4545+4646+val to_char : t -> char
4747+(** Convert to protocol character for the delete command. *)
+6
lib/kgp_format.ml
···11+type t = [ `Rgba32 | `Rgb24 | `Png ]
22+33+let to_int : t -> int = function
44+ | `Rgba32 -> 32
55+ | `Rgb24 -> 24
66+ | `Png -> 100
+13
lib/kgp_format.mli
···11+(** Image Data Format
22+33+ Specifies the pixel format of image data being transmitted. *)
44+55+type t = [ `Rgba32 | `Rgb24 | `Png ]
66+(** Image data formats.
77+88+ - [`Rgba32] - 32-bit RGBA (4 bytes per pixel)
99+ - [`Rgb24] - 24-bit RGB (3 bytes per pixel)
1010+ - [`Png] - PNG encoded data *)
1111+1212+val to_int : t -> int
1313+(** Convert to protocol integer value (32, 24, or 100). *)
+1-3
lib/kgp_frame.ml
···11-(* Kitty Graphics Protocol Frame - Implementation *)
22-31type t = {
42 x : int option;
53 y : int option;
64 base_frame : int option;
75 edit_frame : int option;
86 gap_ms : int option;
99- composition : Kgp_types.composition option;
77+ composition : Kgp_composition.t option;
108 background_color : int32 option;
119}
1210
+2-2
lib/kgp_frame.mli
···1111 ?base_frame:int ->
1212 ?edit_frame:int ->
1313 ?gap_ms:int ->
1414- ?composition:Kgp_types.composition ->
1414+ ?composition:Kgp_composition.t ->
1515 ?background_color:int32 ->
1616 unit ->
1717 t
···3535val base_frame : t -> int option
3636val edit_frame : t -> int option
3737val gap_ms : t -> int option
3838-val composition : t -> Kgp_types.composition option
3838+val composition : t -> Kgp_composition.t option
3939val background_color : t -> int32 option
+1-3
lib/kgp_placement.ml
···11-(* Kitty Graphics Protocol Placement - Implementation *)
22-31type t = {
42 source_x : int option;
53 source_y : int option;
···119 rows : int option;
1210 z_index : int option;
1311 placement_id : int option;
1414- cursor : Kgp_types.cursor option;
1212+ cursor : Kgp_cursor.t option;
1513 unicode_placeholder : bool;
1614}
1715
+2-2
lib/kgp_placement.mli
···1616 ?rows:int ->
1717 ?z_index:int ->
1818 ?placement_id:int ->
1919- ?cursor:Kgp_types.cursor ->
1919+ ?cursor:Kgp_cursor.t ->
2020 ?unicode_placeholder:bool ->
2121 unit ->
2222 t
···5050val rows : t -> int option
5151val z_index : t -> int option
5252val placement_id : t -> int option
5353-val cursor : t -> Kgp_types.cursor option
5353+val cursor : t -> Kgp_cursor.t option
5454val unicode_placeholder : t -> bool
+6
lib/kgp_quiet.ml
···11+type t = [ `Noisy | `Errors_only | `Silent ]
22+33+let to_int : t -> int = function
44+ | `Noisy -> 0
55+ | `Errors_only -> 1
66+ | `Silent -> 2
+13
lib/kgp_quiet.mli
···11+(** Response Suppression Level
22+33+ Controls which terminal responses are sent back to the application. *)
44+55+type t = [ `Noisy | `Errors_only | `Silent ]
66+(** Response suppression levels.
77+88+ - [`Noisy] - Send all responses (default)
99+ - [`Errors_only] - Suppress OK responses, only send errors
1010+ - [`Silent] - Suppress all responses *)
1111+1212+val to_int : t -> int
1313+(** Convert to protocol integer (0, 1, or 2). *)
···11+(** Data Transmission Method
22+33+ Specifies how image data is transmitted to the terminal. *)
44+55+type t = [ `Direct | `File | `Tempfile ]
66+(** Transmission methods.
77+88+ - [`Direct] - Data is sent inline in the escape sequence
99+ - [`File] - Terminal reads from a file path
1010+ - [`Tempfile] - Terminal reads and deletes a temporary file *)
1111+1212+val to_char : t -> char
1313+(** Convert to protocol character ('d', 'f', or 't'). *)
-89
lib/kgp_types.ml
···11-(* Kitty Graphics Protocol Types - Implementation *)
22-33-type format = [ `Rgba32 | `Rgb24 | `Png ]
44-type transmission = [ `Direct | `File | `Tempfile ]
55-type compression = [ `None | `Zlib ]
66-type quiet = [ `Noisy | `Errors_only | `Silent ]
77-type cursor = [ `Move | `Static ]
88-type composition = [ `Alpha_blend | `Overwrite ]
99-1010-type delete =
1111- [ `All_visible
1212- | `All_visible_and_free
1313- | `By_id of int * int option
1414- | `By_id_and_free of int * int option
1515- | `By_number of int * int option
1616- | `By_number_and_free of int * int option
1717- | `At_cursor
1818- | `At_cursor_and_free
1919- | `At_cell of int * int
2020- | `At_cell_and_free of int * int
2121- | `At_cell_z of int * int * int
2222- | `At_cell_z_and_free of int * int * int
2323- | `By_column of int
2424- | `By_column_and_free of int
2525- | `By_row of int
2626- | `By_row_and_free of int
2727- | `By_z_index of int
2828- | `By_z_index_and_free of int
2929- | `By_id_range of int * int
3030- | `By_id_range_and_free of int * int
3131- | `Frames
3232- | `Frames_and_free ]
3333-3434-type animation_state = [ `Stop | `Loading | `Run ]
3535-3636-module Format = struct
3737- type t = format
3838-3939- let to_int : t -> int = function
4040- | `Rgba32 -> 32
4141- | `Rgb24 -> 24
4242- | `Png -> 100
4343-end
4444-4545-module Transmission = struct
4646- type t = transmission
4747-4848- let to_char : t -> char = function
4949- | `Direct -> 'd'
5050- | `File -> 'f'
5151- | `Tempfile -> 't'
5252-end
5353-5454-module Compression = struct
5555- type t = compression
5656-5757- let to_char : t -> char option = function
5858- | `None -> None
5959- | `Zlib -> Some 'z'
6060-end
6161-6262-module Quiet = struct
6363- type t = quiet
6464-6565- let to_int : t -> int = function
6666- | `Noisy -> 0
6767- | `Errors_only -> 1
6868- | `Silent -> 2
6969-end
7070-7171-module Cursor = struct
7272- type t = cursor
7373-7474- let to_int : t -> int = function
7575- | `Move -> 0
7676- | `Static -> 1
7777-end
7878-7979-module Composition = struct
8080- type t = composition
8181-8282- let to_int : t -> int = function
8383- | `Alpha_blend -> 0
8484- | `Overwrite -> 1
8585-end
8686-8787-module Delete = struct
8888- type t = delete
8989-end
-109
lib/kgp_types.mli
···11-(** Kitty Graphics Protocol Types
22-33- This module defines the base polymorphic variant types used throughout
44- the Kitty graphics protocol implementation. *)
55-66-(** {1 Polymorphic Variant Types} *)
77-88-type format = [ `Rgba32 | `Rgb24 | `Png ]
99-(** Image data formats. [`Rgba32] is 32-bit RGBA (4 bytes per pixel),
1010- [`Rgb24] is 24-bit RGB (3 bytes per pixel), [`Png] is PNG encoded data. *)
1111-1212-type transmission = [ `Direct | `File | `Tempfile ]
1313-(** Transmission methods. [`Direct] sends data inline, [`File] reads from a path,
1414- [`Tempfile] reads from a temp file that the terminal deletes after reading. *)
1515-1616-type compression = [ `None | `Zlib ]
1717-(** Compression options. [`None] for raw data, [`Zlib] for RFC 1950 compression. *)
1818-1919-type quiet = [ `Noisy | `Errors_only | `Silent ]
2020-(** Response suppression. [`Noisy] sends all responses (default),
2121- [`Errors_only] suppresses OK responses, [`Silent] suppresses all. *)
2222-2323-type cursor = [ `Move | `Static ]
2424-(** Cursor movement after displaying. [`Move] advances cursor (default),
2525- [`Static] keeps cursor in place. *)
2626-2727-type composition = [ `Alpha_blend | `Overwrite ]
2828-(** Composition modes. [`Alpha_blend] for full blending (default),
2929- [`Overwrite] for simple pixel replacement. *)
3030-3131-type delete =
3232- [ `All_visible
3333- | `All_visible_and_free
3434- | `By_id of int * int option
3535- | `By_id_and_free of int * int option
3636- | `By_number of int * int option
3737- | `By_number_and_free of int * int option
3838- | `At_cursor
3939- | `At_cursor_and_free
4040- | `At_cell of int * int
4141- | `At_cell_and_free of int * int
4242- | `At_cell_z of int * int * int
4343- | `At_cell_z_and_free of int * int * int
4444- | `By_column of int
4545- | `By_column_and_free of int
4646- | `By_row of int
4747- | `By_row_and_free of int
4848- | `By_z_index of int
4949- | `By_z_index_and_free of int
5050- | `By_id_range of int * int
5151- | `By_id_range_and_free of int * int
5252- | `Frames
5353- | `Frames_and_free ]
5454-(** Delete target specification. Each variant has two forms: one that only
5555- removes placements (e.g., [`All_visible]) and one that also frees the
5656- image data (e.g., [`All_visible_and_free]). Tuple variants contain
5757- (image_id, optional_placement_id) or (x, y) coordinates. *)
5858-5959-type animation_state = [ `Stop | `Loading | `Run ]
6060-(** Animation playback state. [`Stop] halts animation, [`Loading] runs but
6161- waits for new frames at end, [`Run] runs normally and loops. *)
6262-6363-(** {1 Type Modules} *)
6464-6565-module Format : sig
6666- type t = format
6767-6868- val to_int : t -> int
6969- (** Convert to protocol integer value (32, 24, or 100). *)
7070-end
7171-7272-module Transmission : sig
7373- type t = transmission
7474-7575- val to_char : t -> char
7676- (** Convert to protocol character ('d', 'f', or 't'). *)
7777-end
7878-7979-module Compression : sig
8080- type t = compression
8181-8282- val to_char : t -> char option
8383- (** Convert to protocol character ([None] or [Some 'z']). *)
8484-end
8585-8686-module Quiet : sig
8787- type t = quiet
8888-8989- val to_int : t -> int
9090- (** Convert to protocol integer (0, 1, or 2). *)
9191-end
9292-9393-module Cursor : sig
9494- type t = cursor
9595-9696- val to_int : t -> int
9797- (** Convert to protocol integer (0 or 1). *)
9898-end
9999-100100-module Composition : sig
101101- type t = composition
102102-103103- val to_int : t -> int
104104- (** Convert to protocol integer (0 or 1). *)
105105-end
106106-107107-module Delete : sig
108108- type t = delete
109109-end