some more complex sample manipulation example
This commit is contained in:
parent
bf58d2cd51
commit
299887ff84
1 changed files with 8 additions and 13 deletions
|
@ -1,6 +1,6 @@
|
||||||
use bingus::{
|
use bingus::{
|
||||||
img::{Dimensions, RgbImage},
|
img::{Dimensions, RgbImage},
|
||||||
snd::{RawSamples, Sample},
|
snd::RawSamples,
|
||||||
Bendable, DynamicBendable, OpenError,
|
Bendable, DynamicBendable, OpenError,
|
||||||
};
|
};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
@ -17,14 +17,9 @@ fn main() -> Result<(), OpenError> {
|
||||||
width: i.width(),
|
width: i.width(),
|
||||||
height: i.height(),
|
height: i.height(),
|
||||||
};
|
};
|
||||||
RawSamples::from(
|
RawSamples::<u32>::bend_from(i, (), bingus::Crop::End)
|
||||||
RawSamples::<u16>::bend_from(i, (), bingus::Crop::End)
|
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.as_ref()
|
.map(|s| s.abs_diff(s.wrapping_neg()))
|
||||||
.iter()
|
|
||||||
.map(|s| s.to_sample::<u8>().to_sample())
|
|
||||||
.collect::<Vec<u16>>(),
|
|
||||||
)
|
|
||||||
.bend_into::<RgbImage>(dimensions, bingus::Crop::End)
|
.bend_into::<RgbImage>(dimensions, bingus::Crop::End)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.save(args.output_file)
|
.save(args.output_file)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue