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:
54
src/main.cpp
Normal file
54
src/main.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
#include "cli/CliRunner.h"
|
||||
#include "gui/MainWindow.h"
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* @brief Application entry point.
|
||||
*
|
||||
* Supports two modes:
|
||||
* - GUI mode (default): launches the Qt MainWindow
|
||||
* - CLI mode (--cli flag): batch processes files without GUI
|
||||
*/
|
||||
int main(int argc, char* argv[]) {
|
||||
// Check if CLI mode is requested
|
||||
bool cli_mode = false;
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (std::string{argv[i]} == "--cli") {
|
||||
cli_mode = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (cli_mode) {
|
||||
// CLI batch mode (no Qt dependency)
|
||||
auto config_result = photoconv::CliRunner::parse_args(argc, argv);
|
||||
if (!config_result.has_value()) {
|
||||
std::cerr << config_result.error().format() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
photoconv::CliRunner runner;
|
||||
auto result = runner.run(config_result.value());
|
||||
if (!result.has_value()) {
|
||||
std::cerr << result.error().format() << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return result.value() > 0 ? 0 : 1;
|
||||
}
|
||||
|
||||
// GUI mode
|
||||
QApplication app(argc, argv);
|
||||
app.setApplicationName("Photo Converter");
|
||||
app.setApplicationVersion("0.1.0");
|
||||
|
||||
photoconv::MainWindow window;
|
||||
window.show();
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
Reference in New Issue
Block a user