Add image adjustments pipeline (brightness, contrast, crop, effects)

This commit is contained in:
2026-03-06 14:24:14 +02:00
parent 600b36279e
commit f3dc164018
6 changed files with 268 additions and 0 deletions

View File

@@ -1163,6 +1163,34 @@ fn run_processing(_window: &adw::ApplicationWindow, ui: &WizardUi) {
_ => pixstrip_core::operations::Flip::None,
});
// Adjustments
{
let crop = match cfg.crop_aspect_ratio {
1 => Some((1.0, 1.0)),
2 => Some((4.0, 3.0)),
3 => Some((3.0, 2.0)),
4 => Some((16.0, 9.0)),
5 => Some((9.0, 16.0)),
6 => Some((3.0, 4.0)),
7 => Some((2.0, 3.0)),
_ => None,
};
let adj = pixstrip_core::operations::AdjustmentsConfig {
brightness: cfg.brightness,
contrast: cfg.contrast,
saturation: cfg.saturation,
sharpen: cfg.sharpen,
grayscale: cfg.grayscale,
sepia: cfg.sepia,
crop_aspect_ratio: crop,
trim_whitespace: cfg.trim_whitespace,
canvas_padding: cfg.canvas_padding,
};
if !adj.is_noop() {
job.adjustments = Some(adj);
}
}
// Watermark
if cfg.watermark_enabled {
let position = match cfg.watermark_position {