encode_area seems to work, ~4.6ns/pixel

This commit is contained in:
IQuant 2024-09-27 17:42:42 +03:00
parent 985bb6dbe2
commit fb4a392b97
8 changed files with 266 additions and 45 deletions

View file

@ -25,6 +25,10 @@ pub(crate) struct RawPixel {
pub flags: u8,
}
struct ByteParser<'a> {
data: &'a [u8],
}
/// Stores a run of pixels.
/// Not specific to Noita side - length is an actual length
#[derive(Debug, Clone, Copy, Serialize, Deserialize, PartialEq, Eq, Encode, Decode)]
@ -33,10 +37,6 @@ pub struct PixelRun<Pixel> {
pub data: Pixel,
}
struct ByteParser<'a> {
data: &'a [u8],
}
/// Converts a normal sequence of pixels to a run-length-encoded one.
pub struct PixelRunner<Pixel> {
current_pixel: Option<Pixel>,