sourceGraphic = new PadRable8Bit(sourceGraphic, filterRegion,
PadMode.ZERO_PAD);
// 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 == null) {
// error in one of the primitives, disable the filter
return null;
} else if (in == sourceGraphic) {
// no filter primitive found, so output transparent black
in = createEmptyFilter(filterElement, filterRegion, filteredElement,
filteredNode, ctx);
}
filterChain.setSource(in);
return filterChain;
}