Mercurial > hg > orthanc-stone
diff OrthancStone/Sources/Toolbox/AffineTransform2D.cpp @ 1554:6d14ed6163b1
flip x/y in Stone Web viewer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 17 Aug 2020 16:10:00 +0200 |
parents | 244ad1e4e76a |
children | 8563ea5d8ae4 |
line wrap: on
line diff
--- a/OrthancStone/Sources/Toolbox/AffineTransform2D.cpp Mon Aug 17 13:25:54 2020 +0200 +++ b/OrthancStone/Sources/Toolbox/AffineTransform2D.cpp Mon Aug 17 16:10:00 2020 +0200 @@ -268,4 +268,19 @@ return t; } + + + AffineTransform2D AffineTransform2D::CreateFlip(bool flipX, + bool flipY, + unsigned int width, + unsigned int height) + { + AffineTransform2D t; + t.matrix_(0, 0) = (flipX ? -1 : 1); + t.matrix_(0, 2) = (flipX ? width : 0); + t.matrix_(1, 1) = (flipY ? -1 : 1); + t.matrix_(1, 2) = (flipY ? height : 0); + + return t; + } }