Rename process modes to Color Negative / B&W Negative / Transparency - #819
Merged
Conversation
The mode picker showed the chemistry codes C41, B&W and E-6. ProcessMode is a StrEnum whose value is the label, so renaming the values renames the picker, the HUD pill and the settings dialog together. Saved edits, sticky settings, session blobs and crosstalk .toml files all carry the old strings, so ProcessMode._missing_ maps them back and ProcessConfig.__post_init__ coerces on every construction — that covers every path a mode reaches the config from, not just a loaded flat dict. While in the same files, type the fields that already had an enum but were declared str: PipelineContext.process_mode, the export format / output mode / resolution mode, autocrop_ratio and autocrop_mode, plus a new WhiteCaptureMode for the Scanlight white-light capture and CrosstalkType for a profile's provenance. Each coerces a stale saved value to its default instead of raising. AspectRatio moves next to GeometryConfig so the config can name it; domain.models re-exports it. Closes #818
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #818.
What
ProcessModeis aStrEnumwhose value is the label, so renaming the values renames the app: the Process picker, the HUD mode pill, the settings/copy dialog and the crosstalk editor all follow for free.ProcessMode.C41C41Color NegativeProcessMode.BWB&WB&W NegativeProcessMode.E6E-6TransparencyMember names stay
C41/BW/E6— the ~200 call sites compare through members and are untouched.Migration
Old strings reach the config from more places than a loaded flat dict (sticky
last_process_mode, asset dicts,session_stitches/session_hdr_mergesblobs, export presets), so this is not amigrations.pyentry:ProcessMode._missing_maps the legacy names andProcessConfig.__post_init__coerces on every construction. Crosstalk.tomlfiles declaringprocess = "E-6"are coerced on read, so a user's own matrices still match their mode. An unrecognised value still resolves to colour negative, which is how the render has always treated it.Also in here (string → enum)
Fields that already had an enum but were declared
str, each coercing a stale saved value to its default rather than raising:PipelineContext.process_mode→ProcessMode(tests now pass members, not literals)export_fmt/output_mode/export_resolution_mode→ their existing enumsautocrop_ratio→AspectRatio,autocrop_mode→AutocropMode.AspectRatiomoves next toGeometryConfigso the config can name it without a cycle;domain.modelsre-exports it.WhiteCaptureModefor Scanlight white-light capture (replaces the lowercase remap incontroller.py)CrosstalkTypefor a profile's provenance.get_type()still returnsstr— atypeis free-form on disk by design.export_color_spacedeliberately staysstr:ColorSpaceis a plainEnum, so typing it would break every string comparison against it.Docs
USER_GUIDE.md,PIPELINE.md,CROSSTALK.mdand the README use the new names; the chemistry stays where a sentence is about chemistry (Transparency (E-6), the orange mask, RA4 papers). The built-in profile Generic C41 is a profile name, not a mode, and is unchanged.Verification
make allgreen: 3959 passed. New coverage for the legacy names (config, crosstalk.toml, scanlight settings) and for stale enum values falling back to their defaults.