if (waterShed[i] != 0) {
waterShed[i] = (short) 0xff;
}
}
// make distancemap
EDM edm = new EDM();
edm.run(waterShed, width, height);
for (int i = 0; i < waterShed.length; i++) {
waterShed[i] = (short) (waterShed[i] >> 2);
}
// invert map
for (int i = 0; i < waterShed.length; i++) {