Java 类sun.awt.image.IntegerComponentRaster 实例源码

项目:OpenJSharp    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:OpenJSharp    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:OpenJSharp    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:jdk8u-jdk    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:jdk8u-jdk    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:jdk8u-jdk    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:openjdk-jdk10    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:openjdk-jdk10    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:openjdk-jdk10    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:openjdk9    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:openjdk9    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:openjdk9    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:Java8CN    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:Java8CN    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:jdk8u_jdk    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:jdk8u_jdk    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:jdk8u_jdk    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:lookaside_java-1.8.0-openjdk    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:lookaside_java-1.8.0-openjdk    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:lookaside_java-1.8.0-openjdk    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:VarJ    文件:GradientPaintContext.java   
/**
    * Return a Raster containing the colors generated for the graphics
    * operation.
    * @param x,y,w,h The area in device space for which colors are
    * generated.
    */
   public Raster getRaster(int x, int y, int w, int h) {
double rowrel = (x - x1) * dx + (y - y1) * dy;

Raster rast = saved;
if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
    rast = getCachedRaster(model, w, h);
    saved = rast;
}
IntegerComponentRaster irast = (IntegerComponentRaster) rast;
int off = irast.getDataOffset(0);
int adjust = irast.getScanlineStride() - w;
int[] pixels = irast.getDataStorage();

if (cyclic) {
    cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
} else {
    clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
}

return rast;
   }
项目:jdk-1.7-annotated    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:jdk-1.7-annotated    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:infobip-open-jdk-8    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:infobip-open-jdk-8    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:infobip-open-jdk-8    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:jdk8u-dev-jdk    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:jdk8u-dev-jdk    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:jdk8u-dev-jdk    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:jdk7-jdk    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:jdk7-jdk    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:jdk7-jdk    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:openjdk-source-code-learn    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:openjdk-source-code-learn    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:openjdk-source-code-learn    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:OLD-OpenJDK8    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}
项目:OLD-OpenJDK8    文件:ColorPaintContext.java   
public synchronized Raster getRaster(int x, int y, int w, int h) {
    WritableRaster t = savedTile;

    if (t == null || w > t.getWidth() || h > t.getHeight()) {
        t = getColorModel().createCompatibleWritableRaster(w, h);
        IntegerComponentRaster icr = (IntegerComponentRaster) t;
        Arrays.fill(icr.getDataStorage(), color);
        // Note - markDirty is probably unnecessary since icr is brand new
        icr.markDirty();
        if (w <= 64 && h <= 64) {
            savedTile = t;
        }
    }

    return t;
}
项目:OLD-OpenJDK8    文件:WTrayIconPeer.java   
void createNativeImage(BufferedImage bimage) {
    Raster raster = bimage.getRaster();
    byte[] andMask = new byte[TRAY_ICON_MASK_SIZE];
    int  pixels[] = ((DataBufferInt)raster.getDataBuffer()).getData();
    int npixels = pixels.length;
    int ficW = raster.getWidth();

    for (int i = 0; i < npixels; i++) {
        int ibyte = i / 8;
        int omask = 1 << (7 - (i % 8));

        if ((pixels[i] & 0xff000000) == 0) {
            // Transparent bit
            if (ibyte < andMask.length) {
                andMask[ibyte] |= omask;
            }
        }
    }

    if (raster instanceof IntegerComponentRaster) {
        ficW = ((IntegerComponentRaster)raster).getScanlineStride();
    }
    setNativeIcon(((DataBufferInt)bimage.getRaster().getDataBuffer()).getData(),
                  andMask, ficW, raster.getWidth(), raster.getHeight());
}
项目:tools-idea    文件:JBGradientPaint.java   
public Raster getRaster(int x, int y, int w, int h) {
  double rowrel = (x - myX1) * myDx + (y - myY1) * myDy;

  Raster rast = saved;
  if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
    rast = getCachedRaster(model, w, h);
    saved = rast;
  }
  IntegerComponentRaster irast = (IntegerComponentRaster)rast;
  int off = irast.getDataOffset(0);
  int adjust = irast.getScanlineStride() - w;
  int[] pixels = irast.getDataStorage();

  clipFillRaster(pixels, off, adjust, w, h, rowrel, myDx, myDy);

  return rast;
}
项目:openjdk-jdk7u-jdk    文件:GradientPaintContext.java   
/**
 * Return a Raster containing the colors generated for the graphics
 * operation.
 * @param x,y,w,h The area in device space for which colors are
 * generated.
 */
public Raster getRaster(int x, int y, int w, int h) {
    double rowrel = (x - x1) * dx + (y - y1) * dy;

    Raster rast = saved;
    if (rast == null || rast.getWidth() < w || rast.getHeight() < h) {
        rast = getCachedRaster(model, w, h);
        saved = rast;
    }
    IntegerComponentRaster irast = (IntegerComponentRaster) rast;
    int off = irast.getDataOffset(0);
    int adjust = irast.getScanlineStride() - w;
    int[] pixels = irast.getDataStorage();

    if (cyclic) {
        cycleFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    } else {
        clipFillRaster(pixels, off, adjust, w, h, rowrel, dx, dy);
    }

    irast.markDirty();

    return rast;
}