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

public Class IosImageLoader

extends ImageLoaderImpl
Class Inheritance
Imports
com.sun.glass.utils.NativeLibLoader, com.sun.javafx.iio.common.*, .ImageLoaderImpl, .ImageTools, com.sun.javafx.iio.ImageFrame, .ImageMetadata, .ImageStorage.ImageType, java.io.IOException, .InputStream, java.nio.ByteBuffer, java.util.Map, java.net.URL, .MalformedURLException

A loader for images on iOS platform.

Field Summary

Modifier and TypeField and Description
private static final Map<Integer, ImageStorage.ImageType>
private int
public static final int
GRAY

These constants must match with those in native

public static final int
public static final int
private int
private int
inWidth

Set by native code

private boolean
private int
private int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private long
structPointer

Pointer to the native loader

Inherited from com.sun.javafx.iio.common.ImageLoaderImpl:
formatDescriptionlastPercentDonelisteners

Constructor Summary

AccessConstructor and Description
public
IosImageLoader(final String urlString, final ImageDescriptor desc)

public
IosImageLoader(final InputStream inputStream, final ImageDescriptor desc)

Method Summary

Modifier and TypeMethod and Description
private void
public synchronized void
dispose()

Implements com.sun.javafx.iio.ImageLoader.dispose.

Disposes of any resources (such as native libraries) held by this loader.

private static native void
disposeLoader(long structPointer)

Destroy a loader.

private native int
getColorSpaceCode(long structPointer)

Return image color space model code

private native int
getDelayTime(long structPointer)

Return image duration for animated images

private native byte[]
getImageBuffer(long structPointer, int imageIndex)

Return a buffer with decompressed image data

private native int
getNumberOfComponents(long structPointer)

Return the number of color components

private static native void
initNativeLoading()

Set up static method IDs for calls back to Java.

public ImageFrame
load(int
the zero-relative index of the image to load.
imageIndex
,
double
the desired image width. If non-positive, an IllegalArgumentException will be thrown.
w
,
double
the desired image height. If non-positive, an IllegalArgumentException will be thrown.
h
,
boolean
whether to preserve the width-to-height ratio of the image.
preserveAspectRatio
,
boolean
whether to use a smooth downscaling algorithm.
smooth
,
float
screen pixel scale (used for variable-density images)
screenPixelScale
,
float
image pixel scale (used for fixed-density images)
imagePixelScale
)

Implements com.sun.javafx.iio.ImageLoader.load.

Loads the image at a given index in an image stream.

private native long
loadImage(final InputStream stream, boolean reportProgress)

Create a loader and buffer data from the InputStream.

private native long
loadImageFromURL(final String url, boolean reportProgress)

Create a loader for the given URL.

private native void
resizeImage(long structPointer, int width, int height)

Set native image size

private void
private void
setInputParameters(int width, int height, int imageCount, int loopCount)

Called by the native code when input parameters are known.

private boolean
private void
updateProgress(float progressPercentage)

Inherited from com.sun.javafx.iio.common.ImageLoaderImpl:
addListeneremitWarninggetFormatDescriptionremoveListenerupdateImageMetadataupdateImageProgress

Field Detail

COLOR_SPACE_MAPPINGback to summary
private static final Map<Integer, ImageStorage.ImageType> COLOR_SPACE_MAPPING
delayTimeback to summary
private int delayTime
GRAYback to summary
public static final int GRAY

These constants must match with those in native

GRAY_ALPHAback to summary
public static final int GRAY_ALPHA
GRAY_ALPHA_PREback to summary
public static final int GRAY_ALPHA_PRE
inHeightback to summary
private int inHeight
inWidthback to summary
private int inWidth

Set by native code

isDisposedback to summary
private boolean isDisposed
loopCountback to summary
private int loopCount
nImagesback to summary
private int nImages
PALETTEback to summary
public static final int PALETTE
PALETTE_ALPHAback to summary
public static final int PALETTE_ALPHA
PALETTE_ALPHA_PREback to summary
public static final int PALETTE_ALPHA_PRE
PALETTE_TRANSback to summary
public static final int PALETTE_TRANS
RGBback to summary
public static final int RGB
RGBAback to summary
public static final int RGBA
RGBA_PREback to summary
public static final int RGBA_PRE
structPointerback to summary
private long structPointer

Pointer to the native loader

Constructor Detail

IosImageLoaderback to summary
public IosImageLoader(final String urlString, final ImageDescriptor desc) throws IOException
IosImageLoaderback to summary
public IosImageLoader(final InputStream inputStream, final ImageDescriptor desc) throws IOException

Method Detail

checkNativePointerback to summary
private void checkNativePointer() throws IOException
disposeback to summary
public synchronized void dispose()

Implements com.sun.javafx.iio.ImageLoader.dispose.

Doc from com.sun.javafx.iio.ImageLoader.dispose.

Disposes of any resources (such as native libraries) held by this loader. Any further invocation of any methods on this object are undefined.

Annotations
@Override
disposeLoaderback to summary
private static native void disposeLoader(long structPointer)

Destroy a loader.

getColorSpaceCodeback to summary
private native int getColorSpaceCode(long structPointer)

Return image color space model code

getDelayTimeback to summary
private native int getDelayTime(long structPointer)

Return image duration for animated images

getImageBufferback to summary
private native byte[] getImageBuffer(long structPointer, int imageIndex)

Return a buffer with decompressed image data

getNumberOfComponentsback to summary
private native int getNumberOfComponents(long structPointer)

Return the number of color components

initNativeLoadingback to summary
private static native void initNativeLoading()

Set up static method IDs for calls back to Java.

loadback to summary
public ImageFrame load(int imageIndex, double w, double h, boolean preserveAspectRatio, boolean smooth, float screenPixelScale, float imagePixelScale) throws IOException

Implements com.sun.javafx.iio.ImageLoader.load.

Doc from com.sun.javafx.iio.ImageLoader.load.

Loads the image at a given index in an image stream. If no image exists at that index null will be returned.

Parameters
imageIndex:int

the zero-relative index of the image to load.

w:double

the desired image width. If non-positive, an IllegalArgumentException will be thrown.

h:double

the desired image height. If non-positive, an IllegalArgumentException will be thrown.

preserveAspectRatio:boolean

whether to preserve the width-to-height ratio of the image.

smooth:boolean

whether to use a smooth downscaling algorithm.

screenPixelScale:float

screen pixel scale (used for variable-density images)

imagePixelScale:float

image pixel scale (used for fixed-density images)

Returns:ImageFrame

the image at the specified index or null on error.

Annotations
@Override
loadImageback to summary
private native long loadImage(final InputStream stream, boolean reportProgress) throws IOException

Create a loader and buffer data from the InputStream. Report progress if requested.

loadImageFromURLback to summary
private native long loadImageFromURL(final String url, boolean reportProgress) throws IOException

Create a loader for the given URL. Report progress if requested.

resizeImageback to summary
private native void resizeImage(long structPointer, int width, int height)

Set native image size

retrieveDelayTimeback to summary
private void retrieveDelayTime()
setInputParametersback to summary
private void setInputParameters(int width, int height, int imageCount, int loopCount)

Called by the native code when input parameters are known.

shouldReportProgressback to summary
private boolean shouldReportProgress()
updateProgressback to summary
private void updateProgress(float progressPercentage)