-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Kitty's terminal graphics protocol -- client-side OCaml implementation | ||
|
||
 | ||
|
||
See [https://sw.kovidgoyal.net/kitty/graphics-protocol/](https://sw.kovidgoyal.net/kitty/graphics-protocol/). | ||
|
||
This is WIP but should be enough for basic tasks. Support for "advanced" uses of | ||
the protocols (using images/pattern ids) probably needs more work. Contributions | ||
welcome! |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(executable | ||
(name icat) | ||
(libraries kittyimg stb_image)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
let icat filename = | ||
let img = Result.get_ok (Stb_image.load ~channels:4 filename) in | ||
let img_s = Kittyimg.string_of_bytes_ba img.Stb_image.data in | ||
print_newline (); | ||
Kittyimg.send_image | ||
~w:img.Stb_image.width ~h:img.Stb_image.height | ||
~format:`RGBA ~mode:(`Display (Kittyimg.display_opts ())) | ||
img_s; | ||
print_newline () | ||
|
||
let () = | ||
match Array.to_list Sys.argv |> List.tl with | ||
| [ filename ] -> icat filename | ||
| _ -> | ||
Printf.eprintf "usage: %s <imagefile>\n" Sys.argv.(0); exit 1 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.