Lines Matching refs:filter

40  * ports. Every filter belongs to exactly one graph and cannot be moved to another graph.
53 /** Map from name of filter to the filter instance */
73 /** Map from name of filter to the filter instance */
85 * Add a filter to the graph.
87 * Adds the specified filter to the set of filters of this graph. The filter must not be in
88 * the graph already, and the filter's name must be unique within the graph.
90 * @param filter the filter to add to the graph.
91 * @throws IllegalArgumentException if the filter is in the graph already, or its name is
94 public void addFilter(Filter filter) {
95 if (mFilterMap.values().contains(filter)) {
96 throw new IllegalArgumentException("Attempting to add filter " + filter + " that "
98 } else if (mFilterMap.containsKey(filter.getName())) {
99 throw new IllegalArgumentException("Graph contains filter with name '"
100 + filter.getName() + "' already!");
102 mFilterMap.put(filter.getName(), filter);
113 * @return the VariableSource filter that holds the value of this variable.
128 FrameSlotSource filter = new FrameSlotSource(mContext, name, slotName);
129 addFilter(filter);
130 return filter;
134 FrameSlotTarget filter = new FrameSlotTarget(mContext, name, slotName);
135 addFilter(filter);
136 return filter;
143 * @param sourceFilterName The name of the source filter.
145 * @param targetFilterName The name of the target filter.
153 throw new IllegalArgumentException("Unknown filter '" + sourceFilterName + "'!");
155 throw new IllegalArgumentException("Unknown filter '" + targetFilterName + "'!");
164 * @param sourceFilter The source filter.
166 * @param targetFilter The target filter.
175 * Returns the filter with the specified name.
177 * @return the filter with the specified name, or null if no such filter exists.
208 // Get filter to connect to
209 Filter filter = getFilter(filterName);
210 if (filter == null) {
211 throw new IllegalArgumentException("Unknown filter '" + filterName + "'!");
221 // Create new VariableSource and connect it to the target filter and port
225 ((Filter)valueSource).connect("value", filter, inputName);
228 + "' of filter '" + filterName + "'!", e);
242 // Get filter to connect to
243 Filter filter = getFilter(filterName);
244 if (filter == null) {
245 throw new IllegalArgumentException("Unknown filter '" + filterName + "'!");
254 // Connect variable (and possibly branch) variable to filter
256 connectAndBranch(variable, "value", filter, inputName);
259 + "' of filter '" + filterName + "'!", e);
330 * Forcibly tear down a filter graph.
332 * Call this to release any resources associated with the filter graph, its filters and any of
369 * Returns the filter with the specified name.
371 * @return the filter with the specified name, or null if no such filter exists.
384 * @return The VariableSource filter instance with the specified name.
426 * Binds a filter to a view.
428 * ViewFilter instances support visualizing their data to a view. See the specific filter
431 * @param filterName the name of the filter to bind.
433 * @throws IllegalStateException if the filter is in an illegal state.
434 * @throws IllegalArgumentException if no such view-filter exists.
437 Filter filter = mFilterMap.get(filterName);
438 if (filter != null && filter instanceof ViewFilter) {
439 ((ViewFilter)filter).bindToView(view);
441 throw new IllegalArgumentException("Unknown view filter '" + filterName + "'!");
449 Filter filter = mFilterMap.get(filterName);
450 if (filter != null && filter instanceof ValueTarget) {
451 ((ValueTarget)filter).setListener(listener, onCallerThread);
453 throw new IllegalArgumentException("Unknown ValueTarget filter '" + filterName + "'!");
500 * Check each filter's signatures if all requirements are fulfilled.
516 for (Filter filter : filters) {
518 Log.d("FilterGraph", "Checking filter " + filter.getName() + "...");
520 Signature signature = filter.getSignature();
521 signature.checkInputPortsConform(filter);
522 signature.checkOutputPortsConform(filter);
527 * Wipes the filter references in this graph, so that they may be collected.
537 for (Filter filter : mFilterMap.values()) {
538 for (InputPort inputPort : filter.getConnectedInputPorts()) {
541 for (OutputPort outputPort : filter.getConnectedOutputPorts()) {