comparison 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
comparison
equal deleted inserted replaced
1553:bf02a90ca9ca 1554:6d14ed6163b1
266 t.matrix_(1, 1) = -2.0 / static_cast<double>(canvasHeight); 266 t.matrix_(1, 1) = -2.0 / static_cast<double>(canvasHeight);
267 t.matrix_(1, 2) = 1.0; 267 t.matrix_(1, 2) = 1.0;
268 268
269 return t; 269 return t;
270 } 270 }
271
272
273 AffineTransform2D AffineTransform2D::CreateFlip(bool flipX,
274 bool flipY,
275 unsigned int width,
276 unsigned int height)
277 {
278 AffineTransform2D t;
279 t.matrix_(0, 0) = (flipX ? -1 : 1);
280 t.matrix_(0, 2) = (flipX ? width : 0);
281 t.matrix_(1, 1) = (flipY ? -1 : 1);
282 t.matrix_(1, 2) = (flipY ? height : 0);
283
284 return t;
285 }
271 } 286 }