Crates.io | pixelflut |
lib.rs | pixelflut |
version | 0.2.0 |
source | src |
created_at | 2019-04-22 14:58:19.904958 |
updated_at | 2021-08-01 19:58:07.486221 |
description | An async/sync Pixelflut server/client library |
homepage | https://github.com/rappet/rust-pixelflut |
repository | https://github.com/rappet/rust-pixelflut |
max_upload_size | |
id | 129486 |
size | 67,840 |
A sync and async implementation of the Pixelflut protocol for Rust.
Import in rust project:
[dependencies]
pixelflut = "0.2.0-alpha.2"
image
: Enable support for color types used in the image
cratetokio-rt
: Enable support for the async client/serverThe async client archived >450MByte/s to localhost on an Apple m1. The server code needs improvement.
If you want to send data faster, spawn multiple clients or use the internal
PixelBuffer
if you want to send allways the same data.
extern crate pixelflut;
extern crate tokio;
use pixelflut::async_tokio::PixelflutClient;
use std::net::SocketAddr;
#[tokio::main]
async fn main() {
let addr: SocketAddr = "127.0.0.1:1337".parse().unwrap();
let mut pixelflut = PixelflutClient::connect(addr).await.unwrap();
println!("{:?}", pixelflut.dimensions().await.unwrap());
pixelflut.set(1, 2, (255, 0, 0)).await.unwrap();
pixelflut.flush().await.unwrap();
}
This project is licensed under the MIT license.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in rust-pixelflut by you, shall be licensed as MIT, without any additional terms or conditions.