Inputs having zero as both width and height were caught, but either one
alone caused a panic. This adds a test showing the old failing behavior
and adds a check for non-positive width/height. Since Resize doesn't
have an error return value, the behavior in this case is to return the
original image.
Fixes https://github.com/nfnt/resize/issues/52
These image types use premultiplied alpha values which are also used during the interpolation. If we'd use NRGBA, NRGBA64 as output, we'd have to reverse the premultiplication.
Colors in image.RGBA, image.RGBA64 and generic types with alpha channel should
now resize correctly. There's a small performance hit for these image types even
if they don't use alpha channels though.
Fixes bug #26.
Benchmark each interpolation function for RGBA and YCbCr images.
Reduce the image size used when benchmarking to reduce the influence of
memory performance on results.
This is a complete rewrite! The tight scaling loop needs data locality for optimal performance. The old version used lots of pointer redirections to access image data which was bad for data locality. By providing the complete loop for each image type, this problem is solved. Unfortunately this increases code duplication but the result should be worth it: I could measure a ~6x speed-up for certain test cases!