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::{
|
||||
img::{Dimensions, RgbImage},
|
||||
snd::{RawSamples, Sample},
|
||||
snd::RawSamples,
|
||||
Bendable, DynamicBendable, OpenError,
|
||||
};
|
||||
use clap::Parser;
|
||||
|
@ -17,14 +17,9 @@ fn main() -> Result<(), OpenError> {
|
|||
width: i.width(),
|
||||
height: i.height(),
|
||||
};
|
||||
RawSamples::from(
|
||||
RawSamples::<u16>::bend_from(i, (), bingus::Crop::End)
|
||||
RawSamples::<u32>::bend_from(i, (), bingus::Crop::End)
|
||||
.unwrap()
|
||||
.as_ref()
|
||||
.iter()
|
||||
.map(|s| s.to_sample::<u8>().to_sample())
|
||||
.collect::<Vec<u16>>(),
|
||||
)
|
||||
.map(|s| s.abs_diff(s.wrapping_neg()))
|
||||
.bend_into::<RgbImage>(dimensions, bingus::Crop::End)
|
||||
.unwrap()
|
||||
.save(args.output_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue