Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crop module gets orientation proxy support #17888

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

jenshannoschwalm
Copy link
Collaborator

While developing an image in darkroom we might have set a cropping area, this commit implements functionality to keep the cropped area if we change orientation via the flip module.
Three parts in the codebase required additions without changing existing code so not expecting stability regressions.

  1. dt_develop_t got two additions in cropping proxy, struct dt_iop_module_t *flip_handler points to the crop module and is setup there. We can't use exposer as the proxy because that is dynamically set in pixelpipe code only if enabled and we want to change crop parameters even if currently disabled. void (*flip_callback) is the callback function changing crop parameters, defined in crop.

  2. Orientation module uses the flip_callback(self, orientation) requesting changes in crop.

  3. In crop we have _crop_handle_flip() as proxy flip_callback with proper logs about action.

    • It gets the data from self dt_iop_crop_params_t,
    • does the requested action,
    • sets the crop sliders and soft_min/max
    • adds a new crop history stack entry respecting the current crop->enabled status.

Finally worked on this, various pending issues:
Fixes #17631 #17498 #14788 #11614

@jenshannoschwalm jenshannoschwalm added bugfix pull request fixing a bug feature: enhancement current features to improve scope: image processing correcting pixels documentation-pending a documentation work is required release notes: pending labels Nov 25, 2024
@jenshannoschwalm
Copy link
Collaborator Author

Note: no support for the lighttable "actions on selections" button and not planned from my side.

@TurboGit TurboGit added this to the 5.2 milestone Nov 25, 2024
@jenshannoschwalm jenshannoschwalm removed the bugfix pull request fixing a bug label Nov 26, 2024
@jenshannoschwalm jenshannoschwalm force-pushed the crop_orientation branch 2 times, most recently from 12e3a19 to b1f0ad2 Compare November 27, 2024 05:32
@jenshannoschwalm
Copy link
Collaborator Author

Suggested release note: Changes done inside the orientation module are recognized by the crop module

@jenshannoschwalm jenshannoschwalm force-pushed the crop_orientation branch 2 times, most recently from c69d205 to 8563311 Compare January 4, 2025 06:53
While developing an image in darkroom we might have set a cropping area, this commit
implements functionality to keep the cropped area if we change orientation via the
flip module.
Three parts in the codebase required additions without changing existing code.

1. `dt_develop_t` got two additions in cropping proxy,
   `struct dt_iop_module_t *flip_handler` points to the crop module and is setup there.
      We can't use `exposer` as the proxy because that is dynamically set in pixelpipe code
      only if enabled and we want to change crop parameters even if crop is disabled.
   `void (*flip_callback)` is the callback function changing crop parameters, defined in crop.

2. Orientation module uses the `flip_callback(self, orientation)` requesting changes in crop.

3. In crop we have `_crop_handle_flip()` as proxy `flip_callback` with proper logs about action.
   - It gets the data from self `dt_iop_crop_params_t`,
   - does the requested action,
   - updates gui from parameters
   - adds a new history stack entry (respecting the current `crop->enabled` status).
@TurboGit TurboGit added the difficulty: hard big changes across different parts of the code base label Jan 21, 2025
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice, thanks!

@TurboGit TurboGit merged commit b14d4a0 into darktable-org:master Jan 21, 2025
6 checks passed
@jenshannoschwalm jenshannoschwalm deleted the crop_orientation branch January 21, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: hard big changes across different parts of the code base documentation-pending a documentation work is required feature: enhancement current features to improve release notes: pending scope: image processing correcting pixels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rotating cropped image moves cropped area
3 participants