Class ImageUtil

  extended bycom.sun.opengl.util.ImageUtil

public class ImageUtil
extends Object

Utilities for dealing with images.

Method Summary
static BufferedImage createCompatibleImage(int width, int height)
          Creates a BufferedImage with a pixel format compatible with the graphics environment.
static BufferedImage createThumbnail(BufferedImage image, int thumbWidth)
          Creates a thumbnail from an image.
static void flipImageVertically(BufferedImage image)
          Flips the supplied BufferedImage vertically.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static void flipImageVertically(BufferedImage image)
Flips the supplied BufferedImage vertically. This is often a necessary conversion step to display a Java2D image correctly with OpenGL and vice versa.


public static BufferedImage createCompatibleImage(int width,
                                                  int height)
Creates a BufferedImage with a pixel format compatible with the graphics environment. The returned image can thus benefit from hardware accelerated operations in Java2D API.

width - The width of the image to be created
height - The height of the image to be created
A instance of BufferedImage with a type compatible with the graphics card.


public static BufferedImage createThumbnail(BufferedImage image,
                                            int thumbWidth)
Creates a thumbnail from an image. A thumbnail is a scaled down version of the original picture. This method will retain the width to height ratio of the original picture and return a new instance of BufferedImage. The original picture is not modified.

image - The original image to sample down
thumbWidth - The width of the thumbnail to be created
A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()
IllegalArgumentException - If thumbWidth is greater than image.getWidth()

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.