iptransform: apply distortion and CA correction in a single pass
Some lens profile methods provides a way to correct distortion and CA in a single step. When available, applying distortion and CA correction when both enabled in a single pass is more precise (see lensfun ApplySubpixelGeometryDistortion doc) since it's usually how the profile is done. Instead applying the CA correction in a step after distortion correction could lead to a bit different (also if not always visible) correction. This is also required for future lens correction methods (like DNG WarpRectilinear or corrections based on vendor metadata) that provides only merged distortion and CA correction in a single pass.
This commit is contained in:
@@ -990,6 +990,12 @@ bool rtengine::LCPMapper::isCACorrectionAvailable() const
|
||||
return enableCA;
|
||||
}
|
||||
|
||||
void rtengine::LCPMapper::correctDistortionAndCA(double &x, double &y, int cx, int cy, int channel) const
|
||||
{
|
||||
correctDistortion(x, y, cx, cy);
|
||||
correctCA(x, y, cx, cy, channel);
|
||||
}
|
||||
|
||||
void rtengine::LCPMapper::correctDistortion(double &x, double &y, int cx, int cy) const
|
||||
{
|
||||
x += cx;
|
||||
|
Reference in New Issue
Block a user