Kitty Graphics Protocol in OCaml
terminal
graphics
ocaml
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6type t = {
7 source_frame : int;
8 dest_frame : int;
9 width : int option;
10 height : int option;
11 source_x : int option;
12 source_y : int option;
13 dest_x : int option;
14 dest_y : int option;
15 composition : Kgp_composition.t option;
16}
17
18let make ~source_frame ~dest_frame ?width ?height ?source_x ?source_y ?dest_x
19 ?dest_y ?composition () =
20 {
21 source_frame;
22 dest_frame;
23 width;
24 height;
25 source_x;
26 source_y;
27 dest_x;
28 dest_y;
29 composition;
30 }
31
32let source_frame t = t.source_frame
33let dest_frame t = t.dest_frame
34let width t = t.width
35let height t = t.height
36let source_x t = t.source_x
37let source_y t = t.source_y
38let dest_x t = t.dest_x
39let dest_y t = t.dest_y
40let composition t = t.composition