use of sun.awt.image.ByteInterleavedRaster in project jdk8u_jdk by JetBrains.
the class TexturePaintContext method getContext.
public static PaintContext getContext(BufferedImage bufImg, AffineTransform xform, RenderingHints hints, Rectangle devBounds) {
WritableRaster raster = bufImg.getRaster();
ColorModel cm = bufImg.getColorModel();
int maxw = devBounds.width;
Object val = hints.get(RenderingHints.KEY_INTERPOLATION);
boolean filter = (val == null ? (hints.get(RenderingHints.KEY_RENDERING) == RenderingHints.VALUE_RENDER_QUALITY) : (val != RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));
if (raster instanceof IntegerInterleavedRaster && (!filter || isFilterableDCM(cm))) {
IntegerInterleavedRaster iir = (IntegerInterleavedRaster) raster;
if (iir.getNumDataElements() == 1 && iir.getPixelStride() == 1) {
return new Int(iir, cm, xform, maxw, filter);
}
} else if (raster instanceof ByteInterleavedRaster) {
ByteInterleavedRaster bir = (ByteInterleavedRaster) raster;
if (bir.getNumDataElements() == 1 && bir.getPixelStride() == 1) {
if (filter) {
if (isFilterableICM(cm)) {
return new ByteFilter(bir, cm, xform, maxw);
}
} else {
return new Byte(bir, cm, xform, maxw);
}
}
}
return new Any(raster, cm, xform, maxw, filter);
}
Aggregations