sun.awt.image.IntegerInterleavedRaster Java Examples

The following examples show how to use sun.awt.image.IntegerInterleavedRaster. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TexturePaintContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #2
Source File: TexturePaintContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #3
Source File: TexturePaintContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #4
Source File: TexturePaintContext.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #5
Source File: TexturePaintContext.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
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(hints.KEY_INTERPOLATION);
    boolean filter =
        (val == null
         ? (hints.get(hints.KEY_RENDERING) == hints.VALUE_RENDER_QUALITY)
         : (val != hints.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);
}
 
Example #6
Source File: TexturePaintContext.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #7
Source File: TexturePaintContext.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #8
Source File: TexturePaintContext.java    From jdk-1.7-annotated with Apache License 2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #9
Source File: TexturePaintContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #10
Source File: TexturePaintContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #11
Source File: TexturePaintContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #12
Source File: TexturePaintContext.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #13
Source File: TexturePaintContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #14
Source File: TexturePaintContext.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #15
Source File: TexturePaintContext.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #16
Source File: TexturePaintContext.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #17
Source File: TexturePaintContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #18
Source File: TexturePaintContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #19
Source File: TexturePaintContext.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #20
Source File: TexturePaintContext.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #21
Source File: TexturePaintContext.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #22
Source File: TexturePaintContext.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #23
Source File: TexturePaintContext.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
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);
}
 
Example #24
Source File: TexturePaintContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #25
Source File: TexturePaintContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #26
Source File: TexturePaintContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}
 
Example #27
Source File: TexturePaintContext.java    From Java8CN with Apache License 2.0 5 votes vote down vote up
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);
}
 
Example #28
Source File: TexturePaintContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    // Note that we do not pass srcRas to makeRaster since it
    // is a Byte Raster and this colorModel needs an Int Raster
    WritableRaster ras = makeRaster(colorModel, null, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #29
Source File: TexturePaintContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public WritableRaster makeRaster(int w, int h) {
    WritableRaster ras = makeRaster(colorModel, srcRas, w, h);
    IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster) ras;
    outData = iiRas.getDataStorage();
    outSpan = iiRas.getScanlineStride();
    outOff = iiRas.getDataOffset(0);
    return ras;
}
 
Example #30
Source File: TexturePaintContext.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Int(IntegerInterleavedRaster srcRas, ColorModel cm,
           AffineTransform xform, int maxw, boolean filter)
{
    super(cm, xform, srcRas.getWidth(), srcRas.getHeight(), maxw);
    this.srcRas = srcRas;
    this.inData = srcRas.getDataStorage();
    this.inSpan = srcRas.getScanlineStride();
    this.inOff = srcRas.getDataOffset(0);
    this.filter = filter;
}