update to servicepoint v0.14.1
This commit is contained in:
parent
63a2fd00b9
commit
57181b508f
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -1569,8 +1569,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servicepoint"
|
name = "servicepoint"
|
||||||
version = "0.14.0"
|
version = "0.14.1"
|
||||||
source = "git+https://git.berlin.ccc.de/servicepoint/servicepoint/?branch=next#8ddbaeaaa64a4abb8ffb8b08a3a84cc1135e312f"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f6bd5cfa49c73aeecb344680ffbf697abf73e0563a441b93b9723ae43867500f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitvec",
|
"bitvec",
|
||||||
"log",
|
"log",
|
||||||
|
|
|
@ -22,9 +22,7 @@ fast_image_resize = { version = "5.1.2", features = ["image"] }
|
||||||
|
|
||||||
[dependencies.servicepoint]
|
[dependencies.servicepoint]
|
||||||
package = "servicepoint"
|
package = "servicepoint"
|
||||||
version = "0.14.0"
|
version = "0.14.1"
|
||||||
git = "https://git.berlin.ccc.de/servicepoint/servicepoint/"
|
|
||||||
branch = "next"
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true # Enable link-time optimization
|
lto = true # Enable link-time optimization
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::net::UdpSocket;
|
use std::net::UdpSocket;
|
||||||
use crate::cli::BrightnessCommand;
|
use crate::cli::BrightnessCommand;
|
||||||
use log::info;
|
use log::info;
|
||||||
use servicepoint::{Brightness, GlobalBrightnessCommand, SendCommandExt};
|
use servicepoint::{Brightness, GlobalBrightnessCommand, UdpSocketExt};
|
||||||
|
|
||||||
pub(crate) fn brightness(connection: &UdpSocket, brightness_command: BrightnessCommand) {
|
pub(crate) fn brightness(connection: &UdpSocket, brightness_command: BrightnessCommand) {
|
||||||
match brightness_command {
|
match brightness_command {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//! Based on https://github.com/WarkerAnhaltRanger/CCCB_Ledwand
|
//! Based on https://github.com/WarkerAnhaltRanger/CCCB_Ledwand
|
||||||
|
|
||||||
use image::GrayImage;
|
use image::GrayImage;
|
||||||
use servicepoint::{BitVecU8Msb0, Bitmap, PIXEL_HEIGHT};
|
use servicepoint::{DisplayBitVec, Bitmap, PIXEL_HEIGHT};
|
||||||
|
|
||||||
type GrayHistogram = [usize; 256];
|
type GrayHistogram = [usize; 256];
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap {
|
||||||
assert_eq!(width % 8, 0);
|
assert_eq!(width % 8, 0);
|
||||||
|
|
||||||
let mut source = source.into_raw();
|
let mut source = source.into_raw();
|
||||||
let mut destination = BitVecU8Msb0::repeat(false, source.len());
|
let mut destination = DisplayBitVec::repeat(false, source.len());
|
||||||
|
|
||||||
for y in 0..height as usize {
|
for y in 0..height as usize {
|
||||||
let start = y * width as usize;
|
let start = y * width as usize;
|
||||||
|
@ -206,7 +206,7 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn ostromoukhov_dither_pixel(
|
fn ostromoukhov_dither_pixel(
|
||||||
source: &mut [u8],
|
source: &mut [u8],
|
||||||
destination: &mut BitVecU8Msb0,
|
destination: &mut DisplayBitVec,
|
||||||
position: usize,
|
position: usize,
|
||||||
width: usize,
|
width: usize,
|
||||||
last_row: bool,
|
last_row: bool,
|
||||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
||||||
stream_window::stream_window
|
stream_window::stream_window
|
||||||
};
|
};
|
||||||
use log::info;
|
use log::info;
|
||||||
use servicepoint::{BinaryOperation, BitVecCommand, BitVecU8Msb0, BitmapCommand, ClearCommand, CompressionCode, Origin, SendCommandExt, PIXEL_COUNT};
|
use servicepoint::{BinaryOperation, BitVecCommand, UdpSocketExt, BitmapCommand, ClearCommand, CompressionCode, DisplayBitVec, Origin, PIXEL_COUNT};
|
||||||
|
|
||||||
pub(crate) fn pixels(connection: &UdpSocket, pixel_command: PixelCommand) {
|
pub(crate) fn pixels(connection: &UdpSocket, pixel_command: PixelCommand) {
|
||||||
match pixel_command {
|
match pixel_command {
|
||||||
|
@ -24,7 +24,7 @@ pub(crate) fn pixels(connection: &UdpSocket, pixel_command: PixelCommand) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pixels_on(connection: &UdpSocket) {
|
fn pixels_on(connection: &UdpSocket) {
|
||||||
let mask = BitVecU8Msb0::repeat(true, PIXEL_COUNT);
|
let mask = DisplayBitVec::repeat(true, PIXEL_COUNT);
|
||||||
let command = BitVecCommand{offset: 0, bitvec: mask, compression: CompressionCode::Lzma, operation: BinaryOperation::Overwrite};
|
let command = BitVecCommand{offset: 0, bitvec: mask, compression: CompressionCode::Lzma, operation: BinaryOperation::Overwrite};
|
||||||
connection
|
connection
|
||||||
.send_command(command)
|
.send_command(command)
|
||||||
|
@ -33,7 +33,7 @@ fn pixels_on(connection: &UdpSocket) {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pixels_invert(connection: &UdpSocket) {
|
fn pixels_invert(connection: &UdpSocket) {
|
||||||
let mask = BitVecU8Msb0::repeat(true, PIXEL_COUNT);
|
let mask = DisplayBitVec::repeat(true, PIXEL_COUNT);
|
||||||
let command = BitVecCommand{offset: 0, bitvec: mask, compression: CompressionCode::Lzma, operation: BinaryOperation::Xor};
|
let command = BitVecCommand{offset: 0, bitvec: mask, compression: CompressionCode::Lzma, operation: BinaryOperation::Xor};
|
||||||
connection
|
connection
|
||||||
.send_command(command)
|
.send_command(command)
|
||||||
|
|
|
@ -10,7 +10,7 @@ use scap::{
|
||||||
frame::convert_bgra_to_rgb,
|
frame::convert_bgra_to_rgb,
|
||||||
frame::Frame,
|
frame::Frame,
|
||||||
};
|
};
|
||||||
use servicepoint::{BitmapCommand, CompressionCode, Origin, SendCommandExt, FRAME_PACING};
|
use servicepoint::{BitmapCommand, CompressionCode, Origin, UdpSocketExt, FRAME_PACING};
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
pub fn stream_window(
|
pub fn stream_window(
|
||||||
|
|
Loading…
Reference in a new issue