@Override public int getBlue(Object inData) { return getRGB(inData) & 0xFF; }
public static ColorModel createYBRColorModel(int bits, int dataType, Attributes ds, YBR ybr, ColorSubsampling subsampling) { return new SampledComponentColorModel( new YBRColorSpace(createRGBColorSpace(ds), ybr), subsampling); }
@Override public int getRGB(Object inData) { byte[] ba = (byte[]) inData; ColorSpace cs = getColorSpace(); float[] fba = new float[] { (ba[0] & 0xFF) / 255f, (ba[1] & 0xFF) / 255f, (ba[2] & 0xFF) / 255f }; float[] rgb = cs.toRGB(fba); int ret = (((int) (rgb[0] * 255)) << 16) | (((int) (rgb[1] * 255)) << 8) | (((int) (rgb[2] * 255))); return ret; }
@Override public boolean isCompatibleRaster(Raster raster) { return isCompatibleSampleModel(raster.getSampleModel()); }
public static ColorModel createYBRColorModel(int bits, int dataType, Attributes ds, YBR ybr, ColorSubsampling subsampling) { return new SampledComponentColorModel( new YBRColorSpace(createRGBColorSpace(ds), ybr), subsampling); }
@Override public int getRGB(Object inData) { byte[] ba = (byte[]) inData; ColorSpace cs = getColorSpace(); float[] fba = new float[] { (ba[0] & 0xFF) / 255f, (ba[1] & 0xFF) / 255f, (ba[2] & 0xFF) / 255f }; float[] rgb = cs.toRGB(fba); int ret = (((int) (rgb[0] * 255)) << 16) | (((int) (rgb[1] * 255)) << 8) | (((int) (rgb[2] * 255))); return ret; }
@Override public boolean isCompatibleRaster(Raster raster) { return isCompatibleSampleModel(raster.getSampleModel()); }
@Override public int getGreen(Object inData) { return (getRGB(inData) >> 8) & 0xFF; }
@Override public int getRed(Object inData) { return getRGB(inData) >> 16; }
@Override public int getRed(Object inData) { return getRGB(inData) >> 16; }
@Override public int getBlue(Object inData) { return getRGB(inData) & 0xFF; }
@Override public int getGreen(Object inData) { return (getRGB(inData) >> 8) & 0xFF; }