Skip to content

Commit

Permalink
Make sure camera clone is deep copy, not shallow
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Jun 9, 2023
1 parent 1e570ba commit c0c2d7e
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/aliceVision/camera/IntrinsicsScaleOffsetDisto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@ class IntrinsicsScaleOffsetDisto : public IntrinsicsScaleOffset
{
}

IntrinsicsScaleOffsetDisto(const IntrinsicsScaleOffsetDisto &other)
:
IntrinsicsScaleOffset(other),
_distortionInitializationMode(other._distortionInitializationMode)
{
if (other._pDistortion)
{
_pDistortion = std::shared_ptr<Distortion>(other._pDistortion->clone());
}
else
{
_pDistortion = nullptr;
}

if (other._pUndistortion)
{
_pUndistortion = std::shared_ptr<Undistortion>(other._pUndistortion->clone());
}
else
{
_pUndistortion = nullptr;
}
}

void assign(const IntrinsicBase& other) override
{
*this = dynamic_cast<const IntrinsicsScaleOffsetDisto&>(other);
Expand Down

0 comments on commit c0c2d7e

Please sign in to comment.