本文整理汇总了Java中java.awt.image.renderable.ParameterBlock.getRenderedSource方法的典型用法代码示例。如果您正苦于以下问题:Java ParameterBlock.getRenderedSource方法的具体用法?Java ParameterBlock.getRenderedSource怎么用?Java ParameterBlock.getRenderedSource使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.renderable.ParameterBlock
的用法示例。
在下文中一共展示了ParameterBlock.getRenderedSource方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>CropOpImage</code> in the
* rendered layer.
*
* @param args The source image and bounding rectangle
* @param hints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock args,
RenderingHints renderHints) {
// Get the source image.
RenderedImage src = (RenderedImage)args.getRenderedSource(0);
// Get the parameters.
float originX = args.getFloatParameter(0);
float originY = args.getFloatParameter(1);
float width = args.getFloatParameter(2);
float height = args.getFloatParameter(3);
// Return the OpImage.
return new CropOpImage(src,
originX,
originY,
width,
height);
}
示例2: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of a DFT operator according to the scaling type.
*
* @param paramBlock The scaling type.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
RenderedImage source = paramBlock.getRenderedSource(0);
EnumeratedParameter scalingType =
(EnumeratedParameter)paramBlock.getObjectParameter(0);
EnumeratedParameter dataNature =
(EnumeratedParameter)paramBlock.getObjectParameter(1);
FFT fft = new FFT(true, new Integer(scalingType.getValue()), 2);
return new DFTOpImage(source, renderHints, layout, dataNature, fft);
}
示例3: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Create a new instance of GradientOpImage in the rendered layer.
* This method satisfies the implementation of RIF.
*
* @param paramBlock The source image and the gradient's
* horizontal kernel & vertical kernel.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
// Get BorderExtender from renderHints if any.
BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);
RenderedImage source = paramBlock.getRenderedSource(0);
// Get the Horizontal & Vertical kernels
KernelJAI kern_h = (KernelJAI)paramBlock.getObjectParameter(0);
KernelJAI kern_v = (KernelJAI)paramBlock.getObjectParameter(1);
return new GradientOpImage(source,
extender,
renderHints,
layout,
kern_h,
kern_v);
}
示例4: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* <p> Creates a new instance of ColorQuantizerOpImage in the
* rendered layer. This method satisfies the implementation of RIF.
*
* @param paramBlock The source image, the color quantization algorithm
* name, the maximum number of colors, the
* parameter for training (the histogram size for
* median-cut, the cycle for neuquant, and maximum tree
* size for oct-tree), and the ROI.
* @param renderHints RenderingHints.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
RenderedImage source = paramBlock.getRenderedSource(0);
ImageLayout layout = renderHints == null ? null :
(ImageLayout)renderHints.get(JAI.KEY_IMAGE_LAYOUT);
ColorQuantizerType algorithm =
(ColorQuantizerType)paramBlock.getObjectParameter(0);
int maxColorNum = paramBlock.getIntParameter(1);
int upperBound = paramBlock.getIntParameter(2);
ROI roi= (ROI)paramBlock.getObjectParameter(3);
int xPeriod = paramBlock.getIntParameter(4);
int yPeriod = paramBlock.getIntParameter(5);
// check if 3-band byte-type image
SampleModel sm = source.getSampleModel();
if (sm.getNumBands() != 3 && sm.getDataType() == DataBuffer.TYPE_BYTE)
throw new IllegalArgumentException("ColorQuantizerRIF0");
if (algorithm.equals(ColorQuantizerDescriptor.NEUQUANT))
return new NeuQuantOpImage(source, (Map)renderHints, layout,
maxColorNum, upperBound, roi,
xPeriod, yPeriod);
if (algorithm.equals(ColorQuantizerDescriptor.OCTTREE))
return new OctTreeOpImage(source, (Map)renderHints, layout,
maxColorNum, upperBound, roi,
xPeriod, yPeriod);
else
return new MedianCutOpImage(source, (Map)renderHints, layout,
maxColorNum, upperBound, roi,
xPeriod, yPeriod);
}
示例5: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>ConjugateOpImage</code> in the rendered
* layer.
*
* @param paramBlock The source image of which to take the conjugate.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
return new ConjugateOpImage(paramBlock.getRenderedSource(0),
renderHints, layout);
}
示例6: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of an IDCT operator.
*
* @param paramBlock The scaling type.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
RenderedImage source = paramBlock.getRenderedSource(0);
return new DCTOpImage(source, renderHints, layout, new FCT(false, 2));
}
示例7: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of a DCT operator.
*
* @param paramBlock The scaling type.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
RenderedImage source = paramBlock.getRenderedSource(0);
return new DCTOpImage(source, renderHints, layout, new FCT(true, 2));
}
示例8: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>ThresholdOpImage</code> in the
* rendered layer.
*
* @param args The source image and the input parameters.
* @param hints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock args,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
return new ThresholdOpImage(args.getRenderedSource(0),
renderHints,
layout,
(double[])args.getObjectParameter(0),
(double[])args.getObjectParameter(1),
(double[])args.getObjectParameter(2));
}
示例9: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>AndOpImage</code> in the
* rendered layer. This method satisifies the implementation of RIF.
*
* @param paramBlock The two source images to be "anded" together.
* @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);
return new AndOpImage(paramBlock.getRenderedSource(0),
paramBlock.getRenderedSource(1),
renderHints,
layout);
}
示例10: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>AddConstOpImage</code> in the
* rendered layer.
*
* @param args The source image and the constants.
* @param hints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock args,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
return new AddConstOpImage(args.getRenderedSource(0),
renderHints,
layout,
(double[])args.getObjectParameter(0));
}
示例11: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>NotOpImage</code> in the
* rendered layer. This method satisifies the implementation of RIF.
*
* @param paramBlock The source image to perform the logical "not"
* operation on.
* @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);
return new NotOpImage(paramBlock.getRenderedSource(0),
renderHints,
layout);
}
示例12: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>BorderOpImage</code>
* in the rendered layer.
*
* @param args The source image and the border information
* @param hints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock args,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
RenderedImage source = args.getRenderedSource(0);
int leftPad = args.getIntParameter(0);
int rightPad = args.getIntParameter(1);
int topPad = args.getIntParameter(2);
int bottomPad = args.getIntParameter(3);
BorderExtender type =
(BorderExtender)args.getObjectParameter(4);
if (type ==
BorderExtender.createInstance(BorderExtender.BORDER_WRAP)) {
int minX = source.getMinX() - leftPad;
int minY = source.getMinY() - topPad;
int width = source.getWidth() + leftPad + rightPad;
int height = source.getHeight() + topPad + bottomPad;
return new PatternOpImage(source.getData(),
source.getColorModel(),
minX, minY,
width, height);
} else {
return new BorderOpImage(source, renderHints, layout,
leftPad, rightPad, topPad, bottomPad,
type);
}
}
示例13: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>PiecewiseOpImage</code> in the
* rendered layer.
*
* @param args The source image and the breakpoints.
* @param hints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock args,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
return new PiecewiseOpImage(args.getRenderedSource(0),
renderHints,
layout,
(float[][][])args.getObjectParameter(0));
}
示例14: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Create a new instance of SeparableConvolveOpImage in the rendered layer.
* This method satisfies the implementation of RIF.
*
* @param paramBlock The source image and the convolution kernel.
*/
public RenderedImage create(ParameterBlock paramBlock,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
// Get BorderExtender from renderHints if any.
BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);
// Get the operation parameters.
int width = paramBlock.getIntParameter(0);
int height = paramBlock.getIntParameter(1);
int xOrigin = paramBlock.getIntParameter(2);
int yOrigin = paramBlock.getIntParameter(3);
// Allocate and initialize arrays.
float[] dataH = new float[width];
Arrays.fill(dataH, 1.0F/(float)width);
float[] dataV = null;
if(height == width) {
dataV = dataH;
} else {
dataV = new float[height];
Arrays.fill(dataV, 1.0F/(float)height);
}
// Construct a separable kernel.
KernelJAI kernel = new KernelJAI(width, height, xOrigin, yOrigin,
dataH, dataV);
// Construct and return the OpImage.
return new SeparableConvolveOpImage(paramBlock.getRenderedSource(0),
extender,
renderHints,
layout,
kernel);
}
示例15: create
import java.awt.image.renderable.ParameterBlock; //导入方法依赖的package包/类
/**
* Creates a new instance of <code>LookupOpImage</code>
* in the rendered layer.
*
* @param args The source image and the lookup table.
* @param hints Optionally contains destination image layout.
*/
public RenderedImage create(ParameterBlock args,
RenderingHints renderHints) {
// Get ImageLayout from renderHints if any.
ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
return new LookupOpImage(args.getRenderedSource(0),
renderHints,
layout,
(LookupTableJAI)args.getObjectParameter(0));
}