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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
src/iop/crop.c Outdated Show resolved Hide resolved
src/iop/flip.c Outdated Show resolved Hide resolved
src/iop/crop.c Outdated Show resolved Hide resolved
@jenshannoschwalm jenshannoschwalm removed the bugfix pull request fixing a bug label Nov 26, 2024
src/iop/flip.c Outdated Show resolved Hide resolved
src/iop/crop.c Outdated Show resolved Hide resolved
@jenshannoschwalm jenshannoschwalm force-pushed the crop_orientation branch 2 times, most recently from 12e3a19 to b1f0ad2 Compare November 27, 2024 05:32
src/iop/crop.c Outdated Show resolved Hide resolved
@jenshannoschwalm jenshannoschwalm force-pushed the crop_orientation branch 3 times, most recently from 1c3cd92 to 1c8140a Compare December 1, 2024 18:49
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).
@jenshannoschwalm
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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