From 43da761a4ea9ceec79daa77a763dcd01d2474b31 Mon Sep 17 00:00:00 2001 From: bendn Date: Mon, 2 Oct 2023 12:39:58 +0700 Subject: [PATCH] optimize Image::repeat also removes some unsafe --- Cargo.toml | 10 +++- README.md | 8 +-- benches/tile.rs | 6 +++ src/lib.rs | 129 +++++++++++++++++++++++++++++------------------- src/overlay.rs | 21 ++------ 5 files changed, 100 insertions(+), 74 deletions(-) create mode 100644 benches/tile.rs diff --git a/Cargo.toml b/Cargo.toml index 8491fda..3ade076 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fimg" -version = "0.4.11" +version = "0.4.12" authors = ["bend-n "] license = "MIT" edition = "2021" @@ -12,7 +12,8 @@ exclude = ["tdata", "benches/", ".gitignore"] png = { version = "0.17", features = ["unstable"], optional = true } [dev-dependencies] -iai = { version = "0.1.1", features = [], git = "https://github.com/bend-n/iai/" } +iai = { version = "0.1.1", features = [ +], git = "https://github.com/bend-n/iai/" } [[bench]] name = "overlays" @@ -24,6 +25,11 @@ name = "affine_transformations" path = "benches/affine_transformations.rs" harness = false +[[bench]] +name = "tile" +path = "benches/tile.rs" +harness = false + [features] save = ["png"] default = ["save"] diff --git a/README.md b/README.md index 8e36c96..6461e12 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,12 @@ quick simple image operations - [x] overlay - [x] rotation - [x] flipping +- [x] image tiling - [x] nearest neighbor scaling - [x] triangle drawing - [x] simple line drawing - [x] box drawing -- [ ] thick box drawing -- [ ] thick line drawing -- [ ] polygon drawing +- [x] thick box drawing +- [x] thick line drawing +- [x] polygon drawing +- [x] circle drawing diff --git a/benches/tile.rs b/benches/tile.rs new file mode 100644 index 0000000..9d47d28 --- /dev/null +++ b/benches/tile.rs @@ -0,0 +1,6 @@ +use fimg::*; +fn repeat() { + let x: Image<&[u8], 3> = Image::build(8, 8).buf(include_bytes!("3_8x8.imgbuf")); + let _ = unsafe { x.repeated(128, 128) }; // repeat 16 times +} +iai::main!(repeat); diff --git a/src/lib.rs b/src/lib.rs index 21fe345..945a929 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,34 +60,48 @@ macro_rules! assert_unchecked { use assert_unchecked; impl Image<&[u8], 3> { - /// Repeat self till it fills a new image of size x, y + /// Tile self till it fills a new image of size x, y /// # Safety /// /// UB if self's width is not a multiple of x, or self's height is not a multiple of y + /// ``` + /// # use fimg::Image; + /// let x: Image<&[u8], 3> = Image::build(8, 8).buf(include_bytes!("../benches/3_8x8.imgbuf")); + /// let tiled = unsafe { x.repeated(48, 48) }; // repeat 6 times + /// # assert_eq!(tiled.buffer(), b"\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xf7\xcb\xa4\xf7\xcb\xa4\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xf7\xcb\xa4\xf7\xcb\xa4\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\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\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d\xd3\xae\x8d") + /// ``` #[must_use = "function does not modify the original image"] - pub unsafe fn repeated(&self, x: u32, y: u32) -> Image, 3> { - let mut img = Image::alloc(x, y); // could probably optimize this a ton but eh - for x in 0..(x / self.width()) { - for y in 0..(y / self.height()) { - let a: &mut Image<&mut [u8], 3> = &mut img.as_mut(); - // SAFETY: caller upholds - unsafe { a.overlay_at(self, x * self.width(), y * self.height()) }; + pub unsafe fn repeated(&self, out_width: u32, out_height: u32) -> Image, 3> { + let mut img = Image::<_, 3>::alloc(out_width, out_height); + for y in 0..self.height() { + // SAFETY: get one row of pixels + let from = unsafe { + self.buffer + .get_unchecked(self.at(0, y)..self.at(0, y) + (self.width() as usize * 3)) + }; + debug_assert_eq!(from.len(), self.width() as usize * 3); + let first = img.at(0, y)..img.at(self.width(), y); + // SAFETY: put it in the output + let to = unsafe { img.buffer.get_unchecked_mut(first.clone()) }; + // copy it in + to.copy_from_slice(from); + for x in 1..(out_width / self.width()) { + let section = img.at(x * self.width(), y); + // SAFETY: copy each row of the image one by one + unsafe { img.copy_within(first.clone(), section) }; } } + + let first_row = 0..img.at(0, self.height()); + for y in 1..(out_height / self.height()) { + let this_row = img.at(0, y * self.height()); + // SAFETY: copy entire blocks of image at a time + unsafe { img.copy_within(first_row.clone(), this_row) }; + } img } } -/// calculates a column major index, with unchecked math -#[inline] -unsafe fn really_unsafe_index(x: u32, y: u32, w: u32) -> usize { - // y * w + x - // SAFETY: FIXME make safe math - let tmp = unsafe { (y as usize).unchecked_mul(w as usize) }; - // SAFETY: FIXME make safe math - unsafe { tmp.unchecked_add(x as usize) } -} - /// A image with a variable number of channels, and a nonzero size. #[derive(Debug, PartialEq, Eq)] pub struct Image { @@ -235,19 +249,33 @@ impl Image<&[u8], CHANNELS> { impl, const CHANNELS: usize> Image { /// # Safety /// - /// - UB if x, y is out of bounds - /// - UB if buffer is too small + /// the output index is not guranteed to be in bounds #[inline] - unsafe fn slice(&self, x: u32, y: u32) -> impl SliceIndex<[u8], Output = [u8]> { + fn slice(&self, x: u32, y: u32) -> impl SliceIndex<[u8], Output = [u8]> { + let index = self.at(x, y); + // SAFETY: as long as the buffer isnt wrong, this is ๐Ÿ˜„ + index..unsafe { index.unchecked_add(CHANNELS) } + } + + /// # Safety + /// + /// the output index is not guranteed to be in bounds + #[inline] + fn at(&self, x: u32, y: u32) -> usize { debug_assert!(x < self.width(), "x out of bounds"); debug_assert!(y < self.height(), "y out of bounds"); - // SAFETY: me when uncheck math: ๐Ÿ˜ง - let index = unsafe { really_unsafe_index(x, y, self.width()) }; + #[allow(clippy::multiple_unsafe_ops_per_block)] + // SAFETY: me when uncheck math: ๐Ÿ˜ง (FIXME) + let index = unsafe { + let w = self.width(); + // y * w + x + let tmp = (y as usize).unchecked_mul(w as usize); + tmp.unchecked_add(x as usize) + }; // SAFETY: ๐Ÿง is unsound? ๐Ÿ˜– let index = unsafe { index.unchecked_mul(CHANNELS) }; debug_assert!(self.buffer.len() > index); - // SAFETY: as long as the buffer isnt wrong, this is ๐Ÿ˜„ - index..unsafe { index.unchecked_add(CHANNELS) } + index } /// Procure a [`ImageCloner`]. @@ -286,10 +314,8 @@ impl, const CHANNELS: usize> Image [u8; CHANNELS] { - // SAFETY: we have been told x, y is in bounds - let idx = unsafe { self.slice(x, y) }; - // SAFETY: slice always returns a valid index - let ptr = unsafe { self.buffer.get_unchecked(idx).as_ptr().cast() }; + // SAFETY: x and y in bounds, slice is okay + let ptr = unsafe { self.buffer.get_unchecked(self.slice(x, y)).as_ptr().cast() }; // SAFETY: slice always returns a length of `CHANNELS`, so we `cast()` it for convenience. unsafe { *ptr } } @@ -304,7 +330,7 @@ impl, const CHANNELS: usize> Image &mut [u8] { // SAFETY: we have been told x, y is in bounds. - let idx = unsafe { self.slice(x, y) }; + let idx = self.slice(x, y); // SAFETY: slice should always return a valid index unsafe { self.buffer.get_unchecked_mut(idx) } } @@ -332,6 +358,25 @@ impl, const CHANNELS: usize> Image() } } + /// # Safety + /// + /// panicless version of [`[T]::copy_within`](`slice::copy_within`), where the slices cant overlap. this uses `memcpy`. + /// your slices must be in bounds. + /// this isnt a public function, so im not going to say exactly what "in bounds" meeans. + unsafe fn copy_within(&mut self, src: std::ops::Range, dest: usize) { + let std::ops::Range { start, end } = src; + debug_assert!( + dest <= self.buffer.len() - end - start, + "dest is out of bounds" + ); + #[allow(clippy::multiple_unsafe_ops_per_block)] + // SAFETY: the caller better be good + unsafe { + let ptr = self.buffer.as_mut_ptr(); + std::ptr::copy_nonoverlapping(ptr.add(start), ptr.add(dest), end - start) + }; + } + /// Set the pixel at x, y /// /// # Safety @@ -375,17 +420,7 @@ impl Image, CHANNELS> { /// helper macro for defining the save() method. macro_rules! save { ($channels:literal == $clr:ident ($clrhuman:literal)) => { - impl Image, $channels> { - #[cfg(feature = "save")] - #[doc = "Save this "] - #[doc = $clrhuman] - #[doc = " image."] - pub fn save(&self, f: impl AsRef) { - self.as_ref().save(f) - } - } - - impl Image<&[u8], $channels> { + impl> Image { #[cfg(feature = "save")] #[doc = "Save this "] #[doc = $clrhuman] @@ -404,7 +439,7 @@ macro_rules! save { (0.15000, 0.06000), )); let mut writer = enc.write_header().unwrap(); - writer.write_image_data(self.buffer).unwrap(); + writer.write_image_data(&self.buffer).unwrap(); } } }; @@ -446,13 +481,3 @@ macro_rules! img { } #[cfg(test)] use img; - -#[cfg(test)] -mod tests { - use super::*; - #[test] - fn repeat() { - let x: Image<&[u8], 3> = Image::build(8, 8).buf(include_bytes!("../benches/3_8x8.imgbuf")); - let _ = unsafe { x.repeated(128, 128) }; // repeat 16 times - } -} diff --git a/src/overlay.rs b/src/overlay.rs index 06b6c79..d85d384 100644 --- a/src/overlay.rs +++ b/src/overlay.rs @@ -1,7 +1,7 @@ //! Handles image overlay use crate::cloner::ImageCloner; -use super::{assert_unchecked, really_unsafe_index, Image}; +use super::{assert_unchecked, Image}; use std::ops::{Deref, DerefMut}; use std::simd::{simd_swizzle, Simd, SimdInt, SimdPartialOrd}; @@ -242,27 +242,14 @@ impl, U: Deref> OverlayAt> /// /// # Safety /// - UB if x, y is out of bounds - /// - UB if x + with.width() > [`u32::MAX`] - /// - UB if y + with.height() > [`u32::MAX`] unsafe fn overlay_at(&mut self, with: &Image, x: u32, y: u32) -> &mut Self { for j in 0..with.height() { for i in 0..with.width() { // SAFETY: i, j is in bounds. - let index = unsafe { really_unsafe_index(i, j, with.width()) }; - // SAFETY: using .pixel() results in horrible asm (+5k ns/iter) - let their_px = unsafe { with.buffer.get_unchecked(index * 4..index * 4 + 4) }; - // SAFETY: must be sized right - if unsafe { *their_px.get_unchecked(3) } >= 128 { - // SAFETY: - // they said it cant go over. - // i dont know why, but this has performance importanceโ„ข - let x = unsafe { i.unchecked_add(x) }; - // SAFETY: caller gurantees this cannot overflow. - let y = unsafe { j.unchecked_add(y) }; - // SAFETY: compute the offset index. - let index = unsafe { really_unsafe_index(x, y, self.width()) }; + let their_px = unsafe { &with.pixel(i, j) }; + if their_px[3] >= 128 { // SAFETY: if everything else goes well, this is fine - let our_px = unsafe { self.buffer.get_unchecked_mut(index * 4..index * 4 + 4) }; + let our_px = unsafe { self.pixel_mut(i + x, j + y) }; our_px.copy_from_slice(their_px); } }