8000 Introduce distort-aware pickers by jenshannoschwalm · Pull Request #16534 · darktable-org/darktable · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Introduce distort-aware pickers #16534

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

Merged
merged 4 commits into from
Mar 30, 2024

Conversation

jenshannoschwalm
Copy link
Collaborator

Inspired by #14598

Currently all picker coordinates are based on the pixelpipe output.

This pr introduces picker based on input of image data, this allows the picker to follow are distorting modules like crop, ashift or lens.

@jenshannoschwalm jenshannoschwalm changed the title Introduce distort-aware pickers RFC: Introduce distort-aware pickers Mar 29, 2024
@jenshannoschwalm jenshannoschwalm added difficulty: hard big changes across different parts of the code base scope: UI user interface and interactions scope: codebase making darktable source code easier to manage release notes: pending labels Mar 29, 2024
@TurboGit TurboGit added this to the 4.8 milestone Mar 29, 2024
@TurboGit
Copy link
Member

For a box on a color square it's not perfect when doing rotation, for example:

This:

image

Becomes (with 8° of rotation in rotation & perspective module):

image

But we cannot do better as the picker area is defined with just 4 points, that's not comparable with the mask's forms which are made of lot of points to allow for full distortion.

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.

I'll test again tomorrow but this looks good to me.

@jenshannoschwalm
Copy link
Collaborator Author

But we cannot do better as the picker area is defined with just 4 points, that's not comparable with the mask's forms which are made of lot of points to allow for full distortion.

We could do a full transformation of the bounding rectangle - right now we use only two points, upper left and lower right - using four points for the box and modify dt_color_picker_helper(). A lot of work if we would want to optimize and certainly some (hefty ?) performance penalty.

@parafin
Copy link
Member
parafin commented Mar 30, 2024

With 45 degree rotation you end up with a line (rectangle with zero area) in this example. Transforming four points would help with that.

@jenshannoschwalm
Copy link
Collaborator Author

Transforming four points would help with that.

Yes - we could stay with the rectangle for dt_color_picker_helper() box but transform all 4 points and thus use the larger box.

@TurboGit you want me to do that in this pr?

@TurboGit
Copy link
Member

Yes please! Thanks.

The pickers box and point positions are now relative to image input.
This allows the pickers to follow all distorting modules like crop, ashift and lens.
1. Getting the picker box is now dt_color_picker_box() in common/colorpicker.
2. dt_color_picker_helper() includes initializing of picker stats.
darkroom static _transform_box() and _backtransform_box might be useful elsewhere so
moved to common/color_picker as dt_color_picker_transform_box() and dt_color_picker_backtransform_box()
Instead of transforming only upper-left and lower-right points of the picker
coordinates we transform all corner points,
sort the coordinates and use average of 2 highest and 2 lowest for the resulting
rectangle.
@jenshannoschwalm
Copy link
Collaborator Author

Done and working much better :-)

@TurboGit
Copy link
Member

For sure, lot better:

image

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.

Works for me, thanks!

@TurboGit TurboGit changed the title RFC: Introduce distort-aware pickers Introduce distort-aware pickers Mar 30, 2024
@TurboGit TurboGit merged commit f93748f into darktable-org:master Mar 30, 2024
@jenshannoschwalm jenshannoschwalm deleted the distort_aware_pickers branch March 30, 2024 16:08
@jenshannoschwalm jenshannoschwalm added documentation-pending a documentation work is required and removed release notes: pending labels Apr 14, 2024
dterrahe added a commit to dterrahe/darktable that referenced this pull request Jun 12, 2024
…ted 45°

- grab any corner
- change only cursor corner
- right+click in live sample to select
dterrahe added a commit to dterrahe/darktable that referenced this pull request Jun 16, 2024
…ted 45°

- grab any corner
- change only cursor corner
- right+click in live sample to select
dterrahe added a commit to dterrahe/darktable that referenced this pull request Jun 20, 2024
…ted 45°

- grab any corner
- change only cursor corner
- right+click in live sample to select
dterrahe added a commit to dterrahe/darktable that referenced this pull request Jun 22, 2024
…ted 45°

- grab any corner
- change only cursor corner
- right+click in live sample to select
@elstoc elstoc removed the documentation-pending a documentation work is required label Apr 17, 2025
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 scope: codebase making darktable source code easier to manage scope: UI user interface and interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0