|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectStatic
Registry
public final class Registry
A set of static methods for managing JAI's operation registry.
Also provides convenience methods for setting the preferred order between standard and JAI
ImageReader/ImageWriter.
| coverage/geotk-coverage (download) | View source code for this class |
| Method Summary | ||
|---|---|---|
static boolean |
registerGeotoolkitServices(OperationRegistry registry)
Unconditionally registers all JAI operations provided in the org.geotoolkit.image.jai
package. |
|
static void |
setDefaultCodecPreferences()
Sets the default preferred order for JAI and Java standard codec. |
|
static void |
setNativeAccelerationAllowed(String operation,
boolean allowed)
Allows or disallows native acceleration for the specified operation on the default JAI instance. |
|
static void |
setNativeAccelerationAllowed(String operation,
boolean allowed,
JAI jai)
Allows or disallows native acceleration for the specified operation on the given JAI instance. |
|
static
|
setNativeCodecAllowed(String format,
Class<T> category,
boolean allowed)
Allows or disallows native acceleration for the specified image format. |
|
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
@Configuration public static boolean registerGeotoolkitServices(OperationRegistry registry)
org.geotoolkit.image.jai
package. This method usually don't need to be invoked, since JAI should parse automatically
the META-INF/registryFile.jai file at startup time. However, this default mechanism
may fail when the Geotk JAR file is unreachable from the JAI class loader, in which case
the org.geotoolkit.coverage.processing package will invoke this method as a fallback.
Note to module maintainer: if this method is updated, remember to update the
META-INF/registryFile.jai file accordingly.
registry - The operation registry to register with.
true if all registrations have been successful.
@Configuration
public static void setNativeAccelerationAllowed(String operation,
boolean allowed,
JAI jai)
"Affine" operation on
an image with float data type, bilinear interpolation and an ImageLayout
rendering hint cause an exception in medialib native code. Disabling the native acceleration
(i.e using the pure Java version) is a convenient workaround until Sun fix the bug.
Note: The current implementation assumes that factories for native implementations are declared in thecom.sun.media.jai.mlibpackage, while factories for pure Java implementations are declared in thecom.sun.media.jai.opimagepackage. It works for Sun's 1.1.2 implementation, but may change in future versions. If this method doesn't recognize the package, it does nothing.
operation - The operation name (e.g. "Affine").allowed - false to disallow native acceleration.jai - The instance of JAI we are going to work on. This argument can be
omitted for the default JAI instance.
@Configuration
public static void setNativeAccelerationAllowed(String operation,
boolean allowed)
setNativeAccelerationAllowed(operation, allowed, JAI.getDefaultInstance()).
operation - The operation name (e.g. "Affine").allowed - false to disallow native acceleration.setNativeAccelerationAllowed(String, boolean, JAI)
@Configuration
public static <T extends ImageReaderWriterSpi> void setNativeCodecAllowed(String format,
Class<T> category,
boolean allowed)
Note:
The current implementation assumes that JAI codec class name start with
"com.sun.media" package name. It works for JAI Image I/O 1.1
implementation, but may change in future versions. If this method doesn't
recognize the class name, then it does nothing.
T - The category (ImageReaderSpi or ImageWriterSpi).format - The format name (e.g. "png").category - ImageReaderSpi.class to set the reader, or
ImageWriterSpi.class to set the writer.allowed - false to disallow native acceleration.@Configuration public static void setDefaultCodecPreferences()
setNativeCodecAllowed for some well-known formats.
TIP: Experience suggests that on some platforms, new codecs appear magically after an AWT window has been created (e.g. "Standard TIFF image reader"). If this method is to be invoked for a graphical application, it is recommended to invoke this method after the Window has been created but before it is made visible.
org.geotoolkit.image.io,
Setup
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||