本文整理汇总了Java中java.awt.image.renderable.ParameterBlock.getSources方法的典型用法代码示例。如果您正苦于以下问题:Java ParameterBlock.getSources方法的具体用法?Java ParameterBlock.getSources怎么用?Java ParameterBlock.getSources使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.renderable.ParameterBlock
的用法示例。
在下文中一共展示了ParameterBlock.getSources方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>BandMergeOpImage</code> in the
* rendered layer. This method satisifies the implementation of RIF.
*
* @param paramBlock The two or more source images to be "BandMerged"
* together, and their corresponding float array vector.
* @param renderHints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
// get vector of RenderedImage sources and parameters
Vector sources = paramBlock.getSources();
//Vector params = paramBlock.getParameters();
return new BandMergeOpImage(sources,
renderHints,
layout);
}
示例2: performImageOp
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Transforms an ROI using an imaging operation. The operation is
* specified by a <code>RenderedImageFactory</code>. The
* operation's <code>ParameterBlock</code>, minus the image source
* itself is supplied, along with an index indicating where to
* insert the ROI image. The <code>renderHints</code> argument
* allows rendering hints to be passed in.
*
* @param RIF A <code>RenderedImageFactory</code> that will be used
* to create the op.
* @param paramBlock A <code>ParameterBlock</code> containing all
* sources and parameters for the op except for the ROI itself.
* @param sourceIndex The index of the <code>ParameterBlock</code>'s
* sources where the ROI is to be inserted.
* @param renderHints A <code>RenderingHints</code> object containing
* rendering hints, or null.
* @throws IllegalArgumentException if RIF is null.
* @throws IllegalArgumentException if paramBlock is null.
*/
public ROI performImageOp(RenderedImageFactory RIF,
ParameterBlock paramBlock,
int sourceIndex,
RenderingHints renderHints) {
if ( RIF == null || paramBlock == null ) {
throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
}
// Clone the ParameterBlock and insert a source
ParameterBlock pb = (ParameterBlock) paramBlock.clone();
Vector sources = pb.getSources();
sources.insertElementAt(this.getAsImage(), sourceIndex);
// Create a new RenderedImage based on the RIF
// and ParameterBlock.
RenderedImage im = RIF.create(pb, renderHints);
return new ROI(im, threshold);
}
示例3: removeSource
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Removes the specified <code>Object</code> source from the
* <code>ParameterBlock</code> of this node.
*
* <p> The node is removed automatically as a sink if the source is a
* <code>PlanarImage</code> or a <code>CollectionImage</code>.
*
* @param source A <code>Object</code> to be removed.
*
* @throws IllegalArgumentException if
* <code>source</code> is <code>null</code>.
* @return <code>true</code> if the element was present, <code>false</code>
* otherwise.
*
* @since JAI 1.1
*/
public synchronized boolean removeSource(Object source) {
if (source == null) {
throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
}
ParameterBlock pb =
(ParameterBlock)nodeSupport.getParameterBlock().clone();
Vector nodeSources = pb.getSources();
if(nodeSources.contains(source)) {
if(source instanceof PlanarImage) {
((PlanarImage)source).removeSink(this);
} else if(source instanceof CollectionImage) {
((CollectionImage)source).removeSink(this);
}
}
boolean result = nodeSources.remove(source);
nodeSupport.setParameterBlock(pb);
return result;
}
示例4: getPropertySource
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Constructs and returns a <code>PropertySource</code> suitable for
* use by a given <code>OperationNode</code>. The
* <code>PropertySource</code> includes properties copied from prior
* nodes as well as those generated at the node itself. Additionally,
* property suppression is taken into account. The actual
* implementation of <code>getPropertySource()</code> may make use
* of deferred execution and caching.
*
* @param op the <code>OperationNode</code> requesting its
* <code>PropertySource</code>.
*
* @throws IllegalArgumentException if op is null.
*
* @since JAI 1.1
*/
public PropertySource getPropertySource(OperationNode op) {
if (op == null)
throw new IllegalArgumentException(JaiI18N.getString("Generic0"));
// Get the source Vector from the ParameterBlock.
ParameterBlock pb = op.getParameterBlock();
Vector pv = (pb == null) ? null : pb.getSources();
// If the source Vector is null, replace it by a zero-length
// Vector. This tricks the DescriptorCache into accepting the
// parameter and the PropertyEnvironment object created in
// the DescriptorCache works with either a null or zero-length
// source Vector.
if(pv == null) {
pv = new Vector();
}
return getPropertySource(op.getRegistryModeName(),
op.getOperationName(), op, pv);
}
示例5: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Renders a "Mosaic" operation node.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
return
new MosaicOpImage(paramBlock.getSources(),
RIFUtil.getImageLayoutHint(renderHints),
renderHints,
(MosaicType)paramBlock.getObjectParameter(0),
(PlanarImage[])paramBlock.getObjectParameter(1),
(ROI[])paramBlock.getObjectParameter(2),
(double[][])paramBlock.getObjectParameter(3),
(double[])paramBlock.getObjectParameter(4));
}
示例6: evaluateParameters
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* If any <code>DeferredData</code> parameters are detected,
* a new <code>ParameterBlock</code> is constructed and the
* <code>DeferredData</code> object is replaced with what its
* <code>getData()</code> returns.
*/
public static ParameterBlock evaluateParameters(ParameterBlock pb) {
if(pb == null) {
throw new IllegalArgumentException();
}
Vector parameters = pb.getParameters();
Vector paramEval = evaluateParameters(parameters);
return paramEval == parameters ?
pb : new ParameterBlock(pb.getSources(), paramEval);
}