Package snap.swing

Class J2DImage

java.lang.Object
snap.gfx.Image
snap.swing.J2DImage
All Implemented Interfaces:
Loadable

public class J2DImage extends Image
An Image subclass for Java2D.
  • Constructor Details

    • J2DImage

      public J2DImage(Object aSource)
      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 class Image
    • getPixHeightImpl

      protected int getPixHeightImpl()
      Returns the height of given image in pixels.
      Specified by:
      getPixHeightImpl in class Image
    • getDPIXImpl

      protected double getDPIXImpl()
      Returns the width of given image.
      Overrides:
      getDPIXImpl in class Image
    • getDPIYImpl

      protected double getDPIYImpl()
      Returns the height of given image.
      Overrides:
      getDPIYImpl in class Image
    • hasAlphaImpl

      protected boolean hasAlphaImpl()
      Returns whether image has alpha.
      Specified by:
      hasAlphaImpl in class Image
    • getRGB

      public int getRGB(int aX, int aY)
      Returns the integer representing the color at the given x,y point.
      Specified by:
      getRGB in class Image
    • getBytesRGBImpl

      protected byte[] getBytesRGBImpl()
      Returns the decoded RGB bytes of this image.
      Specified by:
      getBytesRGBImpl in class Image
    • getBytesRGBAImpl

      protected byte[] getBytesRGBAImpl()
      Returns the decoded RGBA bytes of this image.
      Specified by:
      getBytesRGBAImpl in class Image
    • getBytesJPEG

      public byte[] getBytesJPEG()
      Returns the JPEG bytes for image.
      Specified by:
      getBytesJPEG in class Image
    • getBytesPNG

      public byte[] getBytesPNG()
      Returns the PNG bytes for image.
      Specified by:
      getBytesPNG in class Image
    • getPainter

      public Painter getPainter()
      Returns a painter for image.
      Specified by:
      getPainter in class Image
    • blur

      public void blur(int aRad, Color aColor)
      Blurs the image by mixing pixels with those around it to given radius.
      Overrides:
      blur in class Image
    • emboss

      public void emboss(double aRadius, double anAzi, double anAlt)
      Embosses the image by mixing pixels with those around it to given radius.
      Overrides:
      emboss in class Image
    • getNative

      public BufferedImage getNative()
      Returns the native image.
      Specified by:
      getNative in class Image
    • getGif

      public BufferedImage getGif()
      Returns the native image.