Top Description Constructors Methods
com.jogamp.opengl.util.awt

public Class ImageUtil

extends Object
Class Inheritance
Imports
java.awt.*, java.awt.image.*

Utilities for dealing with images.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static BufferedImage

Returns:

A instance of BufferedImage with a type compatible with the graphics card.
createCompatibleImage
(final int
The width of the image to be created
width
,
final int
The height of the image to be created
height
)

Creates a BufferedImage with a pixel format compatible with the graphics environment.

public static BufferedImage

Returns:

A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()
createThumbnail
(final BufferedImage
The original image to sample down
image
,
final int
The width of the thumbnail to be created
thumbWidth
)

Creates a thumbnail from an image.

public static void
flipImageVertically(final BufferedImage image)

Flips the supplied BufferedImage vertically.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ImageUtilback to summary
private ImageUtil()

Method Detail

createCompatibleImageback to summary
public static BufferedImage createCompatibleImage(final int width, final 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.

Parameters
width:int

The width of the image to be created

height:int

The height of the image to be created

Returns:BufferedImage

A instance of BufferedImage with a type compatible with the graphics card.

createThumbnailback to summary
public static BufferedImage createThumbnail(final BufferedImage image, final 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.

Parameters
image:BufferedImage

The original image to sample down

thumbWidth:int

The width of the thumbnail to be created

Returns:BufferedImage

A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()

Exceptions
IllegalArgumentException:
If thumbWidth is greater than image.getWidth()
flipImageVerticallyback to summary
public static void flipImageVertically(final 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.