diff --git a/crates/servicepoint/src/bitmap.rs b/crates/servicepoint/src/bitmap.rs index 657e155..d7d7a77 100644 --- a/crates/servicepoint/src/bitmap.rs +++ b/crates/servicepoint/src/bitmap.rs @@ -2,14 +2,14 @@ use bitvec::order::Msb0; use bitvec::prelude::BitSlice; use bitvec::slice::IterMut; -use crate::{BitVec, DataRef, Grid, SpBitVec, PIXEL_HEIGHT, PIXEL_WIDTH}; +use crate::{BitVec, DataRef, Grid, PIXEL_HEIGHT, PIXEL_WIDTH}; /// A grid of pixels stored in packed bytes. #[derive(Debug, Clone, PartialEq)] pub struct Bitmap { width: usize, height: usize, - bit_vec: SpBitVec, + bit_vec: BitVec, } impl Bitmap { diff --git a/crates/servicepoint/src/command.rs b/crates/servicepoint/src/command.rs index eead79d..8d42530 100644 --- a/crates/servicepoint/src/command.rs +++ b/crates/servicepoint/src/command.rs @@ -1,11 +1,9 @@ -use bitvec::prelude::BitVec; - use crate::{ command_code::CommandCode, compression::into_decompressed, packet::{Header, Packet}, Bitmap, Brightness, BrightnessGrid, CompressionCode, Cp437Grid, Origin, - Pixels, PrimitiveGrid, SpBitVec, Tiles, TILE_SIZE, + Pixels, PrimitiveGrid, BitVec, Tiles, TILE_SIZE, }; /// Type alias for documenting the meaning of the u16 in enum values @@ -144,7 +142,7 @@ pub enum Command { /// once the starting row is full, overwriting will continue on column 0. /// /// The contained [BitVec] is always uncompressed. - BitmapLinear(Offset, SpBitVec, CompressionCode), + BitmapLinear(Offset, BitVec, CompressionCode), /// Set pixel data according to an and-mask starting at the offset. /// @@ -152,7 +150,7 @@ pub enum Command { /// once the starting row is full, overwriting will continue on column 0. /// /// The contained [BitVec] is always uncompressed. - BitmapLinearAnd(Offset, SpBitVec, CompressionCode), + BitmapLinearAnd(Offset, BitVec, CompressionCode), /// Set pixel data according to an or-mask starting at the offset. /// @@ -160,7 +158,7 @@ pub enum Command { /// once the starting row is full, overwriting will continue on column 0. /// /// The contained [BitVec] is always uncompressed. - BitmapLinearOr(Offset, SpBitVec, CompressionCode), + BitmapLinearOr(Offset, BitVec, CompressionCode), /// Set pixel data according to a xor-mask starting at the offset. /// @@ -168,7 +166,7 @@ pub enum Command { /// once the starting row is full, overwriting will continue on column 0. /// /// The contained [BitVec] is always uncompressed. - BitmapLinearXor(Offset, SpBitVec, CompressionCode), + BitmapLinearXor(Offset, BitVec, CompressionCode), /// Kills the udp daemon on the display, which usually results in a restart. /// @@ -374,7 +372,7 @@ impl Command { /// Helper method for Packets into `BitmapLinear*`-Commands fn packet_into_linear_bitmap( packet: Packet, - ) -> Result<(SpBitVec, CompressionCode), TryFromPacketError> { + ) -> Result<(BitVec, CompressionCode), TryFromPacketError> { let Packet { header: Header { diff --git a/crates/servicepoint/src/lib.rs b/crates/servicepoint/src/lib.rs index 39b4077..3c1fc02 100644 --- a/crates/servicepoint/src/lib.rs +++ b/crates/servicepoint/src/lib.rs @@ -38,7 +38,6 @@ use std::time::Duration; pub use bitvec; -use bitvec::prelude::{BitVec, Msb0}; pub use crate::bitmap::Bitmap; pub use crate::brightness::{Brightness, BrightnessGrid}; @@ -51,7 +50,8 @@ pub use crate::grid::Grid; pub use crate::origin::{Origin, Pixels, Tiles}; pub use crate::primitive_grid::PrimitiveGrid; -type SpBitVec = BitVec; +/// An alias for the specific type of [bitvec::prelude::BitVec] used. +pub type BitVec = bitvec::prelude::BitVec; mod bitmap; mod brightness;