Class Thumbnail.ImageSource

  • Enclosing class:
    Thumbnail


    protected abstract static class Thumbnail.ImageSource
    extends Object
    An image source that can scale to a specific size. This abstract class may rely on a BufferedImage, Image, File, or URL.
    • Constructor Detail

      • ImageSource

        protected ImageSource()
    • Method Detail

      • scale

        public abstract BufferedImage scale(Dimension destinationSize)
        Scale the source image to a specific size
        Parameters:
        destinationSize - the exact size to scale the image source to. The image may be stretched as needed to fit this size.

        It is assumed (but not enforced) that the destinationSize will be smaller than the source width/height.

        Returns:
        a scaled copy of this size.
      • getSourceWidth

        public abstract int getSourceWidth()
        Return the width of the source image.
      • getSourceHeight

        public abstract int getSourceHeight()
        Return the height of the source image.