Package ca.cgjennings.graphics.filters
Class PixelArtUpscalingFilter
- java.lang.Object
-
- ca.cgjennings.graphics.filters.AbstractImageFilter
-
- ca.cgjennings.graphics.filters.PixelArtUpscalingFilter
-
- All Implemented Interfaces:
java.awt.image.BufferedImageOp
public class PixelArtUpscalingFilter extends AbstractImageFilter
An image filter that upscales images to twice their original size. As it uses an algorithm optimized for small or low-resolution images, it often produces better results than standard sampling algorithms on icons and pixel art.In-place filtering: This class does not support in-place filtering (the source and destination images must be different). Moreover the destination must be of exactly double the width and height of the source.
- Since:
- 3.4
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description PixelArtUpscalingFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImagecreateCompatibleDestImage(java.awt.image.BufferedImage source, java.awt.image.ColorModel destinationColorModel)java.awt.image.BufferedImagefilter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dest)java.awt.geom.Rectangle2DgetBounds2D(java.awt.image.BufferedImage source)java.awt.geom.Point2DgetPoint2D(java.awt.geom.Point2D sourcePoint, java.awt.geom.Point2D destPoint)-
Methods inherited from class ca.cgjennings.graphics.filters.AbstractImageFilter
clamp, clamp, clamp, clampBoth, fA, fB, fG, fR, getARGB, getARGB, getARGBSynch, getRenderingHints, iA, iB, iG, iR, setARGB, setARGB, setARGBSynch
-
-
-
-
Method Detail
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D(java.awt.image.BufferedImage source)
Description copied from class:AbstractImageFilterThe base implementation returns the bounds of the image in image space; that is, the rectangle defined by
0, 0, source.getWidth(), source.getHeight().- Specified by:
getBounds2Din interfacejava.awt.image.BufferedImageOp- Overrides:
getBounds2Din classAbstractImageFilter
-
getPoint2D
public java.awt.geom.Point2D getPoint2D(java.awt.geom.Point2D sourcePoint, java.awt.geom.Point2D destPoint)Description copied from class:AbstractImageFilterThe base implementation returns a copy of the original point.
- Specified by:
getPoint2Din interfacejava.awt.image.BufferedImageOp- Overrides:
getPoint2Din classAbstractImageFilter
-
createCompatibleDestImage
public java.awt.image.BufferedImage createCompatibleDestImage(java.awt.image.BufferedImage source, java.awt.image.ColorModel destinationColorModel)Description copied from class:AbstractImageFilter- Specified by:
createCompatibleDestImagein interfacejava.awt.image.BufferedImageOp- Overrides:
createCompatibleDestImagein classAbstractImageFilter
-
filter
public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage src, java.awt.image.BufferedImage dest)
-
-