chore: initial project scaffold from architecture design
- Add CLAUDE.md with project overview, tech stack, build commands, architecture description, coding standards, and sample images section - Add full directory structure: src/, docs/, tests/, import/ - Add CMakeLists.txt with C++20, OpenCV/LibRaw/Qt6 dependencies, converter_core static lib, optional GUI, and GTest tests - Add architecture documentation: ARCHITECTURE.md, PIPELINE.md, MODULES.md - Add source skeletons for all pipeline stages: RawLoader, Preprocessor, NegativeDetector, Inverter, ColorCorrector, CropProcessor, OutputWriter, Pipeline, MainWindow, CliRunner, main.cpp - Add initial test stubs for pipeline and rawloader - Add sample ARW files in import/ for integration testing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
63
src/converter/pipeline/ImageData.h
Normal file
63
src/converter/pipeline/ImageData.h
Normal file
@@ -0,0 +1,63 @@
|
||||
#pragma once
|
||||
|
||||
#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
|
||||
};
|
||||
|
||||
} // namespace photoconv
|
||||
Reference in New Issue
Block a user