Package java.awt.image

Examples of java.awt.image.PixelGrabber.grabPixels()


         */
        protected int[] getPixels(Image img, int x, int y, int w, int h) {
            int[] pixels = new int[w * h];
            PixelGrabber pg = new PixelGrabber(img, x, y, w, h, pixels, 0, w);
            try {
                pg.grabPixels();
            } catch (InterruptedException e) {
                Debug.error("ImageTranslator: interrupted waiting for pixels!");
                return new int[0];
            }

View Full Code Here


            InterruptedException {

        int[] pixels = new int[image_width * image_height];

        PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, image_width, image_height, pixels, 0, image_width);
        pixelgrabber.grabPixels();

        LinkRaster.write(lt,
                ln,
                image_width,
                image_height,
View Full Code Here

                             DataOutputStream dos) throws IOException,
            InterruptedException {
        int[] pixels = new int[image_width * image_height];

        PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, image_width, image_height, pixels, 0, image_width);
        pixelgrabber.grabPixels();

        LinkRaster.write(x1,
                y1,
                image_width,
                image_height,
View Full Code Here

                             LinkProperties properties, DataOutputStream dos)
            throws IOException, InterruptedException {
        int[] pixels = new int[image_width * image_height];

        PixelGrabber pixelgrabber = new PixelGrabber(image, 0, 0, image_width, image_height, pixels, 0, image_width);
        pixelgrabber.grabPixels();

        LinkRaster.write(lt,
                ln,
                offset_x1,
                offset_y1,
View Full Code Here

        int h = image.getHeight(null);       
        int pix[] = new int[w * h];
        PixelGrabber grabber = new PixelGrabber(image, 0, 0, w, h, pix, 0, w);
       
        try {
            if (grabber.grabPixels() != true) {
                throw new IOException("Grabber returned false: " +
                                      grabber.status());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
View Full Code Here

    int h = image.getHeight(null);       
    int pix[] = new int[w * h];
    PixelGrabber grabber = new PixelGrabber(image, 0, 0, w, h, pix, 0, w);
   
    try {
      if (grabber.grabPixels() != true) {
        throw new IOException("Grabber returned false: " +
        grabber.status());
      }
    } catch (InterruptedException e) {
      e.printStackTrace();
View Full Code Here

            default:
                pg = new PixelGrabber(image, 0, image.getHeight(null) - 1, 1, 1, pixels, 0, 1);
        }

        try {
            if ((pg != null) && pg.grabPixels()) {
                setBackground(new Color(pixels[0]));
            }
        } catch (InterruptedException e) {
        }
    }
View Full Code Here

                int[] pixels = new int[width * nRows];

                pg = new PixelGrabber(image, 0, startRow,
                    width, nRows, pixels, 0, width);
                try {
                    pg.grabPixels();
                }
                catch (Exception e) {
                    System.err.println("interrupted waiting for pixels!");
                    return false;
                }
View Full Code Here

    LMSFitnessFunction(BufferedImage target) {
        targetPixels = new int[target.getWidth() * target.getHeight()];
        PixelGrabber pg = new PixelGrabber(target, 0, 0, target.getWidth(),
                target.getHeight(), targetPixels, 0, target.getWidth());
        try {
            pg.grabPixels();
        } catch (InterruptedException ex) {
            Logger.getLogger(LMSFitnessFunction.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

View Full Code Here

                BufferedImage.TYPE_INT_ARGB);
        final int[] generatedPixels = new int[generated.getWidth() * generated.getHeight()];
        PixelGrabber pg = new PixelGrabber(generated, 0, 0, generated.getWidth(),
                generated.getHeight(), generatedPixels, 0, generated.getWidth());
        try {
            pg.grabPixels();
        } catch (InterruptedException ex) {
            Logger.getLogger(LMSFitnessFunction.class.getName()).log(Level.SEVERE, null, ex);
        }

        long sum = 0;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.