Package org.libheiffx

Class MappedImageFactory

java.lang.Object
org.libheiffx.MappedImageFactory

public final class MappedImageFactory extends Object
A factory for creating BufferedImages backed by memory mapped files. The data buffers will be allocated outside the normal JVM heap, allowing more efficient memory usage for large images.
Version:
$Id: MappedImageFactory.java,v 1.0 May 26, 2010 5:07:01 PM haraldk Exp$
Author:
Harald Kuhr, last modified by $Author: haraldk$
  • Method Details

    • createCompatibleMappedImage

      public static BufferedImage createCompatibleMappedImage(int width, int height, int type) throws IOException
      Throws:
      IOException
    • createCompatibleMappedImage

      public static BufferedImage createCompatibleMappedImage(int width, int height, GraphicsConfiguration configuration, int transparency) throws IOException
      Throws:
      IOException
    • createCompatibleMappedImage

      public static BufferedImage createCompatibleMappedImage(int width, int height, ImageTypeSpecifier type) throws IOException
      Throws:
      IOException
    • getCompatibleBufferedImageType

      public static int getCompatibleBufferedImageType(BufferedImage image)

      Returns the BufferedImage image type that is compatible with the data in image. This method will return compatible types, even if BufferedImage.getType() returns BufferedImage.TYPE_CUSTOM.

      This method is defined to work so that, for any valid BufferedImage type (except BufferedImage.TYPE_CUSTOM), the following is true:
      getCompatibleBufferedImageType(createCompatibleMappedImage(w, h, type)) == type

      If no standard type is compatible with the image data, BufferedImage.TYPE_CUSTOM is returned.

      Parameters:
      image - the image to test, may not be null.
      Returns:
      the BufferedImage type.
      Throws:
      IllegalArgumentException - if image is null.
      See Also: