* Use target_include_directories to specify include paths
* Specify project root (parent of rtgui and rtengine) as include path
* Replace relative includes with normal includes
Change size_t to std::size_t, remove void from function parameters, use
constants to represent the minimum required number of control lines, and
change const auto & to const auto.
Set the "apply" and "delete all" button sensitivity based on the number
of control lines. Add extra tooltip text to the apply button when
editing and there is not enough lines. The text explains there must be
enough vertical or horizontal control lines.
When perspective control line editing is active and the history entry is
changed such that edit mode is automatically disabled, there is a crash.
The history change triggers a processing parameters update and disables
editing. When editing is disabled, the perspective tool also tries to
update the processing parameters, causing a double mutex lock attempt.
This commit avoids updating parameters from the perspective tool and
uses the tweak operator (introduced with the spot removal tool) to achieve
the same effect.
Closes#6251.
Replaces the following deprecated Gtk classes throughout the codebase by their non-deprecated counterparts. Style, HBox, VBox, HPaned, VPaned, HScrollbar, VScrollbar, VSeparator, HSeparator, Stock, Table, VScale and HScale.
Perspective control line type is automatically set when first drawn. The
type is determined by the line's angle. Buttons for specifying which
line type to draw are removed.
Previously, changing values in the camera-based perspective correction
tool while in control line edit mode resulted in the preview being
refreshed. This is unnecessary because all perspective transformations
are disabled in edit mode. This commit disables preview refreshing for
camera-based perspective adjustments in edit mode.
Scaling is applied at the end of all geometric transformations, so it
would be more appropriate outside of the perspective correction tool.
Such an implementation would also work better with the auto-fit feature.
If the focal length and/or crop factor for the camera-based perspective
correction tool are not edited, they will be set using the focal length
information found in the image metadata. This only applies to the editor
(batch editor and CLI still default to 24 for the focal length and 1 for
the crop factor).
This rotation is different from the Rotate tool and the post-correction
adjustment rotation because it is applied between camera shift and
camera angle. It is equivalent to correcting the camera's roll and is
the same as the rotation calculated by automatic perspective correction.
Add camera lens/sensor shift support with horizontal/vertical shift
adjusters.
Add shifting and rotation of corrected image. This allows
post-correction adjustments to be made more easily given the fixed image
canvas size.
Add scaling of final result. This also helps reduce frustrations with
the fixed image canvas size.
Replace field of view with focal length and crop factor. Use of focal
length and crop factor is more common than diagonal angular field of
view. The new adjusters should be more intuitive for most photographers.
The implementation of perspective correction uses a focal length
relative to the image dimensions. The existing code calculates that
focal length with trigonometry. The new code does it by multiplying
by a ratio.
Replace vertical bias with horizontal and vertical perspective
distortion recovery. Vertical bias is not intuitive as it causes
vertical lines to converge off-center if horizontal correction is
applied. The new adjusters perform perspective distortion on the
projection of the corrected image, allowing vertical/horizontal lines to
converge towards the center lines of the image.
Refactor perspective transformation math to use dynamically computed
homogeneous coordinate matrices instead of pre-calculated formulas. This
should add some overhead, but results in more maintainable code and
possible improved performance due to the reduced number of arithmetic
and assignments needed for each pixel.
Integrate new adjusters in the GUI. This includes fine granularity for
batch processing add/set modes and history.
Revise perspective transformation to remove hard-coded angular field of
view and horizontal perspective axis of rotation. Add vertical bias
parameter to retain ability to perform vertical perspective
transformation independent of the horizontal perspective axis of
rotation. Add field of view parameter as a tentative method for
specifying angular field of view.
The current implementation of perspective transformation applies
horizontal perspective transformation in such a way that preserves the
orientation of a horizontal line going through the center of the image.
In common use cases, horizontal lines such as the horizon do not go
through the center of the image. In such cases, the horizontal
perspective axis of rotation should not be parallel to the image's
y-axis. This commit makes the axis of rotation dependent on the vertical
parameter.
The two axes of rotation should be placed at the appropriate distance
from the image in order to prevent stretched or compressed proportions.
In the current implementation, the axes are at a fixed relative distance
from the image. This commit adds the ability to specify the distance in
the form of the diagonal angular field of view.