|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xj3d.ui.swt.util.ImageUtils
public class ImageUtils
Utilities for processing SWT ImageData objects to be used as textures.
| Constructor Summary | |
|---|---|
ImageUtils()
Constructor |
|
ImageUtils(boolean imageScaleUp,
boolean useMipMaps,
int maxTextureSize)
Constructor |
|
| Method Summary | |
|---|---|
NIOBufferImage |
consolidate(org.eclipse.swt.graphics.ImageData[] imageArray)
Convert the ImageData objects into NIOBufferImages and extract the individual image byte buffers from the resulting NIOBufferImages and consolidate them into a single byte buffer array in the returned NIOBufferImage. |
org.eclipse.swt.graphics.ImageData[] |
preprocess(org.eclipse.swt.graphics.ImageData image)
Scale and create mipmaps of the argument image. |
org.eclipse.swt.graphics.ImageData |
scale(org.eclipse.swt.graphics.ImageData image,
int width,
int height)
Return a new ImageData object scaled from the argument
ImageDatato the specified width and height. |
NIOBufferImage |
toNIOBufferImage(org.eclipse.swt.graphics.ImageData image)
Return an NIOBufferImage representation of the argument image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImageUtils()
public ImageUtils(boolean imageScaleUp,
boolean useMipMaps,
int maxTextureSize)
imageScaleUp - Flag indicating how image rescales should be handled.
true if the image should be rescaled up to the nearest power of two, false
if the image should be rescaled down to the nearest power of two.useMipMaps - Flag indicating whether to create mipmaps when processing
an image.maxTextureSize - The maximum texture size per dimension, must be a
power of two. A negative integer allows an unlimited image size. A positive
non-power of two integer will be converted to the nearest smaller power of two.| Method Detail |
|---|
public NIOBufferImage toNIOBufferImage(org.eclipse.swt.graphics.ImageData image)
NIOBufferImage representation of the argument image.
image - The image to covert
NIOBufferImage representationpublic org.eclipse.swt.graphics.ImageData[] preprocess(org.eclipse.swt.graphics.ImageData image)
image - The initial image
public NIOBufferImage consolidate(org.eclipse.swt.graphics.ImageData[] imageArray)
imageArray - The primary image and set of mipmaps
public org.eclipse.swt.graphics.ImageData scale(org.eclipse.swt.graphics.ImageData image,
int width,
int height)
ImageData object scaled from the argument
ImageDatato the specified width and height. If the argument
is already the specified size, it will be returned unchanged.
image - The image to scalewidth - The width for the new imageheight - The height of the new image
ImageData sized as requested
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||