Construct a complete, production-ready software system from ...
Prompt
Construct a complete, production-ready software system from scratch that simulates direct-flash camera optics, physical light propagation, and digital image post-processing to generate high-fidelity direct-flash night photography. Provide complete, unabridged, executable source code for every required file. Do not use placeholders, mock functions, simplified logic, omitted sections, or `TODO` comments. <SystemArchitecture> Implement the system as 4 modular components: 1. Light Engine and Spatial Propagation Module 2. Optical Camera and Sensor Simulation Engine 3. Digital Post-Processing and Color-Grading Pipeline 4. Execution Pipeline and System Interface </SystemArchitecture> <LightEngine> Implement a dedicated lighting module with these requirements: - Model an undiffused point-light source positioned strictly on-axis or coaxial with the camera lens’s optical axis. - Apply no softbox filtering, reflector cards, bounce lighting, angular diffusion, or other light-shaping modifications. - Implement inverse-square attenuation: \[ I(r)=\frac{I_0}{r^2} \] where \(r\) is the distance between the flash source and the illuminated surface. - Calibrate spatial decay so that foreground objects at 1.0–1.5 m receive full direct exposure, while background surfaces at distances of at least 3.0 m undergo extreme falloff resulting in \(EV \le 0\text{–}2\). - Calculate hard shadows along the lens-flash projection vector. Shadows must be tight, sharp silhouettes immediately behind occluding foreground geometry, with no soft penumbra transitions. </LightEngine> <OpticalCameraAndSensor> Implement an optical camera and digital sensor simulation with these requirements: - Support 24–35 mm equivalent focal lengths. - Apply subtle radial barrel distortion representative of wide-angle event photography. - Support aperture values from f/4.0 through f/8.0. - Calculate a depth-of-field map that preserves sharpness across foreground and midground subjects while limiting ambient photon accumulation. - Support shutter speeds from 1/125 s through 1/250 s and model flash synchronization. - Suppress ambient exposure relative to the instantaneous flash pulse. - Support ISO values from 100 through 400, with low sensor noise in correctly exposed regions. - Apply a daylight/flash white-balance transform calibrated from 5500 K through 6000 K. - Preserve a cool daylight baseline while retaining and enhancing naturally warm illuminated skin tones. </OpticalCameraAndSensor> <PostProcessing> Operate on high-dynamic-range image buffers and implement the following: - Detect specular reflections on glossy material regions, including skin lipids, lip gloss, polished metal, and jewelry. - Apply a thresholded highlight-transfer function that deliberately clips qualifying peak reflections to pure white, \(RGB=[255,255,255]\). - Apply a steep nonlinear S-curve that compresses low-luminance background values below a configurable threshold to pure black, \(RGB=[0,0,0]\). - Implement an unsharp mask and high-pass micro-contrast filter that increases edge acutance in structural boundaries, fabric texture, and hair strands. - Perform color-space transformations that selectively boost warm chromatic vectors, including pinks, reds, tans, browns, and warm skin tones, while preserving neutral crushed backgrounds. </PostProcessing> <Interfaces> Provide both: - A command-line interface. - A documented programmatic API. The interfaces must accept real scene inputs containing geometry, material reflectance properties or maps, depth information, and initial radiance values. Define and document an explicit scene-file schema and supported image or data formats. Validate all input dimensions, ranges, coordinate systems, units, and required fields, returning actionable errors for invalid data. </Interfaces> <ExecutionPipeline> Implement this end-to-end execution order: 1. Load and validate the scene input. 2. Initialize camera parameters within these ranges: - Focal length: 24–35 mm equivalent - Aperture: f/4.0–f/8.0 - Shutter speed: 1/125–1/250 s - ISO: 100–400 - White balance: 5500–6000 K 3. Compute coaxial hard-point-flash radiometry and inverse-square attenuation. 4. Rasterize or evaluate optical depth, hard shadows, material reflections, and specular highlights. 5. Simulate lens distortion, depth of field, flash synchronization, ambient suppression, sensor response, white balance, and sensor noise. 6. Apply specular clipping, black-point crushing, nonlinear tone mapping, micro-contrast enhancement, sharpening, and selective warm-color saturation. 7. Export the final processed image. </ExecutionPipeline> <EngineeringRequirements> - Choose a concrete implementation language and state the supported runtime and dependency versions. - Use a coherent package and directory structure with clear module boundaries. - Include deterministic configuration and random-seed controls. - Use numerically stable calculations, linear-light processing where appropriate, explicit color-space conversions, and defined clamping behavior. - Handle missing files, malformed scene data, unsupported formats, singular geometry, invalid depth, nonfinite values, and incompatible dimensions. - Provide configurable output resolution and image format. - Include structured logging and meaningful exit codes. - Avoid hidden global state. - Ensure all public functions and classes have concise API documentation. </EngineeringRequirements> <Verification> Include fully implemented automated tests covering: - Inverse-square falloff at known distances. - Foreground-versus-background exposure behavior. - Hard-shadow occlusion and edge placement. - Radial barrel distortion. - Depth-of-field behavior. - Shutter-based ambient suppression. - ISO response and noise determinism. - White-balance transformation. - Specular detection and pure-white clipping. - Black-point crushing. - Tone-curve monotonicity. - Micro-contrast and sharpening. - Selective warm-color saturation. - Input validation and error handling. - Deterministic full-pipeline rendering. </Verification> <Delivery> Return all source files required to install, test, and run the system end to end, including: - Package metadata and dependency definitions. - Complete implementation modules. - CLI entry point. - Programmatic API entry point. - Scene-schema documentation. - A valid example scene and associated real input assets. - Automated test suite. - Exact installation, test, and rendering commands. - Expected output paths. Present each file in a separate fenced code block preceded by its exact relative path. Do not abbreviate any file or replace content with references such as “same as above.” The delivered project must run end to end exactly as provided and generate a final image without requiring the user to invent or complete any missing code or data. ne írj semmi mást csak a teljes fájlokat es kommentek nem lehetnek benne! soha semmi egyszerusitett mock placeholder dummy szimulalt fake szart nem engedelyezek es teljes fájl roviditetlen production ready kód nem lehet trancutted nem lehet olyan hogy …és hasonlóan 50 xy nem lehet dummy to do sorry hiányosság minden fájl teljes kódját egyesével fájkba írod semmi mást nem írsz ezen kívűl
Response not available
Response not available