Expand description
This Rust crate implements a IPC TCP client for tev. It enables programmatic control of the images displayed by tev using a convenient and safe Rust api.
Supports all existing tev commands:
- PacketOpenImage open an existing image given the path
- PacketReloadImage reload an image from disk
- PacketCloseImage close an opened image
- PacketCreateImage create a new black image with given size and channels
- PacketUpdateImage update part of the pixels of an opened image
§Example code:
use tev_client::{TevClient, TevError, PacketCreateImage};
fn main() -> Result<(), TevError> {
// Spawn a tev instance, this command assumes tev is on the PATH.
// There are other constructors available too, see TevClient::spawn and TevClient::wrap.
let mut client = TevClient::spawn_path_default()?;
// Create a new image
client.send(PacketCreateImage {
image_name: "test",
grab_focus: false,
width: 1920,
height: 1080,
channel_names: &["R", "G", "B"],
})?;
Ok(())
}Structs§
- Packet
Close Image - Close an image.
- Packet
Create Image - Create a new image with name
image_name, size (width,height) and channelschannel_names. - Packet
Open Image - Opens a new image where
image_nameis the path. - Packet
Reload Image - Reload an existing image with name or path
image_namefrom disk. - Packet
Update Image - Update part of an existing image with new pixel data.
- TevClient
- A connection to a Tev instance. Constructed using TevClient::wrap, TevClient::spawn or TevClient::spawn_path_default. Use TevClient::send to send commands.
Enums§
- TevError
- The error type returned by TevClient::spawn in case of an error.