Skip to content

Commit

Permalink
[共通] Mat3x3::Homography() オーバーロード追加 #1163
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Dec 12, 2023
1 parent cfd8abf commit a110199
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Siv3D/include/Siv3D/Mat3x3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ namespace s3d
[[nodiscard]]
static Mat3x3 Homography(const Quad& to);

[[nodiscard]]
static Mat3x3 Homography(const RectF& from, const RectF& to);

[[nodiscard]]
static Mat3x3 Homography(const RectF& from, const Quad& to);

[[nodiscard]]
static Mat3x3 Homography(const Quad& from, const RectF& to);

[[nodiscard]]
static Mat3x3 Homography(const Quad& from, const Quad& to);

Expand Down
15 changes: 15 additions & 0 deletions Siv3D/src/Siv3D/Mat3x3/SivMat3x3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,21 @@ namespace s3d
return{ m11, m12, m13, m21, m22, m23, m31, m32, 1.0f };
}

Mat3x3 Mat3x3::Homography(const RectF& from, const RectF& to)
{
return Homography(from.asQuad(), to.asQuad());
}

Mat3x3 Mat3x3::Homography(const RectF& from, const Quad& to)
{
return Homography(from.asQuad(), to);
}

Mat3x3 Mat3x3::Homography(const Quad& from, const RectF& to)
{
return Homography(from, to.asQuad());
}

Mat3x3 Mat3x3::Homography(const Quad& from, const Quad& to)
{
const std::array<cv::Point2f, 4> fromQ = {
Expand Down

0 comments on commit a110199

Please sign in to comment.