comparison OrthancStone/Sources/Toolbox/AffineTransform2D.cpp @ 1882:4e80b8afd0da

numpy in rendering plugin
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Jan 2022 18:02:24 +0100
parents 7053b8a0aaec
children e8b9a2ba1df1
comparison
equal deleted inserted replaced
1881:a05529952510 1882:4e80b8afd0da
275 AffineTransform2D AffineTransform2D::CreateFlip(bool flipX, 275 AffineTransform2D AffineTransform2D::CreateFlip(bool flipX,
276 bool flipY, 276 bool flipY,
277 unsigned int width, 277 unsigned int width,
278 unsigned int height) 278 unsigned int height)
279 { 279 {
280 AffineTransform2D t; 280 if (width == 0 ||
281 t.matrix_(0, 0) = (flipX ? -1 : 1); 281 height == 0)
282 t.matrix_(0, 2) = (flipX ? width : 0); 282 {
283 t.matrix_(1, 1) = (flipY ? -1 : 1); 283 return AffineTransform2D(); // Identity
284 t.matrix_(1, 2) = (flipY ? height : 0); 284 }
285 285 else
286 return t; 286 {
287 AffineTransform2D t;
288 t.matrix_(0, 0) = (flipX ? -1 : 1);
289 t.matrix_(0, 2) = (flipX ? width : 0);
290 t.matrix_(1, 1) = (flipY ? -1 : 1);
291 t.matrix_(1, 2) = (flipY ? height : 0);
292
293 return t;
294 }
287 } 295 }
288 } 296 }