/** * Creates a new instance of parameter value group. A JAI {@link javax.media.jai.ParameterList} * is created for holding parameter values, and wrapped into an {@link ImagingParameters} * instance. * * @return The new value initialized to the default value. */ @Override public ParameterValueGroup createValue() { return new ImagingParameters(this); }
/** * Returns all values in this group as an unmodifiable list. The returned list contains all * parameters found in the {@linkplain #parameters underlying parameter list}. In addition, it * may contains sources found in the JAI's {@linkplain OperationDescriptor operation * descriptor}. */ public synchronized List<GeneralParameterValue> values() { if (values == null) { createElements(); } assert ((ParameterDescriptorGroup) descriptor).descriptors().size() == values.size() : values; return values; }
final ParameterValue before = values.parameter("constants"); if ((i % 5) == 0) { values.parameters.setParameter("constants", new double[] {i}); } else { values.parameter("constants").setValue(new double[] {i}); values.parameter("constants").doubleValueList(), (double[]) values.parameters.getObjectParameter("constants"))); assertSame(before, values.parameter("constants")); assertNotNull(values.toString()); final ImagingParameters copy = values.clone(); assertNotSame("clone", values, copy); assertNotSame("clone", values.parameters, copy.parameters);
/** * Returns the value in this group for the specified identifier code. Getter and setter methods * will use directly the JAI's {@linkplain #parameters parameter list} as the underlying backing * store, when applicable. * * @param name The case insensitive identifier code of the parameter to search for. * @return The parameter value for the given identifier code. * @throws ParameterNotFoundException if there is no parameter value for the given identifier * code. */ public synchronized ParameterValue parameter(String name) throws ParameterNotFoundException { ensureNonNull("name", name); name = name.trim(); final List<GeneralParameterValue> values = values(); final int size = values.size(); for (int i = 0; i < size; i++) { final ParameterValue value = (ParameterValue) values.get(i); if (AbstractIdentifiedObject.nameMatches(value.getDescriptor(), name)) { return value; } } throw new ParameterNotFoundException( Errors.format(ErrorKeys.MISSING_PARAMETER_$1, name), name); }
/** * 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); }
final ParameterDescriptor d = (ParameterDescriptor) descriptors.get(i); final ParameterValue value; if (compatible(d, listDescriptor, names, types, enumerated)) {
final GeneralParameterValue[] cloned = copy.createElements(); assert values.size() == cloned.length : values; for (int i = 0; i < cloned.length; i++) {