public JAI getJAI() { return JAI.getDefaultInstance(); }
final OperationRegistry opRegistry = JAI.getDefaultInstance().getOperationRegistry(); for (String mode : RegistryMode.getModeNames()) { for (Iterator descriptors = opRegistry.getDescriptors(mode).iterator();
public static OperationRegistry initializeRegistry() { try { InputStream url = PropertyUtil.getFileFromClasspath(JAI_REGISTRY_FILE); if (url == null) { throw new RuntimeException("Could not find the main registry file"); } OperationRegistry registry = new ConcurrentOperationRegistry(); if (url != null) { registry.updateFromStream(url); } registry.registerServices(null); return registry; } catch (IOException ioe) { ImagingListener listener = JAI.getDefaultInstance().getImagingListener(); String message = "Error occurred while initializing JAI"; listener.errorOccurred( message, new ImagingException(message, ioe), OperationRegistry.class, false); return null; } }
JAI.getDefaultInstance() .setImagingListener( new ImagingListener() { JAI jaiDef = JAI.getDefaultInstance(); if (!(jaiDef.getOperationRegistry() instanceof ConcurrentOperationRegistry || jaiDef.getOperationRegistry()
/** * Allows or disallow native acceleration for the specified operation on the {@linkplain * JAI#getDefaultInstance default JAI instance}. This method is a shortcut for <code> * {@linkplain #setNativeAccelerationAllowed(String,boolean,JAI) * setNativeAccelerationAllowed}(operation, allowed, JAI.getDefaultInstance())</code>. * * @see #setNativeAccelerationAllowed(String, boolean, JAI) */ public static void setNativeAccelerationAllowed(final String operation, final boolean allowed) { setNativeAccelerationAllowed(operation, allowed, JAI.getDefaultInstance()); }
void initJAI(JAIInfo jai) { JAI jaiDef = JAI.getDefaultInstance(); jai.setJAI(jaiDef);
/** * Returns the {@link JAI} instance to use for operations on {@link RenderedImage}. If no JAI * instance is defined for the {@link Hints#JAI_INSTANCE} key, then the default instance is * returned. * * @param hints The rendering hints, or {@code null} if none. * @return The JAI instance to use (never {@code null}). */ public static final JAI getJAI(final RenderingHints hints) { if (hints != null) { final Object value = hints.get(Hints.JAI_INSTANCE); if (value instanceof JAI) { return (JAI) value; } } return JAI.getDefaultInstance(); }
public static synchronized void register(boolean force) { if (!registered || force) { OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); registry.addPropertyGenerator("rendered", "Affine", new GTAffinePropertyGenerator()); registered = true; } }
public static synchronized void register(boolean force) { if (!registered || force) { OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); registry.addPropertyGenerator("rendered", "Warp", new GTWarpPropertyGenerator()); registered = true; } }
RenderingHints hints = new Hints(JAI.getDefaultInstance().getRenderingHints()); hints.putAll(GeoTools.getDefaultHints()); return new OpImage(new Vector(sourceImages), il, hints, false) {
protected static OperationDescriptor getOperationDescriptor(final String name) throws OperationNotFoundException { final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); OperationDescriptor operation = (OperationDescriptor) registry.getDescriptor(RenderedRegistryMode.MODE_NAME, name); if (operation != null) { return operation; } throw new OperationNotFoundException(Errors.format(ErrorKeys.OPERATION_NOT_FOUND_$1, name)); }
/** * Returns the operation descriptor for the specified JAI operation name. This method uses the * default {@link JAI} instance and looks for the {@value #RENDERED_MODE} mode. * * @param name The operation name. * @return The operation descriptor for the given name. * @throws OperationNotFoundException if no JAI descriptor was found for the given name. * @since 2.4 */ protected static OperationDescriptor getOperationDescriptor(final String name) throws OperationNotFoundException { final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); OperationDescriptor operation = (OperationDescriptor) registry.getDescriptor(RENDERED_MODE, name); if (operation != null) { return operation; } throw new OperationNotFoundException(Errors.format(ErrorKeys.OPERATION_NOT_FOUND_$1, name)); }
JAI.KEY_TILE_CACHE, JAI.getDefaultInstance().getTileCache()); if (operation != null) { worker.getClass()
setTileCache(tc); } else { setTileCache(JAI.getDefaultInstance().getTileCache());
/** * Gets the JAI instance to use from the rendering hints. */ private static JAI getJAI(final Hints hints) { if (hints != null) { final Object property = hints.get(Hints.JAI_INSTANCE); if (property instanceof JAI) { return (JAI) property; } } return JAI.getDefaultInstance(); }
final JAI jai = JAI.getDefaultInstance(); TileFactory tileFactory = (TileFactory) jai.getRenderingHint(JAI.KEY_TILE_FACTORY); if (tileFactory == null) {
private RenderedImage mosaicHeterogeneousImages(List<ImageInTile> sources) { // at the time of writing, only JAI-EXT mosaic can handle a mix of different // color models, we need to use it explicitly RenderedImage image; final ParameterBlockJAI pb = new ParameterBlockJAI(new it.geosolutions.jaiext.mosaic.MosaicDescriptor()); for (ImageInTile it : sources) { if (it.posx != 0 || it.posy != 0) { ImageWorker iw = new ImageWorker(it.image); iw.translate( it.posx, it.posy, Interpolation.getInstance(Interpolation.INTERP_NEAREST)); RenderedImage translated = iw.getRenderedImage(); pb.addSource(translated); } else { pb.addSource(it.image); } } pb.setParameter("mosaicType", MosaicDescriptor.MOSAIC_TYPE_OVERLAY); pb.setParameter("sourceAlpha", null); pb.setParameter("sourceROI", null); pb.setParameter("sourceThreshold", null); pb.setParameter("backgroundValues", new double[] {0}); pb.setParameter("nodata", null); RenderingHints hints = new Hints(JAI.getDefaultInstance().getRenderingHints()); hints.putAll(GeoTools.getDefaultHints()); image = new MosaicRIF().create(pb, hints); return image; }
final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); final OperationDescriptor operation = (OperationDescriptor)
public static synchronized void register(final boolean force) { if (!registered || force) { final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry(); final RenderedImageFactory rif = new WarpRIF(); registry.registerFactory( RenderedRegistryMode.MODE_NAME, "Warp", "it.geosolutions.jaiext", rif); registered = true; } }
final ImagingParameterDescriptors parameters; descriptor = JAI.getDefaultInstance().getOperationRegistry().getDescriptor(mode, "AddConst"); parameters = new ImagingParameterDescriptors(descriptor); final GenericName alias = parameters.getAlias().iterator().next();