Package java.awt.image

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


    }
    int[] pixels = new int[width * height];
    PixelGrabber pg = new PixelGrabber(image, 0, 0, width, height, pixels, 0, width);
    try
    {
      pg.grabPixels();
    }
    catch (InterruptedException e)
    {
      return null;
    }
View Full Code Here


    } else {
      grabber = new PixelGrabber(image, 0, 0, width_, height_, values, 0, width_);
    }

    try {
      if (grabber.grabPixels() != true)
        throw new AWTException(Strings.get("grabberError") + ": "
          + grabber.status());
    } catch (InterruptedException e) {
      ;
    }
View Full Code Here

            previousPixels = new int[w * h];
        }
        PixelGrabber latestPixelGrabber = new PixelGrabber(latest, 0, 0, w, h, latestPixels, 0, w);

        try {
            latestPixelGrabber.grabPixels();
        } catch (InterruptedException e) {
            System.out.println("interrupted waiting for pixels");
        }

        if ((latestPixelGrabber.getStatus() & ImageObserver.ABORT) != 0) {
View Full Code Here

        public ImageInfo(Image img) throws InterruptedException {
            w = img.getWidth(null);
            h = img.getHeight(null);
            pixels = new int[w*h];
            PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pixels, 0, w);
            pg.grabPixels();
        }
       
        public boolean equals(Object that) {
            if(that == null) {
                return false;
View Full Code Here

        public ImageInfo(Image img) throws InterruptedException {
            w = img.getWidth(null);
            h = img.getHeight(null);
            pixels = new int[w*h];
            PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pixels, 0, w);
            pg.grabPixels();
        }
       
        public boolean equals(Object that) {
            if(that == null) {
                return false;
View Full Code Here

     int x = 0;
     int y = 0;
         m_aPixels = new int[m_w * m_h];
         PixelGrabber pg = new PixelGrabber(m_aImage, x, y, m_w, m_h, m_aPixels, 0, m_w);
         try {
             pg.grabPixels();
         } catch (InterruptedException e) {
             System.err.println("interrupted waiting for pixels!");
             return;
         }
         if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
View Full Code Here

    {
        try
        {
            PixelGrabber pg = new PixelGrabber(bufferedImage, 0, 0, bufferedImage.getWidth(), bufferedImage.getHeight(), true);

            pg.grabPixels();

            int[] gra = (int[]) pg.getPixels();

            LUV[] result = new LUV[bufferedImage.getHeight() * bufferedImage.getWidth()];

 
View Full Code Here

            //BufferedImage result = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);

            PixelGrabber pg = new PixelGrabber(src, 0, 0, width, height, true);

            pg.grabPixels();

            int[] srcpixels = (int[]) pg.getPixels();

            int[] resPixels = new int[srcpixels.length];
View Full Code Here

  public ImageColorDialog(Image image) {
    this.image = image;
    PixelGrabber pg = new PixelGrabber(image, 0, 0, -1, -1, true);

    try {
      pg.grabPixels();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }

    pixels = (int[]) pg.getPixels();
View Full Code Here

     * Returns a vector of the data in the given image.
     */
    private static GVector getData(Image image, int x, int y, int width, int height) {
        int[] pixels = new int[width * height];
        PixelGrabber pg = new PixelGrabber(image, x, y, width, height, pixels, 0, width);
        try { pg.grabPixels(); }
        catch(InterruptedException e) { throw new RuntimeException(e); }
       
        GVector data = new GVector(3 * pixels.length);
        for(int i = 0; i < pixels.length; i++) {
            int red   = (pixels[i] >> 16) & 0xff;
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.