mirror of
https://github.com/bend-n/fimg.git
synced 2024-12-22 10:28:21 -06:00
fix affine bench
This commit is contained in:
parent
fd41988c10
commit
e2128bb9f2
|
@ -12,9 +12,10 @@ macro_rules! bench {
|
||||||
64.try_into().unwrap(),
|
64.try_into().unwrap(),
|
||||||
include_bytes!("4_180x180.imgbuf").to_vec(),
|
include_bytes!("4_180x180.imgbuf").to_vec(),
|
||||||
);
|
);
|
||||||
b.iter(|| {
|
#[allow(unused_unsafe)]
|
||||||
|
b.iter(|| unsafe {
|
||||||
for _ in 0..256 {
|
for _ in 0..256 {
|
||||||
img.flip_h();
|
img.$fn();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ impl<const CHANNELS: usize> Image<&mut [u8], CHANNELS> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip a image horizontally.
|
/// Flip a image horizontally.
|
||||||
fn flip_h(&mut self) {
|
pub fn flip_h(&mut self) {
|
||||||
for y in 0..self.height() {
|
for y in 0..self.height() {
|
||||||
for x in 0..self.width() / 2 {
|
for x in 0..self.width() / 2 {
|
||||||
let x2 = self.width() - x - 1;
|
let x2 = self.width() - x - 1;
|
||||||
|
|
Loading…
Reference in a new issue