update to servicepoint v0.14.1
This commit is contained in:
parent
63a2fd00b9
commit
57181b508f
6 changed files with 12 additions and 13 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::net::UdpSocket;
|
||||
use crate::cli::BrightnessCommand;
|
||||
use log::info;
|
||||
use servicepoint::{Brightness, GlobalBrightnessCommand, SendCommandExt};
|
||||
use servicepoint::{Brightness, GlobalBrightnessCommand, UdpSocketExt};
|
||||
|
||||
pub(crate) fn brightness(connection: &UdpSocket, brightness_command: BrightnessCommand) {
|
||||
match brightness_command {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
//! Based on https://github.com/WarkerAnhaltRanger/CCCB_Ledwand
|
||||
|
||||
use image::GrayImage;
|
||||
use servicepoint::{BitVecU8Msb0, Bitmap, PIXEL_HEIGHT};
|
||||
use servicepoint::{DisplayBitVec, Bitmap, PIXEL_HEIGHT};
|
||||
|
||||
type GrayHistogram = [usize; 256];
|
||||
|
||||
|
@ -169,7 +169,7 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap {
|
|||
assert_eq!(width % 8, 0);
|
||||
|
||||
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 {
|
||||
let start = y * width as usize;
|
||||
|
@ -206,7 +206,7 @@ pub(crate) fn ostromoukhov_dither(source: GrayImage, bias: u8) -> Bitmap {
|
|||
#[inline]
|
||||
fn ostromoukhov_dither_pixel(
|
||||
source: &mut [u8],
|
||||
destination: &mut BitVecU8Msb0,
|
||||
destination: &mut DisplayBitVec,
|
||||
position: usize,
|
||||
width: usize,
|
||||
last_row: bool,
|
||||
|
|
|
@ -5,7 +5,7 @@ use crate::{
|
|||
stream_window::stream_window
|
||||
};
|
||||
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) {
|
||||
match pixel_command {
|
||||
|
@ -24,7 +24,7 @@ pub(crate) fn pixels(connection: &UdpSocket, pixel_command: PixelCommand) {
|
|||
}
|
||||
|
||||
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};
|
||||
connection
|
||||
.send_command(command)
|
||||
|
@ -33,7 +33,7 @@ fn pixels_on(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};
|
||||
connection
|
||||
.send_command(command)
|
||||
|
|
|
@ -10,7 +10,7 @@ use scap::{
|
|||
frame::convert_bgra_to_rgb,
|
||||
frame::Frame,
|
||||
};
|
||||
use servicepoint::{BitmapCommand, CompressionCode, Origin, SendCommandExt, FRAME_PACING};
|
||||
use servicepoint::{BitmapCommand, CompressionCode, Origin, UdpSocketExt, FRAME_PACING};
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
pub fn stream_window(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue