res[i] = (short) ((r << 10) | (g << 5) | b); if (a != 0) { res[i] |= 0x8000;
final int v = argb[imgOfs + x]; final int a = (v >>> 24) & 0xFF; final int r = ((v >> 16) & 0xFF); final int g = ((v >> 8) & 0xFF); final int b = (v & 0xFF);  if (a != 0) {  if (((r + g + b) / 3) >= 128) {   } else {   res[resRowIdx+8] |= resRowBit; } } else {   res[resRowIdx] |= resRowBit; }
    private short[] getCursor(HardwareCursor cursor) {		final HardwareCursorImage img = cursor.getImage(32, 32);		if (img == null) {			return null;		}		short[] res = (short[]) cursorCache.get(img);		if (res == null) {			res = new short[1024];			final int[] argb = img.getImage();			for (int i = 0; i < 1024; i++) {				final int v = argb[i];				final int a = (v >>> 24) & 0xFF;				final int r = ((v >> 16) & 0xFF) >> 3;				final int g = ((v >> 8) & 0xFF) >> 3;				final int b = (v & 0xFF) >> 3;				res[i] = (short) ((r << 10) | (g << 5) | b);				if (a != 0) {					res[i] |= 0x8000;				}			}			cursorCache.put(img, res);		}		return res;	}