Package java.awt.image.renderable

Examples of java.awt.image.renderable.ParameterBlock


            RenderedImage xformedImage = image;
            if (!xform.isIdentity()) {
                RenderingHints extenderHints = new RenderingHints(JAI.KEY_BORDER_EXTENDER,
                                                                  BorderExtender.createInstance(BorderExtender.BORDER_COPY));
                ParameterBlock params = new ParameterBlock();
                params.addSource(image);
                params.add(xform);
                params.add(Interpolation.getInstance(Interpolation.INTERP_BILINEAR));
                xformedImage = JAI.create("Affine", params, extenderHints);
            }

            g.drawRenderedImage(xformedImage, identity);
View Full Code Here


                { tred, tgreen, tblue, 0 },
                { tred, tgreen, tblue, 0 },
                { tred, tgreen, tblue, 0 }
            };

            ParameterBlock pb = new ParameterBlock();
            pb.addSource(back);
            pb.add(transform);
            return JAI.create("BandCombine", pb, null);
        }
View Full Code Here

                { tred, tgreen, tblue, 0 },
                { tred, tgreen, tblue, 0 },
                { tred, tgreen, tblue, 0 }
            };

            ParameterBlock pb = new ParameterBlock();
            pb.addSource(Functions.toColorSpace(back, JAIContext.oldLinearColorSpace, null));
            pb.add(transform);
            return JAI.create("BandCombine", pb, null);
        }
View Full Code Here

            for (int i = 0; i < 0x10000; i++)
                table[2][i] = (short) (0xffff & (int) Math.min(Math.max(i + 10 * 0xff * interpolator.interpolate(i / (double) 0xffff, blueCurve), 0), 0xffff));

            LookupTableJAI lookupTable = new LookupTableJAI(table, true);

            ParameterBlock pb = new ParameterBlock();
            pb.addSource(back);
            pb.add(lookupTable);
            return JAI.create("lookup", pb, null);
        }
View Full Code Here

                { red, green, blue, 0 },
                { red, green, blue, 0 },
                { red, green, blue, 0 }
            };

            ParameterBlock pb = new ParameterBlock();
            pb.addSource(back);
            pb.add(transform);
            return JAI.create("BandCombine", pb, JAIContext.noCacheHint)// Desaturate, single banded
        }
View Full Code Here

            super(source);
        }
        public PlanarImage setFront() {
            kernel = Functions.LoGSharpenKernel(radius, gain);
            // kernel = Functions.getLoGKernel(radius);
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(back);
            pb.add(kernel);
            RenderingHints hints = new RenderingHints(JAI.KEY_BORDER_EXTENDER, BorderExtender.createInstance(BorderExtender.BORDER_COPY));
            hints.add(JAIContext.noCacheHint);
            return JAI.create("convolve", pb, hints);
        }
View Full Code Here

        return invTable;
    }

    static class GammaUSMProcessor implements ImageProcessor {
        public RenderedOp process(RenderedImage source) {
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(source);
            pb.add(invertTable());
            return JAI.create("lookup", pb, null);
        }
View Full Code Here

    static class LuminanceUSMProcessor implements ImageProcessor {
        public RenderedOp process(RenderedImage source) {
            double[][] yChannel = new double[][]{{ColorScience.Wr, ColorScience.Wg, ColorScience.Wb, 0}};

            ParameterBlock pb = new ParameterBlock();
            pb.addSource( source );
            pb.add( yChannel );
            RenderedOp y = JAI.create("BandCombine", pb, null);

            pb = new ParameterBlock();
            pb.addSource(y);
            pb.add(invertTable());
            return JAI.create("lookup", pb, null);
        }
View Full Code Here

        }

        public PlanarImage setFrontPlain() {
            RenderingHints extenderHints = new RenderingHints(JAI.KEY_BORDER_EXTENDER,
                                                              BorderExtender.createInstance(BorderExtender.BORDER_COPY));
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(back);
            pb.addSource(Functions.gaussianBlur(back, rendering, op, radius * scale));
            pb.add(amount/100.0);
            pb.add((int) threshold);
            return JAI.create("LCUnSharpMask", pb, extenderHints);
        }
View Full Code Here

            double blurRadius = radius * scale;
            RenderedOp blur = Functions.gaussianBlur(back, rendering, op, GammaUSMProcessorInstance, blurRadius);

            RenderingHints extenderHints = new RenderingHints(JAI.KEY_BORDER_EXTENDER,
                                                              BorderExtender.createInstance(BorderExtender.BORDER_COPY));
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(GammaUSMProcessorInstance.process(back));
            pb.addSource(blur);
            pb.add(amount/100.0);
            pb.add((int) threshold);
            RenderedOp usm = JAI.create("LCUnSharpMask", pb, extenderHints);
            usm.setProperty(JAIContext.PERSISTENT_CACHE_TAG, Boolean.TRUE);

            pb = new ParameterBlock();
            pb.addSource(usm);
            pb.add(getTable());
            return JAI.create("lookup", pb, JAIContext.noCacheHint);
        }
View Full Code Here

TOP

Related Classes of java.awt.image.renderable.ParameterBlock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.