Top Description Fields Constructors Methods
com.sun.javafx.iio.common

public Class ImageTools

extends Object
Class Inheritance
Imports
com.sun.javafx.iio.ImageFrame, .ImageStorage, java.io.EOFException, .File, .FileInputStream, .IOException, .InputStream, java.net.URL, java.nio.ByteBuffer, java.util.Locale

A set of format-independent convenience methods useful in image loading and saving.

Field Summary

Modifier and TypeField and Description
public static final int
PROGRESS_INTERVAL

The percentage increment between progress report updates.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int[]
computeDimensions(int sourceWidth, int sourceHeight, int maxWidth, int maxHeight, boolean preserveAspectRatio)

public static InputStream
public static String
getScaledImageName(String path, int scaleFactor)

public static int
readFully(InputStream
the stream from which to read the data.
stream
,
byte[]
the buffer into which the data is read.
b
,
int
the start offset of the data.
off
,
int
the number of bytes to read.
len
)

See the general contract of the readFully method of DataInput.

public static int
readFully(InputStream
the stream from which to read the data.
stream
,
byte[]
the buffer into which the data is read.
b
)

See the general contract of the readFully method of DataInput.

public static ByteBuffer
scaleImage(ByteBuffer src, int sourceWidth, int sourceHeight, int numBands, int destWidth, int destHeight, boolean isSmooth)

public static ImageFrame
scaleImageFrame(ImageFrame src, int destWidth, int destHeight, boolean isSmooth)

public static void
skipFully(InputStream
the stream to skip.
stream
,
long
the number of bytes to be skipped.
n
)

Skips over n bytes of data from the input stream.

public static void
validateMaxDimensions(double width, double height, double scaleFactor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PROGRESS_INTERVALback to summary
public static final int PROGRESS_INTERVAL

The percentage increment between progress report updates.

Constructor Detail

ImageToolsback to summary
public ImageTools()

Method Detail

computeDimensionsback to summary
public static int[] computeDimensions(int sourceWidth, int sourceHeight, int maxWidth, int maxHeight, boolean preserveAspectRatio)
createInputStreamback to summary
public static InputStream createInputStream(String input) throws IOException
getScaledImageNameback to summary
public static String getScaledImageName(String path, int scaleFactor)
readFullyback to summary
public static int readFully(InputStream stream, byte[] b, int off, int len) throws IOException

See the general contract of the readFully method of DataInput.

Bytes for this operation are read from the specified input stream.

Parameters
stream:InputStream

the stream from which to read the data.

b:byte[]

the buffer into which the data is read.

off:int

the start offset of the data.

len:int

the number of bytes to read.

Exceptions
IOException:
if another I/O error occurs.
EOFException:
if this input stream reaches the end before reading all the bytes.
readFullyback to summary
public static int readFully(InputStream stream, byte[] b) throws IOException

See the general contract of the readFully method of DataInput.

Bytes for this operation are read from the contained input stream.

Parameters
stream:InputStream

the stream from which to read the data.

b:byte[]

the buffer into which the data is read.

Exceptions
IOException:
if another I/O error occurs.
EOFException:
if this input stream reaches the end before reading all the bytes.
scaleImageback to summary
public static ByteBuffer scaleImage(ByteBuffer src, int sourceWidth, int sourceHeight, int numBands, int destWidth, int destHeight, boolean isSmooth)
scaleImageFrameback to summary
public static ImageFrame scaleImageFrame(ImageFrame src, int destWidth, int destHeight, boolean isSmooth)
skipFullyback to summary
public static void skipFully(InputStream stream, long n) throws IOException

Skips over n bytes of data from the input stream.

Parameters
stream:InputStream

the stream to skip.

n:long

the number of bytes to be skipped.

Exceptions
IOException:
if another I/O error occurs.
EOFException:
if this input stream reaches the end before skipping all the bytes.
validateMaxDimensionsback to summary
public static void validateMaxDimensions(double width, double height, double scaleFactor)