GRAPHICS: Allow arbitrary input sizes for thumbnail scaling.

Instead of a fixed 1/2 or 1/4 scaling we do a two step scaling now:
1) Scale image to width < 160*2 && height < [100,120]*2 with 1/4 or 1/2
   nearest-neighbor.
2) Use a bilinear scaler to scale aspect preserving to 160x[100,120]

This fixes bug #3614568 "GRAPHICS: Odd thumbnail sizes crash".
This commit is contained in:
Johannes Schickel 2013-07-13 01:48:30 +02:00
parent 57cc59356c
commit adf8cee449
2 changed files with 96 additions and 85 deletions

View file

@ -89,10 +89,4 @@ extern bool createThumbnailFromScreen(Graphics::Surface *surf);
*/
extern bool createThumbnail(Graphics::Surface *surf, const uint8 *pixels, int w, int h, const uint8 *palette);
/**
* Downscale screenshot to thumbnale size.
*
*/
extern bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in);
#endif