fimg/benches/drawing.rs

22 lines
602 B
Rust
Raw Normal View History

2023-10-03 19:50:20 -05:00
use fimg::*;
2023-11-01 06:57:42 -05:00
use umath::{generic_float::Constructors, FF32};
2023-10-03 19:50:20 -05:00
fn tri() {
2023-10-03 23:32:03 -05:00
let mut i: Image<_, 4> = fimg::make!(4 channels 1000 x 1000).boxed();
2023-11-01 06:57:42 -05:00
unsafe {
i.tri::<FF32>(
(FF32::zero(), FF32::zero()),
(FF32::new(1000.), FF32::new(500.)),
(FF32::zero(), FF32::new(999.)),
[255, 255, 255, 255],
)
};
2023-10-31 22:21:24 -05:00
iai::black_box(i);
2023-10-03 19:50:20 -05:00
}
2023-10-31 22:21:24 -05:00
fn line() {
let mut i: Image<_, 4> = fimg::make!(4 channels 500 x 750).boxed();
i.line((-50, 20), (550, 800), [255, 165, 0, 255]);
i.save("z.png");
iai::black_box(i);
}
iai::main!(tri, line);