static HashedBWImage toHashedBWImage(BWImage img) { if (img == null) null; if (img cast HashedBWImage) ret img; ret new HashedBWImage(img); }