Mercurial > hg > orthanc
diff Core/Images/ImageProcessing.h @ 4082:2e1564f57542
ImageProcessing::FitSizeKeepAspectRatio()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 23 Jun 2020 07:39:23 +0200 |
parents | 73c22208272f |
children |
line wrap: on
line diff
--- a/Core/Images/ImageProcessing.h Mon Jun 22 19:04:09 2020 +0200 +++ b/Core/Images/ImageProcessing.h Tue Jun 23 07:39:23 2020 +0200 @@ -200,10 +200,17 @@ static void FitSize(ImageAccessor& target, const ImageAccessor& source); - + + // Resize the image to the given width/height. The resized image + // occupies the entire canvas (aspect ratio is not preserved). static ImageAccessor* FitSize(const ImageAccessor& source, unsigned int width, unsigned int height); + + // Resize an image, but keeps its original aspect ratio. Zeros are + // added around the image to reach the specified size. + static ImageAccessor* FitSizeKeepAspectRatio(const ImageAccessor& source, + unsigned int width, + unsigned int height); }; } -