Package javax.media.jai

Examples of javax.media.jai.PlanarImage


                                             Integer.parseInt(params[1][i]),
                                             params[0][i])}},
                                     true);
            RenderedOp image = JAI.create("ImageRead", ImageIO.createImageInputStream(stream));
            // Create the parameter block.
            PlanarImage dst = null;
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(image);               // Specify the source image
            pb.add(null);                      // No ROI
            pb.add(1);                         // Sampling
            pb.add(1);                         // periods
            // Perform the histogram operation.
            dst = JAI.create("histogram", pb, null);
           
            // Retrieve the histogram data.
            Histogram hist = (Histogram) dst.getProperty("histogram");
            histogram[i] = hist;
        }
        for (int i = 0; i < 256; i++) {
            assertEquals(histogram[0].getBinSize(0, i),
                         histogram[1].getBinSize(0, i) +
View Full Code Here


                                             Integer.parseInt(params[1][i]),
                                             params[0][i])}},
                                     true);
            RenderedOp image = JAI.create("ImageRead", ImageIO.createImageInputStream(stream));
            // Create the parameter block.
            PlanarImage dst = null;
            ParameterBlock pb = new ParameterBlock();
            pb.addSource(image);               // Specify the source image
            pb.add(null);                      // No ROI
            pb.add(1);                         // Sampling
            pb.add(1);                         // periods
            // Perform the histogram operation.
            dst = JAI.create("histogram", pb, null);
           
            // Retrieve the histogram data.
            Histogram hist = (Histogram) dst.getProperty("histogram");
            histogram[i] = hist;
        }
        for (int i = 0; i < 256; i++) {
            assertEquals(histogram[0].getBinSize(0, i),
                         histogram[1].getBinSize(0, i) +
View Full Code Here

        final int size = instructions.size();
        for (int i = 0; i < size; i++) {
            ImageOperation instr = ((ImageOperation) instructions.elementAt(i));
            if (instr instanceof DrawOperation) {
                PlanarImage img = ((DrawOperation) instr).executeDrawOperation();
                graphics.drawImage(img.getAsBufferedImage(), null, 0, 0);
            } else if (instr instanceof TransformOperation) {
                graphics = (Graphics2D) bi.getGraphics();
                PlanarImage image = ((TransformOperation) instr)
                    .executeTransformOperation(PlanarImage.wrapRenderedImage(bi));
                bi = image.getAsBufferedImage();
            }
        }
        return PlanarImage.wrapRenderedImage(bi);
    }
View Full Code Here

            ImageOperation instr = ((ImageOperation) instructions.elementAt(i));
            if (instr instanceof DrawOperation) {
                // If this TransformOperation has DrawOperation children
                // then Rotate the first child and return.
                System.out.println("Execing Draws");
                PlanarImage op = ((DrawOperation) instr).executeDrawOperation();
                image = performRotate(op);
                return image;
            } else if (instr instanceof TransformOperation) {
                bi = image.getAsBufferedImage();
                System.out.println("Execing Transforms");
View Full Code Here

        for (int i = 0; i < size; i++) {
            ImageOperation instr = ((ImageOperation) instructions.elementAt(i));
            if (instr instanceof DrawOperation) {
                // If this TransformOperation has DrawOperation children
                // then Rotate the first child and return.
                PlanarImage op = ((DrawOperation) instr).executeDrawOperation();
                op = performRotate(op);
                return op;
            }
        }
        return null;
View Full Code Here

    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                final int size = instructions.size();
                for (int i = 0; i < size; i++) {
View Full Code Here


        for (int i = 0; i < instructions.size(); i++) {
            ImageOperation instr = ((ImageOperation) instructions.elementAt(i));
            if (instr instanceof DrawOperation) {
                PlanarImage img = ((DrawOperation) instr).executeDrawOperation();
                graphics.drawImage(img.getAsBufferedImage(), null, 0, 0);
            } else if (instr instanceof TransformOperation) {
                graphics = (Graphics2D) bi.getGraphics();
                PlanarImage image = ((TransformOperation) instr)
                    .executeTransformOperation(PlanarImage.wrapRenderedImage(bi));
                bi = image.getAsBufferedImage();
            }
        }
        return PlanarImage.wrapRenderedImage(bi);
    }
View Full Code Here

    public void processFile(File file, File newFile) {
        try {
            log("Processing File: " + file.getAbsolutePath());

            FileSeekableStream input = null;
            PlanarImage image = null;
            try {
                input = new FileSeekableStream(file);
                image = JAI.create("stream", input);
                for (int i = 0; i < instructions.size(); i++) {
                    Object instr = instructions.elementAt(i);
View Full Code Here

        // Create a hint containing the layout.
        RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

        // Dither the image.
        PlanarImage dst = JAI.create(opName, pb, hints);       
       
        //Convert it to a BufferedImage
        return dst.getAsBufferedImage();
    }
View Full Code Here

        // Create a hint containing the layout.
        RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);

        // Dither the image.
        PlanarImage dst = JAI.create(opName, pb, hints);       
       
        //Convert it to a BufferedImage
        return dst.getAsBufferedImage();
    }
View Full Code Here

TOP

Related Classes of javax.media.jai.PlanarImage

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.