Files
negative-converter/src/converter/pipeline/ImageData.h
Christoph K. 4e4e19e80d feat: fix Docker Windows cross-compile and add color grading
- Fix MXE GPG key import (gpg --dearmor + signed-by)
- Fix MXE package names (opencv4→opencv)
- Use Ubuntu 20.04 base for windows-builder (MXE focal compatibility)
- Install CMake 3.20+ from Kitware PPA for windows-builder
- Add ColorGradingParams.h for color grading pipeline
- Update ColorCorrector, AppConfig, MainWindow, ImageData, CliRunner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-15 09:49:42 +01:00

67 lines
2.0 KiB
C++

#pragma once
#include "../color/ColorGradingParams.h"
#include <opencv2/core.hpp>
#include <cstdint>
#include <optional>
#include <string>
namespace photoconv {
/**
* @brief Film type classification for processing decisions.
*/
enum class FilmType {
Unknown,
ColorNegative, // C-41 process
BWNegative, // B&W negative
ColorPositive, // Slide / E-6
BWPositive, // B&W positive
};
/**
* @brief RAW metadata extracted from the image file.
*
* Populated by the Loader stage and carried through the pipeline
* for use by downstream stages (e.g., color correction using WB data).
*/
struct RawMetadata {
std::string camera_make; // e.g. "Sony", "Canon", "Nikon"
std::string camera_model; // e.g. "ILCE-7M3"
float iso_speed{0.0f};
float shutter_speed{0.0f}; // seconds
float aperture{0.0f}; // f-number
float focal_length{0.0f}; // mm
float wb_red{1.0f}; // White balance multipliers
float wb_green{1.0f};
float wb_blue{1.0f};
int raw_width{0};
int raw_height{0};
int raw_bit_depth{0}; // Bits per channel in source
std::string timestamp; // ISO 8601
};
/**
* @brief Core data structure flowing through the entire pipeline.
*
* Every pipeline stage receives an ImageData, transforms it, and
* returns a new ImageData (or Error) via std::expected.
*
* Invariants:
* - rgb is always CV_16UC3 (16-bit, 3-channel BGR)
* - metadata is populated after the Loader stage
* - film_type is set after the Detect stage
*/
struct ImageData {
cv::Mat rgb; // 16-bit BGR (CV_16UC3)
std::string source_path; // Original file path
RawMetadata metadata; // Camera/RAW metadata
FilmType film_type{FilmType::Unknown}; // Detected after Detect stage
std::optional<cv::Rect> crop_region; // Set by Crop stage
ColorGradingParams color_params{}; // User-defined color grading overrides
};
} // namespace photoconv