mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-18 18:38:05 +08:00
* Update to rust 2024 edition * Fixes * Clean up imports * Cargo fmt again --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
12 lines
344 B
Rust
12 lines
344 B
Rust
use crate::RawPixel;
|
|
use crate::{RawImage, SubtractBlack};
|
|
|
|
impl RawImage {
|
|
pub fn subtract_black_fn(&self) -> impl Fn(RawPixel) -> u16 + use<> {
|
|
match self.black {
|
|
SubtractBlack::CfaGrid(black_levels) => move |pixel: RawPixel| pixel.value.saturating_sub(black_levels[2 * (pixel.row % 2) + (pixel.column % 2)]),
|
|
_ => todo!(),
|
|
}
|
|
}
|
|
}
|