|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectto.etc.sjit.ImageSubsampler
public class ImageSubsampler
Subsamples an image to create a smaller (or larger(!)) image. This can use several sampling filters.
The algorithms and methods used in this library are based on the article "General Filtered Image Rescaling" by Dale Schumacher which appeared in the book Graphics Gems III, published by Academic Press, Inc.
Performance enhancements: (all in milliseconds)
One | Ten | What was done? |
2047 | 19,812 | Initial, slow version sans opt |
765 | 6,719 | Using direct-access to BufferedImage's INT RBG buffer for the row sampler only |
406 | 3,531 | Using direct-access for the COLUMN resampler.. |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
static java.awt.image.BufferedImage |
resample(java.awt.image.BufferedImage srci,
ResamplerFilter f,
int ow,
int oh)
The actual sampler code which converts a source image to a destination image, reducing or enlarging the image. |
static java.awt.Point |
resizeWithAspect(int w,
int h,
int iw,
int ih)
Does a resize of an object with size (iw, ih) to fit within a rectangle of (w, h) while keeping the same aspect ratio |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.awt.image.BufferedImage resample(java.awt.image.BufferedImage srci, ResamplerFilter f, int ow, int oh)
public static java.awt.Point resizeWithAspect(int w, int h, int iw, int ih)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |