org.geotools.image.jai
Class Registry

java.lang.Object
  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.

Since:
2.2
Version:
$Id: Registry.java 17672 2006-01-19 00:25:55Z desruisseaux $
Author:
Martin Desruisseaux

Method Summary
static boolean registerGeotoolsServices(javax.media.jai.OperationRegistry 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

registerGeotoolsServices

public static boolean registerGeotoolsServices(javax.media.jai.OperationRegistry 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.

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

setNativeAccelerationAllowed

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.

Parameters:
operation - The operation name (e.g. "Affine").
allowed - to disallow native acceleration.


Copyright © GeoTools. All Rights Reserved.