Class Registry

  extended byorg.geotools.image.jai.Registry

public final class Registry
extends java.lang.Object

A set of static methods for managing JAI's operation registry.

$Id: 17672 2006-01-19 00:25:55Z desruisseaux $
Martin Desruisseaux

Method Summary
static boolean registerGeotoolsServices( registry)
          Unconditionnaly registers all JAI operations provided in the org.geotools.image.jai package.
static void setNativeAccelerationAllowed(java.lang.String operation, boolean allowed)
          Allows or disallow native acceleration for the specified JAI operation.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Method Detail


public static boolean registerGeotoolsServices( registry)
Unconditionnaly registers all JAI operations provided in the org.geotools.image.jai package. This method usually don't need to be invoked, since JAI should parse automatically the file at startup time. However, this default mechanism may fail when the geotools JAR file is unreachable from the JAI class loader, in which case the org.geotools.coverage.processing package will invoke this method as a fallback.

Note to module maintainer: if this method is updated, remember to update the file accordingly.

registry - The operation registry to register with.
if all registrations have been successful.


public static void setNativeAccelerationAllowed(java.lang.String operation,
                                                boolean allowed)
Allows or disallow native acceleration for the specified JAI operation. By default, JAI uses hardware accelerated methods when available. For example, it make use of MMX instructions on Intel processors. Unfortunatly, some native method crash the Java Virtual Machine under some circonstances. For example on JAI 1.1.2, the "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.

Implementation note: the current implementation assumes that factories for native implementations are declared in the package, while factories for pure java implementations are declared in the package. It work 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 - to disallow native acceleration.

Copyright © GeoTools. All Rights Reserved.