// make the initial source as a RenderableImage
GraphicsNodeRable sourceGraphic = new GraphicsNodeRable8Bit
(filteredNode, ctx.getGraphicsNodeRenderContext());
// build a FilterChainRable8Bit
FilterChainRable filterChain
= new FilterChainRable8Bit(sourceGraphic, filterRegion);
// 'filterRes' attribute - default is implementation specific
float [] filterRes = SVGUtilities.convertFilterRes(filterElement, ctx);
filterChain.setFilterResolutionX((int)filterRes[0]);
filterChain.setFilterResolutionY((int)filterRes[1]);
// create a map for filter nodes to advertise themselves as named source
Map filterNodeMap = new HashMap(11);
filterNodeMap.put(SVG_SOURCE_GRAPHIC_VALUE, sourceGraphic);
Filter in = buildFilterPrimitives(filterElement,
filterRegion,
filteredElement,
filteredNode,
sourceGraphic,
filterNodeMap,
ctx);
if (in == sourceGraphic) {
return null; // no filter primitives found, disable the filter.
} else {
filterChain.setSource(in);
return filterChain;
}
}