mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
encode_area seems to work, ~4.6ns/pixel
This commit is contained in:
parent
985bb6dbe2
commit
fb4a392b97
8 changed files with 266 additions and 45 deletions
|
@ -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>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue