ur_rna.Utilities.swing

## Class ImageUtil

- java.lang.Object
- - ur_rna.Utilities.swing.ImageUtil

-     public class ImageUtil
      extends java.lang.Object

  Image Utilities

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ImageUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.awt.image.BufferedImage` | `createCompatibleImage(int width, int height, boolean supportTransparency)` Returns a `BufferedImage` that supports the specified transparency and has a data layout and color model compatible with this `GraphicsConfiguration`.
    `static java.awt.image.BufferedImage` | `getAlphaImage(java.awt.image.BufferedImage image)`
    `static boolean` | `hasAlpha(java.awt.Image image)` This method returns `true` if the specified image has the possibility to store transparent pixels.
    `static java.awt.image.BufferedImage` | `toBufferedImage(java.awt.Image image)` This method returns a buffered image with the contents of an image.
    `static java.awt.image.BufferedImage` | `toBufferedImage(java.awt.Image image, boolean forceCopy)` This method returns a buffered image with the contents of an image.
    `static java.awt.image.BufferedImage` | `toBufferedImage(java.awt.image.RenderedImage image)` Converts an arbitrary image to a `BufferedImage`.
    `static boolean` | `usesAlpha(java.awt.Image image)` This method returns `true` if the specified image has at least one pixel that is not fully opaque.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ImageUtil

          public ImageUtil()

  - ### Method Detail

    - #### createCompatibleImage

          public static java.awt.image.BufferedImage createCompatibleImage(int width,
                                                                           int height,
                                                                           boolean supportTransparency)

      Returns a `BufferedImage` that supports the specified transparency and has a data layout and color model compatible with this `GraphicsConfiguration`. The returned `BufferedImage` has a layout and color model that can be optimally blitted to a device with this `GraphicsConfiguration`.

    - #### getAlphaImage

          public static java.awt.image.BufferedImage getAlphaImage(java.awt.image.BufferedImage image)

    - #### hasAlpha

          public static boolean hasAlpha(java.awt.Image image)

      This method returns `true` if the specified image has the possibility to store transparent pixels. Inspired by http://www.exampledepot.com/egs/java.awt.image/HasAlpha.html
      Parameters:
        `image` - Image that should be checked for alpha channel.
      Returns:
        `true` if the specified image can have transparent pixels, `false` otherwise

    - #### toBufferedImage

          public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image)

      This method returns a buffered image with the contents of an image. If the source image is already a BufferedImage, it will be returned as-is.
      Parameters:
        `image` - Image to be converted
      Returns:
        a buffered image with the contents of the specified image

    - #### toBufferedImage

          public static java.awt.image.BufferedImage toBufferedImage(java.awt.Image image,
                                                                     boolean forceCopy)

      This method returns a buffered image with the contents of an image.
      Parameters:
        `image` - Image to be converted
        `forceCopy` - This parameter has no effect unless the source image is a BufferedImage. If false the source image will be returned as-is, since it is already a BufferedImage. If true, a new BufferedImage (which is compatible with the screen) will be created even if the source image is already a buffered image.
      Returns:
        a buffered image with the contents of the specified image

    - #### toBufferedImage

          public static java.awt.image.BufferedImage toBufferedImage(java.awt.image.RenderedImage image)

      Converts an arbitrary image to a `BufferedImage`.
      Parameters:
        `image` - Image that should be converted.
      Returns:
        a buffered image containing the image pixels, or the original instance if the image already was of type `BufferedImage`.

    - #### usesAlpha

          public static boolean usesAlpha(java.awt.Image image)

      This method returns `true` if the specified image has at least one pixel that is not fully opaque.
      Parameters:
        `image` - Image that should be checked for non-opaque pixels.
      Returns:
        `true` if the specified image has transparent pixels, `false` otherwise