Skip to content

Optical corrections: implement CorrectionSource seam and vignetting/CA/distortion math #7

Description

@justin13888

The optics stage (pipeline stage 2) is warn-and-skip only. That is spec-correct today (rawshift 0.1.1 parses no ARW optics metadata — Sony stores it in undecoded MakerNote tags), but two things are missing for when metadata lands:

  1. The seam does not exist. docs claimed a CorrectionSource trait; grep -rn CorrectionSource crates/ returns nothing. Only the OpticsMetadata presence struct exists (crates/focale-core/src/decode/mod.rs:146).
  2. No correction math at all — no vignetting gain application, no lateral-CA per-channel scaling, no distortion remap. UI toggles are inert (crates/focale-core/src/params/optics.rs, crates/focale-app/src/panels.rs:33-46).

Historical spec: PRD §3 stage 2 (pinned) — corrections come exclusively from embedded raw metadata in v1; the trait is the v2 external-profile-database seam.

Acceptance criteria:

  • A real CorrectionSource trait in focale-core with the embedded-metadata implementation behind it (may return nothing for all current ARW files)
  • Vignetting, lateral CA, and distortion algorithms implemented, pipeline-versioned, deterministic (CPU, fixed iteration order, no fast-math)
  • DNG GainMap opcodes exercised end-to-end as the first live metadata source, if exposed by rawshift
  • Warn-and-skip behaviour preserved for files without metadata; toggles take effect when metadata exists
  • Blocked-on note: full ARW support tracks upstream rawshift MakerNote parsing

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestupstream-blockedBlocked on an upstream dependency release

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions