Package com.day.image

Class ImageSupport


  • public class ImageSupport
    extends java.lang.Object
    The ImageSupport class provides methods, which are implemented differently for Java 1.3 and for Java 1.4. These methods are implemented as public static methods, which delegate to protected instance methods of implementations of this abstract class.
    Since:
    coati
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.image.BufferedImage coerceData​(java.awt.image.BufferedImage image, boolean isAlphaPremultiplied)
      Forces the data to match the state specified in the isAlphaPremultiplied variable.
      static void deregisterImageIOSpi()
      Deregisters the GIF Image writer to be used depending on the Java runtime from the ImageIO registry.
      static void registerImageIOSpi()
      Registers the GIF Image writer to be used depending on the Java runtime to the ImageIO registry.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • coerceData

        public static java.awt.image.BufferedImage coerceData​(java.awt.image.BufferedImage image,
                                                              boolean isAlphaPremultiplied)
        Forces the data to match the state specified in the isAlphaPremultiplied variable. It may multiply or divide the color raster data by alpha, or do nothing if the data is in the correct state.

        NOTE: Due to a bug in the DirectColorModel.coerceData implementation of Java 1.3 we have to hack this in using the implementation of Java 1.4 for the 1.3 version and delegating to the library implementation for the 1.4 version.

        Parameters:
        image - The image to apply the alpha channel for.
        isAlphaPremultiplied - true if the alpha has been premultiplied; false otherwise.
        Returns:
        The image with correct state. Depending on the implementation and the real need for coercion, the image may or may not be the same as the input image. Callers should not assume to get a different image or even different raster data object.
      • registerImageIOSpi

        public static void registerImageIOSpi()
        Registers the GIF Image writer to be used depending on the Java runtime to the ImageIO registry. If the image writer has already been registered, this method has no effect.
      • deregisterImageIOSpi

        public static void deregisterImageIOSpi()
        Deregisters the GIF Image writer to be used depending on the Java runtime from the ImageIO registry. If the image writer is not registered, this method has no effect.