mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-18 18:38:05 +08:00
Upgrade to the Rust 2024 edition (#2367)
* Update to rust 2024 edition * Fixes * Clean up imports * Cargo fmt again --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::{RawImage, RawPixel, SubtractBlack};
|
||||
|
||||
impl RawImage {
|
||||
pub fn scale_to_16bit_fn(&self) -> impl Fn(RawPixel) -> u16 {
|
||||
pub fn scale_to_16bit_fn(&self) -> impl Fn(RawPixel) -> u16 + use<> {
|
||||
let black_level = match self.black {
|
||||
SubtractBlack::CfaGrid(x) => x,
|
||||
_ => unreachable!(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::{RawImage, RawPixel};
|
||||
|
||||
impl RawImage {
|
||||
pub fn scale_white_balance_fn(&self) -> impl Fn(RawPixel) -> u16 {
|
||||
pub fn scale_white_balance_fn(&self) -> impl Fn(RawPixel) -> u16 + use<> {
|
||||
let Some(mut white_balance) = self.white_balance else { todo!() };
|
||||
|
||||
if white_balance[1] == 0. {
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::RawPixel;
|
||||
use crate::{RawImage, SubtractBlack};
|
||||
|
||||
impl RawImage {
|
||||
pub fn subtract_black_fn(&self) -> impl Fn(RawPixel) -> u16 {
|
||||
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!(),
|
||||
|
||||
Reference in New Issue
Block a user