Package snap.swing
Class J2DImage
java.lang.Object
snap.gfx.Image
snap.swing.J2DImage
- All Implemented Interfaces:
Loadable
An Image subclass for Java2D.
-
Nested Class Summary
Nested classes/interfaces inherited from interface snap.util.Loadable
Loadable.MultiLoadable, Loadable.Support
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Blurs the image by mixing pixels with those around it to given radius.void
emboss
(double aRadius, double anAzi, double anAlt) Embosses the image by mixing pixels with those around it to given radius.byte[]
Returns the JPEG bytes for image.byte[]
Returns the PNG bytes for image.protected byte[]
Returns the decoded RGBA bytes of this image.protected byte[]
Returns the decoded RGB bytes of this image.protected double
Returns the width of given image.protected double
Returns the height of given image.getGif()
Returns the native image.Returns the native image.Returns a painter for image.protected int
Returns the height of given image in pixels.protected int
Returns the width of given image in pixels.int
getRGB
(int aX, int aY) Returns the integer representing the color at the given x,y point.protected boolean
Returns whether image has alpha.Methods inherited from class snap.gfx.Image
addLoadListener, canRead, canRead, cloneForSizeAndScale, fireLoadListeners, getBytes, getBytesImpl, getBytesRGB, getBytesRGBA, getDPIX, getDPIY, getFramedImage, getHeight, getHeightImpl, getImageForBytes, getImageForClassResource, getImageForSize, getImageForSize, getImageForSizeAndScale, getImageForSource, getImageForUrlResource, getImageScaled, getImageSet, getName, getPixHeight, getPixWidth, getScale, getSource, getSourceURL, getSpriteSheetFrames, getSubimage, getType, getWidth, getWidthImpl, hasAlpha, isLoaded, setImageSet, setLoaded, setSource, toString, toStringProps
-
Constructor Details
-
J2DImage
Returns the native image object for image. -
J2DImage
public J2DImage(double aWidth, double aHeight, boolean hasAlpha, double aScale) Returns the native image object for image.
-
-
Method Details
-
getPixWidthImpl
protected int getPixWidthImpl()Returns the width of given image in pixels.- Specified by:
getPixWidthImpl
in classImage
-
getPixHeightImpl
protected int getPixHeightImpl()Returns the height of given image in pixels.- Specified by:
getPixHeightImpl
in classImage
-
getDPIXImpl
protected double getDPIXImpl()Returns the width of given image.- Overrides:
getDPIXImpl
in classImage
-
getDPIYImpl
protected double getDPIYImpl()Returns the height of given image.- Overrides:
getDPIYImpl
in classImage
-
hasAlphaImpl
protected boolean hasAlphaImpl()Returns whether image has alpha.- Specified by:
hasAlphaImpl
in classImage
-
getRGB
public int getRGB(int aX, int aY) Returns the integer representing the color at the given x,y point. -
getBytesRGBImpl
protected byte[] getBytesRGBImpl()Returns the decoded RGB bytes of this image.- Specified by:
getBytesRGBImpl
in classImage
-
getBytesRGBAImpl
protected byte[] getBytesRGBAImpl()Returns the decoded RGBA bytes of this image.- Specified by:
getBytesRGBAImpl
in classImage
-
getBytesJPEG
public byte[] getBytesJPEG()Returns the JPEG bytes for image.- Specified by:
getBytesJPEG
in classImage
-
getBytesPNG
public byte[] getBytesPNG()Returns the PNG bytes for image.- Specified by:
getBytesPNG
in classImage
-
getPainter
Returns a painter for image.- Specified by:
getPainter
in classImage
-
blur
Blurs the image by mixing pixels with those around it to given radius. -
emboss
public void emboss(double aRadius, double anAzi, double anAlt) Embosses the image by mixing pixels with those around it to given radius. -
getNative
Returns the native image. -
getGif
Returns the native image.
-