fix: respect config film_type to force negative inversion

NegativeDetector now accepts an optional forced FilmType. When
film_type != "auto" in config.ini, auto-detection is skipped and
the configured type is applied directly. build_pipeline() in
CliRunner maps c41→ColorNegative and bw→BWNegative accordingly.

Default config changed from film_type=auto to film_type=c41 to
match the project's primary use case (C-41 color negatives).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Christoph K.
2026-03-14 09:56:39 +01:00
parent ee016b9a5a
commit e740234a06
4 changed files with 48 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
#include "CliRunner.h"
#include "../converter/pipeline/ImageData.h"
#include "../converter/rawloader/RawLoader.h"
#include "../converter/preprocess/Preprocessor.h"
#include "../converter/negative/NegativeDetector.h"
@@ -269,8 +270,17 @@ std::vector<std::filesystem::path> CliRunner::collect_files(
Pipeline CliRunner::build_pipeline(const AppConfig& app_cfg) {
Pipeline pipeline;
// Resolve forced film type from config.
// "auto" → Unknown (auto-detection), "c41" → ColorNegative, "bw" → BWNegative.
FilmType forced_film = FilmType::Unknown;
if (app_cfg.conversion.film_type == "c41") {
forced_film = FilmType::ColorNegative;
} else if (app_cfg.conversion.film_type == "bw") {
forced_film = FilmType::BWNegative;
}
pipeline.add_stage(std::make_unique<Preprocessor>());
pipeline.add_stage(std::make_unique<NegativeDetector>());
pipeline.add_stage(std::make_unique<NegativeDetector>(forced_film));
if (app_cfg.conversion.invert) {
pipeline.add_stage(std::make_unique<Inverter>());