@Override public synchronized float[] getValues(BufferedImage img, int x, int y, int w, int h, float[] array) { ensureStainsUpdated(); if (stains == null) { if (array == null) return new float[w * h]; return array; } int[] buffer = RGBDirectChannelInfo.getRGBIntBuffer(img); if (buffer == null) buffer = img.getRGB(x, y, w, h, null, 0, w); if (method == null) return ColorDeconvolution.colorDeconvolveRGBArray(buffer, stains, stainNumber-1, array); else return ColorTransformer.getTransformedPixels(buffer, method, array, stains); }