Java ByteBuffer Size xysizeIsWhite(BufferedImage img, int x, int y)

Here you can find the source of xysizeIsWhite(BufferedImage img, int x, int y)

Description

xysize Is White

License

Open Source License

Declaration

public static boolean xysizeIsWhite(BufferedImage img, int x, int y) 

Method Source Code

//package com.java2s;
import java.awt.Color;
import java.awt.image.BufferedImage;

public class Main {
    public static boolean xysizeIsWhite(BufferedImage img, int x, int y) {
        try {//from  ww w  .ja  va2s. com
            int tab = 10;
            for (int i = x; i < x + tab; i++) {
                for (int j = y; j < y + tab; j++) {
                    int col = img.getRGB(i, j);
                    Color color = new Color(col);
                    if (color.getRed() + color.getGreen() + color.getBlue() < 500) {
                        return false;
                    }
                }
            }
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}

Related

  1. sizeOfBytesMap(Map m)
  2. sizeOfValue(ByteBuffer bytes)
  3. sizeP(ByteBuffer bb)
  4. storeInt(ByteBuffer b, int fromIndex, int size, int value)
  5. tileImage(Graphics g, BufferedImage tileImage, int width, int height)