Java 8 ParameterBlock - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 ParameterBlock class.

This code example shows how to use the following methods:getObjectParameter, getRenderedSource
    public RenderedImage create(ParameterBlock args,
                                RenderingHints renderHints) {
        // Get ImageLayout from renderHints if any. 
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
 
        return new LCMSColorConvertOpImage(args.getRenderedSource(0),
                                       renderHints,
				       layout,
				       (ColorModel) args.getObjectParameter(0),
                                       (LCMSColorConvertDescriptor.RenderingIntent) args.getObjectParameter(1),
                                       (ICC_Profile) args.getObjectParameter(2),
                                       (LCMSColorConvertDescriptor.RenderingIntent) args.getObjectParameter(3));
    } 
} 
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getObjectParameter, getRenderedSource
                                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));
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getObjectParameter, getRenderedSource
 
 
        // Get BorderExtender from renderHints if any. 
        BorderExtender extender = RIFUtil.getBorderExtenderHint(renderHints);
 
        RenderedImage source = paramBlock.getRenderedSource(0);
        Warp warp = (Warp)paramBlock.getObjectParameter(0);
        Interpolation interp = (Interpolation)paramBlock.getObjectParameter(1);
 
        double[] backgroundValues = (double[])paramBlock.getObjectParameter(2);
 
        if (interp instanceof InterpolationNearest) {
            return new WarpNearestOpImage(source,
                                          renderHints,
                                          layout,
                                          warp,
                                          interp,
                                          backgroundValues);
        } else if (interp instanceof InterpolationBilinear) {
            return new WarpBilinearOpImage(source, extender, renderHints,
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:add, getObjectParameter, getRenderedSource
                                RenderingHints 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,

7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getObjectParameter, getRenderedSource
                                RenderingHints renderHints) {
        // Get ImageLayout from renderHints if any. 
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
         
 
        RenderedImage source = paramBlock.getRenderedSource(0);
        LookupTableJAI lookupTable =
            (LookupTableJAI)paramBlock.getObjectParameter(0);
        KernelJAI kernel = (KernelJAI)paramBlock.getObjectParameter(1);
 
        return new ErrorDiffusionOpImage(source, renderHints, layout,
                                         lookupTable, kernel);
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:add, addSource
        assertEquals(minimum[1], maximum[1], 0.0);
        assertEquals(minimum[2], maximum[2], 0.0);
    } 
 
    private ParameterBlock buildParameterBlock(BufferedImage source) {
        ParameterBlock pb = new ParameterBlock();
        pb.addSource(source);
        pb.add((float) 10);
        pb.add((float) 50);
        pb.add((float) 20);
        pb.add((float) 20);
        return pb;
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getObjectParameter, getSource
	 * @param message 
	 *            A buffer for formatting an error message if any. 
	 */ 
	protected boolean validateParameters(final String modeName,
			final ParameterBlock param, final StringBuffer message) {
		if (!super.validateParameters(modeName, param, message)) {
			return false; 
		} 
		final int numColors = ((Integer) param.getObjectParameter(0)).intValue();
		final int alphaThreashold = ((Integer) param.getObjectParameter(1)).intValue();
		final int ssx = ((Integer) param.getObjectParameter(2)).intValue();
		final int ssy = ((Integer) param.getObjectParameter(3)).intValue();
		final RenderedImage source = (RenderedImage) param.getSource(0);
		if(ssx<=1&&ssx>=source.getWidth())
			return false; 
		if(ssy<=1&&ssy>=source.getHeight())
			return false; 
		if(alphaThreashold<0||alphaThreashold>255)
			return false; 
		if(numColors<=0||(numColors>256))
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getObjectParameter, getRenderedSource
    public RenderedImage create(ParameterBlock paramBlock,
                                RenderingHints renderHints) {
        // Get ImageLayout from renderHints if any. 
        ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
 
        return new BlendOpImage(paramBlock.getRenderedSource(0),
                                paramBlock.getRenderedSource(1),
                                (String) paramBlock.getObjectParameter(0),
                                (Double) paramBlock.getObjectParameter(1),
                                (ROI) paramBlock.getObjectParameter(2),
                                (RenderedImage) paramBlock.getObjectParameter(3),
                                renderHints,
                                layout);
    } 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getIntParameter, getSource
 * @source $URL$ 
 */ 
public class ColorReductionCRIF extends CRIFImpl { 
 
	public RenderedImage create(ParameterBlock pb, RenderingHints hints) {
		final RenderedImage image = (RenderedImage) pb.getSource(0);
		final int numColors = pb.getIntParameter(0);
		final int alpaThreshold = pb.getIntParameter(1);
		final int subsx = pb.getIntParameter(2);
		final int subsy = pb.getIntParameter(3);
		return new ColorReduction(image, hints, numColors, alpaThreshold,
				subsx, subsy);
	} 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getObjectParameter, getRenderedSource
     * @param hints  May contain rendering hints and destination image layout. 
     */ 
    public RenderedImage create(ParameterBlock args,
                                RenderingHints hints) {
        // Get source and parameters. 
        RenderedImage source = args.getRenderedSource(0);
        LookupTableJAI colorMap =
            (LookupTableJAI)args.getObjectParameter(0);
        KernelJAI errorKernel = (KernelJAI)args.getObjectParameter(1);
 
        // Check colorMap compatibility. 
        if(colorMap.getNumBands() != 1 &&
           colorMap.getNumBands() != 3) {
            // 1 or 3 band colorMaps only. 
            return null; 
        } else if(colorMap.getDataType() != DataBuffer.TYPE_BYTE) {
            // byte colorMaps only 
            return null; 
        } 
 

7
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 ParameterBlock Methods: