/** * Constructor for {@link BaseStatisticsOperationJAI}. * * @param operationDescriptor {@link OperationDescriptor} for the underlying JAI operation. */ public BaseStatisticsOperationJAI(OperationDescriptor operationDescriptor) { super( operationDescriptor, new ImagingParameterDescriptors( getOperationDescriptor(operationDescriptor.getName()), REPLACED_DESCRIPTORS)); }
/** * Constructor for {@link BaseMathOperationJAI}. * * @param operationDescriptor {@link OperationDescriptor} for the underlying JAI operation. */ public BaseMathOperationJAI(OperationDescriptor operationDescriptor) { super( operationDescriptor, new ImagingParameterDescriptors( getOperationDescriptor(operationDescriptor.getName()), REPLACED_DESCRIPTORS)); }
/** * Applies the JAI operation. The operation name can be fetch from {@link #operation}. The JAI * instance to use can be fetch from {@link #getJAI}. The default implementation returns the * following: * * <blockquote> * * <pre> * {@linkplain #getJAI getJAI}(hints).{@linkplain JAI#createNS createNS}({@linkplain #operation}.getName(), parameters, hints) * </pre> * * </blockquote> * * Subclasses may override this method in order to invokes a different JAI operation according * the parameters. * * @param parameters The parameters to be given to JAI. * @param hints The rendering hints to be given to JAI. * @return The result of JAI operation using the given parameters and hints. */ protected RenderedImage createRenderedImage( final ParameterBlockJAI parameters, final RenderingHints hints) { return getJAI(hints).createNS(operation.getName(), parameters, hints); }
/** * Forcefully registers the specified rendered operation in the JAI registry * * @param descriptor * @param rif * @param productName * @return true if the registration succeded, false if the registration was not required as the * operation was already available in the registry */ public static boolean registerRIF( final JAI jai, OperationDescriptor descriptor, RenderedImageFactory rif, String productName) { final OperationRegistry registry = jai.getOperationRegistry(); try { // see if the operation is already registered, avoid registering it twice new ParameterBlockJAI(descriptor.getName()); return false; } catch (Exception e) { registry.registerDescriptor(descriptor); final String descName = descriptor.getName(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); return true; } }
public OperationItem(OperationDescriptor op) { this.op = op; this.opName = op.getName(); this.vendor = op.getResourceBundle(null).getString(VENDOR_NAME); this.isMediaLibPreferred = false; }
/** * This method populates the inner map with a List of {@link OperationDescriptor}s. * * @param listDesc */ public void createMapFromDescriptors(List<OperationDescriptor> listDesc) { for (OperationDescriptor desc : listDesc) { OperationItem value = createItem(desc); map.put(desc.getName(), value); } }
public OperationItem(OperationDescriptor op) { this.op = op; this.opName = op.getName(); this.vendor = op.getResourceBundle(null).getString(VENDOR_NAME); this.isMediaLibPreferred = false; }
/** * This method populates the inner map with a List of {@link OperationDescriptor}s. * * @param listDesc */ public void createMapFromDescriptors(List<OperationDescriptor> listDesc) { for (OperationDescriptor desc : listDesc) { OperationItem value = createItem(desc); map.put(desc.getName(), value); } }
/** * Constructor for {@link AbstractStatisticsOperationJAI}. * * @param operationDescriptor * {@link OperationDescriptor} for the underlying JAI operation. */ public AbstractStatisticsOperationJAI(OperationDescriptor operationDescriptor) { super(operationDescriptor, new ImagingParameterDescriptors( getOperationDescriptor(operationDescriptor.getName()), REPLACED_DESCRIPTORS)); }
/** * Constructor for {@link AbstractStatisticsOperationJAI}. * * @param operationDescriptor * {@link OperationDescriptor} for the underlying JAI operation. */ public AbstractStatisticsOperationJAI(OperationDescriptor operationDescriptor) { super(operationDescriptor, new ImagingParameterDescriptors( getOperationDescriptor(operationDescriptor.getName()), REPLACED_DESCRIPTORS)); }
/** * Registers the ArtifactsFilter operation * * @param registry The registry with which to register the operation */ public void updateRegistry(OperationRegistry registry) { final OperationDescriptor op = new ArtifactsFilterDescriptor(); registry.registerDescriptor(op); final String descName = op.getName(); final RenderedImageFactory rif = new ArtifactsFilterRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the VectorBinarize operation and its associated image factories across all * supported operation modes. * * @param registry * The registry with which to register the operations and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new GTCropDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new GTCropCRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the ZonalStats operation * * @param registry The registry with which to register the operation */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new ZonalStatsDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new ZonalStatsRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the Regionalize operation and its * associated image factories across all supported operation modes. * * @param registry The registry with which to register the operations * and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new RegionalizeDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new RegionalizeRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the VectorBinarize operation and its * associated image factories across all supported operation modes. * * @param registry The registry with which to register the operations * and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new VectorBinarizeDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new VectorBinarizeRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the MaskedConvolve operation and its * associated image factories across all supported operation modes. * * @param registry The registry with which to register the operations * and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new MaskedConvolveDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new MaskedConvolveRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the Contour operation and its * associated image factories across all supported operation modes. * * @param registry The registry with which to register the operations * and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new ContourDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new ContourRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the Contour operation and its * associated image factories across all supported operation modes. * * @param registry The registry with which to register the operations * and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new ContourDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new ContourRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Registers the Vectorize operation and its * associated image factories across all supported operation modes. * * @param registry The registry with which to register the operations * and their factories. */ public void updateRegistry(OperationRegistry registry) { OperationDescriptor op = new VectorizeDescriptor(); registry.registerDescriptor(op); String descName = op.getName(); RenderedImageFactory rif = new VectorizeRIF(); registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, productName, rif); } }
/** * Applies a unary operation on the current image using the given parameters. * * @param parameters The parameters, without any source. The current {@linkplain #image} * will be added directly as the source in the given parameter block. * @param checksum The checksum of the expected result, or 0 for ignoring it. */ protected final synchronized void applyUnary(final ParameterBlockJAI parameters, final long checksum) { final String operation = parameters.getOperationDescriptor().getName(); image = JAI.create(operation, parameters.addSource(image)); if (checksum != 0) { String message = "Checksum failed for operation \"" + operation + "\"."; assertEquals(message, checksum, Commons.checksum(image)); } } }