1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//! Kitty Graphics Protocol - A Rust library for the Kitty terminal graphics protocol
//!
//! This library provides a complete implementation of the Kitty terminal graphics protocol,
//! allowing you to display images and animations in terminal emulators that support this protocol.
//!
//! # Features
//!
//! - Full support for all graphics protocol commands
//! - Support for RGB, RGBA, and PNG image formats
//! - Chunked data transmission for large images
//! - Animation support
//! - Unicode placeholder support
//! - Terminal size detection
//! - Protocol support detection
//!
//! # Quick Start
//!
//! ```no_run
//! use kitty_graphics_protocol::display_png;
//!
//! // Display a PNG file
//! display_png("image.png").unwrap();
//! ```
//!
//! # Advanced Usage
//!
//! ```no_run
//! use kitty_graphics_protocol::{Command, ImageFormat, Action};
//!
//! // Create a command to transmit and display a PNG image
//! let png_data = std::fs::read("image.png").unwrap();
//! let cmd = Command::builder()
//! .action(Action::TransmitAndDisplay)
//! .format(ImageFormat::Png)
//! .build();
//!
//! // Serialize the command to escape sequence chunks
//! let chunks: Vec<String> = cmd.serialize_chunked(&png_data).unwrap().collect();
//! for chunk in chunks {
//! print!("{}", chunk);
//! }
//! ```
pub use ;
pub use ;
pub use ;
pub use Response;
pub use ;
pub use ;
/// The ESC character (0x1b)
pub const ESC: u8 = 0x1b;
/// The APC (Application Programming Command) start sequence: ESC _
pub const APC_START: & = &;
/// The APC end sequence: ESC \
pub const APC_END: & = &;
/// The graphics command prefix: G
pub const GRAPHICS_PREFIX: &str = "G";
/// Maximum chunk size for data transmission (4096 bytes)
pub const MAX_CHUNK_SIZE: usize = 4096;