当前位置: 首页>>代码示例>>Java>>正文


Java ParameterBlock.getRenderedSource方法代码示例

本文整理汇总了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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:26,代码来源:CropCRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:22,代码来源:DFTCRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:30,代码来源:GradientRIF.java

示例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);

   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:47,代码来源:ColorQuantizerRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:16,代码来源:ConjugateCRIF.java

示例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));
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:16,代码来源:IDCTCRIF.java

示例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));
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:16,代码来源:DCTCRIF.java

示例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));
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:21,代码来源:ThresholdCRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:AndCRIF.java

示例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));
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:AddConstCRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:NotCRIF.java

示例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);
    }
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:39,代码来源:BorderRIF.java

示例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));
   }
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:PiecewiseCRIF.java

示例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);
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:44,代码来源:BoxFilterRIF.java

示例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));
}
 
开发者ID:RoProducts,项目名称:rastertheque,代码行数:19,代码来源:LookupCRIF.java


注:本文中的java.awt.image.renderable.ParameterBlock.getRenderedSource方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。