/** * Constructs a grid coverage operation backed by a JAI operation. The operation descriptor must * supports the {@code "rendered"} mode (which is the case for most JAI operations). * * @param operation The JAI operation descriptor. */ public OperationJAI(final OperationDescriptor operation) { this(operation, new ImagingParameterDescriptors(operation)); }
/** * Constructor for {@link BaseMathOperationJAI}. * * @param operationDescriptor {@link OperationDescriptor} for the underlying JAI operation. * @param replacements {@link ImagingParameterDescriptors} that should replace the correspondent * {@link ImagingParameters} in order to change the default behavior they have inside JAI. */ public BaseMathOperationJAI( OperationDescriptor operationDescriptor, ImagingParameterDescriptors replacements) { super( operationDescriptor, new ImagingParameterDescriptors( ImagingParameterDescriptors.properties(operationDescriptor), operationDescriptor, RenderedRegistryMode.MODE_NAME, ImagingParameterDescriptors.DEFAULT_SOURCE_TYPE_MAP, REPLACED_DESCRIPTORS)); }
/** * Constructs a parameter descriptor wrapping the specified JAI descriptor. If {@code operation} * is non-null, then {@code descriptor} should be derived from it. This constructor is private * in order to ensure this condition. */ private ImagingParameterDescriptors( final Map<String, ?> properties, final ParameterListDescriptor descriptor, final RegistryElementDescriptor operation, final String registryMode, final Map<Class<?>, Class<?>> sourceTypeMap, final Collection<ParameterDescriptor> extension) { super( properties, 1, 1, asDescriptors(descriptor, operation, registryMode, sourceTypeMap, extension)); this.descriptor = descriptor; this.operation = operation; this.registryMode = registryMode; }
descriptor = JAI.getDefaultInstance().getOperationRegistry().getDescriptor(mode, "AddConst"); parameters = new ImagingParameterDescriptors(descriptor); final GenericName alias = parameters.getAlias().iterator().next(); assertEquals("Name", "AddConst", parameters.getName().getCode()); assertEquals( "Authority", author, parameters.getName().getAuthority().getTitle().toString()); assertEquals("Vendor", vendor, alias.scope().name().toString()); assertNotNull("Version", parameters.getName().getVersion()); assertLocalized("Vendor", alias.scope().name().toInternationalString()); assertLocalized("Remarks", parameters.getRemarks()); assertTrue("Remarks", parameters.getRemarks().toString().trim().length() > 0); final ParameterDescriptor param = (ParameterDescriptor) parameters.descriptor("constants"); assertEquals("Name", "constants", param.getName().getCode()); assertEquals("Type", double[].class, param.getValueClass()); assertFalse( parameters .getRemarks() .toString() .trim() final ImagingParameters values = (ImagingParameters) parameters.createValue(); for (int i = 0; i < 20; i++) { final ParameterValue before = values.parameter("constants");
replacingDescriptors.add(SPATIAL_SUBSAMPLING_X); final ImagingParameterDescriptors ripd = new ImagingParameterDescriptors(operation, replacingDescriptors); final ParameterValueGroup rip = ripd.createValue(); assertSame(ripd, rip.getDescriptor()); final ParameterValue p = rip.parameter("xPeriod");
/** * Constructs a parameter descriptor wrapping the specified JAI operation, including sources. * The {@linkplain #getName name for this parameter group} will be inferred from the {@linkplain * RegistryElementDescriptor#getName name of the supplied registry element} using the {@link * #properties properties} method. * * <p>The <cite>source type map</cite> default to a (<code>{@linkplain RenderedImage}.class * </code>, <code>{@linkplain GridCoverage}.class</code>) key-value pair and the <cite>registry * mode</cite> default to {@value javax.media.jai.registry.RenderedRegistryMode#MODE_NAME}. * * @param operation The JAI's operation descriptor, usually as an instance of {@link * OperationDescriptor}. */ public ImagingParameterDescriptors(final RegistryElementDescriptor operation) { this( properties(operation), operation, DEFAULT_SOURCE_TYPE_MAP, RenderedRegistryMode.MODE_NAME); }
ensureNonNull("descriptor", descriptor); final Map<String, ParameterDescriptor> replacements = new LinkedHashMap<String, ParameterDescriptor>();
final Class[] types = listDescriptor.getParamClasses(); final String[] enumerated = listDescriptor.getEnumeratedParameterNames(); final List<GeneralParameterDescriptor> descriptors = descriptor.descriptors(); final GeneralParameterValue[] values = new GeneralParameterValue[descriptors.size()]; for (int i = 0; i < values.length; i++) {
/** * Constructs a parameter descriptor wrapping the specified JAI operation, including sources. * The {@linkplain #getName name for this parameter group} will be inferred from the {@linkplain * RegistryElementDescriptor#getName name of the supplied registry element} using the {@link * #properties properties} method. * * <p>The <cite>source type map</cite> default to a (<code>{@linkplain RenderedImage}.class * </code>, <code>{@linkplain GridCoverage}.class</code>) key-value pair and the <cite>registry * mode</cite> default to {@value javax.media.jai.registry.RenderedRegistryMode#MODE_NAME}. * * @param operation The JAI's operation descriptor, usually as an instance of {@link * OperationDescriptor}. * @param extension Additional parameters to put in this descriptor, or {@code null} if none. If * a parameter has the same name than an {@code operation} parameter, then the extension * overrides the later. * @since 2.4 */ public ImagingParameterDescriptors( final RegistryElementDescriptor operation, final Collection<ParameterDescriptor> extension) { this( properties(operation), operation, RenderedRegistryMode.MODE_NAME, DEFAULT_SOURCE_TYPE_MAP, extension); }
/** * Constructor for {@link BaseMathOperationJAI}. * * @param name of the underlying JAI operation. */ public BaseMathOperationJAI(String name) { super( getOperationDescriptor(name), new ImagingParameterDescriptors( getOperationDescriptor(name), new HashSet<ParameterDescriptor>(REPLACED_DESCRIPTORS))); }
/** * Constructor for {@link BaseStatisticsOperationJAI}. * * @param operationDescriptor {@link OperationDescriptor} for the underlying JAI operation. * @param replacements {@link ImagingParameterDescriptors} that should replace the correspondent * {@link ImagingParameters} in order to change the default behavior they have inside JAI. */ public BaseStatisticsOperationJAI( OperationDescriptor operationDescriptor, ImagingParameterDescriptors replacements) { super( operationDescriptor, new ImagingParameterDescriptors( ImagingParameterDescriptors.properties(operationDescriptor), operationDescriptor, RenderedRegistryMode.MODE_NAME, ImagingParameterDescriptors.DEFAULT_SOURCE_TYPE_MAP, REPLACED_DESCRIPTORS)); } /**
/** * Constructor for {@link BaseStatisticsOperationJAI}. * * @param name of the underlying JAI operation. */ public BaseStatisticsOperationJAI(String name) { super( getOperationDescriptor(name), new ImagingParameterDescriptors( getOperationDescriptor(name), new HashSet<ParameterDescriptor>(REPLACED_DESCRIPTORS))); }
/** * Constructor for {@link AbstractStatisticsOperationJAI}. * * @param operationDescriptor * {@link OperationDescriptor} for the underlying JAI operation. * @param replacements * {@link ImagingParameterDescriptors} that should replace the * correspondent {@link ImagingParameters} in order to change the * default behaviour they have inside JAI. */ public AbstractStatisticsOperationJAI( OperationDescriptor operationDescriptor, ImagingParameterDescriptors replacements) { super(operationDescriptor, new ImagingParameterDescriptors( ImagingParameterDescriptors.properties(operationDescriptor), operationDescriptor, RenderedRegistryMode.MODE_NAME, ImagingParameterDescriptors.DEFAULT_SOURCE_TYPE_MAP, REPLACED_DESCRIPTORS)); } /**
public BandMerge() { super( getOperationDescriptor("BandMerge"), new ImagingParameterDescriptors( getOperationDescriptor("BandMerge"), REPLACED_DESCRIPTORS)); }
/** * Constructor for {@link AbstractStatisticsOperationJAI}. * * @param operationDescriptor * {@link OperationDescriptor} for the underlying JAI operation. * @param replacements * {@link ImagingParameterDescriptors} that should replace the * correspondent {@link ImagingParameters} in order to change the * default behavior they have inside JAI. */ public AbstractStatisticsOperationJAI( OperationDescriptor operationDescriptor, ImagingParameterDescriptors replacements) { super(operationDescriptor, new ImagingParameterDescriptors( ImagingParameterDescriptors.properties(operationDescriptor), operationDescriptor, RenderedRegistryMode.MODE_NAME, ImagingParameterDescriptors.DEFAULT_SOURCE_TYPE_MAP, REPLACED_DESCRIPTORS)); } /**
/** * 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)); }
/** * Constructs a parameter group wrapping the specified JAI parameters. A default {@link * ImagingParameterDescriptors} is created. * * @param properties Set of properties. Should contains at least {@code "name"}. * @param parameters The JAI's parameters. */ public ImagingParameters(final Map<String, ?> properties, final ParameterList parameters) { super(new ImagingParameterDescriptors(properties, parameters.getParameterListDescriptor())); this.parameters = parameters; ensureNonNull("parameters", parameters); }
/** * 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)); }
public Mosaic() { super( getOperationDescriptor("Mosaic"), new ImagingParameterDescriptors( getOperationDescriptor("Mosaic"), REPLACED_DESCRIPTORS)); }
/** * Constructs a grid coverage operation backed by a JAI operation. The operation descriptor * must supports the {@code "rendered"} mode (which is the case for most JAI operations). * * @param operation The JAI operation descriptor. */ public OperationJAI(final OperationDescriptor operation) { this(operation, new ImagingParameterDescriptors(operation)); }