Package javax.media.jai

Examples of javax.media.jai.OperationRegistry


    /**
     * Manually registers the operation in the registry in case it's not already there
     */
    public static void register() {
        try {
            final OperationRegistry opr = JAI.getDefaultInstance().getOperationRegistry();
            if(opr.getDescriptor(RenderedRegistryMode.MODE_NAME, OPERATION_NAME) == null) {
                Registry.registerRIF(JAI.getDefaultInstance(), new ColorIndexerDescriptor(),
                        new ColorIndexerCRIF(), "org.geotools");
            }
        } catch (Exception e) {
            if (LOGGER.isLoggable(Level.FINE)) {
View Full Code Here


     * Register the "SampleTranscode" image operation to the operation registry of
     * the specified JAI instance. This method is invoked by the static initializer
     * of {@link GridSampleDimension}.
     */
    public static void register(final JAI jai) {
        final OperationRegistry registry = jai.getOperationRegistry();
        try {
            registry.registerDescriptor(new NoDataReplacerDescriptor());
            registry.registerFactory(RenderedRegistryMode.MODE_NAME, OPERATION_NAME,
                                     "gce.geotools.org", new NoDataReplacerCRIF());
        } catch (IllegalArgumentException exception) {
            final LogRecord record = Loggings.format(Level.SEVERE,
                   LoggingKeys.CANT_REGISTER_JAI_OPERATION_$1, OPERATION_NAME);
            record.setSourceClassName("GridSampleDimension");
View Full Code Here

*/
public class ArtifactsFilterTest extends Assert {

  @Before
  public void setup() throws IOException {
    OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
    try {
      final OperationDescriptor op = new ArtifactsFilterDescriptor();
      registry.registerDescriptor(op);
      final String descName = op.getName();
      final RenderedImageFactory rif = new ArtifactsFilterRIF();
      registry.registerFactory(RenderedRegistryMode.MODE_NAME, descName, "org.geotools.gce.imagemosaic.processing", rif);
    } catch (Exception e) {
     
    }
  }
View Full Code Here

    public synchronized static void setNativeAccelerationAllowed(final String operation,
                                                                 final boolean  allowed,
                                                                 final JAI jai)
    {
        final String product = "com.sun.media.jai";
        final OperationRegistry registry = jai.getOperationRegistry();

        // TODO: Check if we can remove SuppressWarnings with a future JAI version.
        @SuppressWarnings("unchecked")
        final List<RenderedImageFactory> factories = registry.getOrderedFactoryList(
                RenderedRegistryMode.MODE_NAME, operation, product);
        if (factories != null) {
            RenderedImageFactory   javaFactory = null;
            RenderedImageFactory nativeFactory = null;
            Boolean               currentState = null;
View Full Code Here

  public static boolean registerRIF(
      final JAI jai,
      final OperationDescriptor descriptor,
      final String name,
      final ContextualRenderedImageFactory crif) {
    final OperationRegistry registry = jai.getOperationRegistry();
    try {
      registry.registerDescriptor(descriptor);
      registry.registerFactory(RenderedRegistryMode.MODE_NAME,
          name, GEOTOOLS_PRODUCT,crif);
      return true;
    } catch (IllegalArgumentException exception) {
      final LogRecord record = Loggings.format(Level.SEVERE,
          LoggingKeys.CANT_REGISTER_JAI_OPERATION_$1, name);
View Full Code Here

     * @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;
        }
    }
View Full Code Here

   
    static boolean registered = false;
   
    public synchronized static void register(boolean force) {
       if(!registered || force) {
           OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
           PropertyGenerator[] stdGenerators = new WarpDescriptor().getPropertyGenerators("rendered");
           registry.addPropertyGenerator("rendered", "Warp", new GTWarpPropertyGenerator());
           registered = true;
       }
    }
View Full Code Here

                    null,            // Maximal value
                    null,            // Unit of measure
                    false);          // Parameter is optional

        // Gets the descriptors for extrema  JAI operation
        final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
        final OperationDescriptor operation = (OperationDescriptor) registry
                        .getDescriptor(RenderedRegistryMode.MODE_NAME, "Extrema");

        // Gets the ImagingParameterDescriptors to replace xPeriod
        final List<ParameterDescriptor> replacingDescriptors = new ArrayList<ParameterDescriptor>(1);
        replacingDescriptors.add(SPATIAL_SUBSAMPLING_X);
View Full Code Here

     * This allow to apply the operation in the same way than other JAI operations, without
     * any need for a direct access to package-private method.
     */
    @Test
    public void testSampleTranscoderCreation() {
        final OperationRegistry registry = JAI.getDefaultInstance().getOperationRegistry();
        assertNotNull(registry.getDescriptor("rendered", SampleTranscoder.OPERATION_NAME));

        final BufferedImage       dummy = new BufferedImage(10, 10, BufferedImage.TYPE_BYTE_GRAY);
        final ParameterBlockJAI   param = new ParameterBlockJAI(SampleTranscoder.OPERATION_NAME);
        final ParameterListDescriptor d = param.getParameterListDescriptor();
        assertTrue(d.getParamClasses()[0].equals(GridSampleDimension[].class));
View Full Code Here

     * Register the "SampleTranscode" image operation to the operation registry of
     * the specified JAI instance. This method is invoked by the static initializer
     * of {@link GridSampleDimension}.
     */
    public static void register(final JAI jai) {
        final OperationRegistry registry = jai.getOperationRegistry();
        try {
            registry.registerDescriptor(new Descriptor());
            registry.registerFactory(RenderedRegistryMode.MODE_NAME, OPERATION_NAME,
                                     "geotools.org", new CRIF());
        } catch (IllegalArgumentException exception) {
            final LogRecord record = Loggings.format(Level.SEVERE,
                   LoggingKeys.CANT_REGISTER_JAI_OPERATION_$1, OPERATION_NAME);
            // Note: GridSampleDimension is the public class that use this transcoder.
View Full Code Here

TOP

Related Classes of javax.media.jai.OperationRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.