Java Code Examples for sun.awt.image.IntegerComponentRaster#markDirty()
The following examples show how to use
sun.awt.image.IntegerComponentRaster#markDirty() .
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: ColorPaintContext.java From jdk1.8-source-analysis with Apache License 2.0 | 6 votes |
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; }
Example 2
Source File: GradientPaintContext.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example 3
Source File: ColorPaintContext.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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; }
Example 4
Source File: GradientPaintContext.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example 5
Source File: ColorPaintContext.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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; }
Example 6
Source File: GradientPaintContext.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example 7
Source File: ColorPaintContext.java From JDKSourceCode1.8 with MIT License | 6 votes |
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; }
Example 8
Source File: ColorPaintContext.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
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; }
Example 9
Source File: ColorPaintContext.java From Java8CN with Apache License 2.0 | 6 votes |
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; }
Example 10
Source File: GradientPaintContext.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example 11
Source File: GradientPaintContext.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example 12
Source File: GradientPaintContext.java From Java8CN with Apache License 2.0 | 6 votes |
/** * 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; }
Example 13
Source File: GradientPaintContext.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example 14
Source File: CustomComponent.java From Bytecoder with Apache License 2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int[] span = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }
Example 15
Source File: CustomComponent.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int span[] = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }
Example 16
Source File: CustomComponent.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int span[] = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }
Example 17
Source File: CustomComponent.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int span[] = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }
Example 18
Source File: CustomComponent.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int span[] = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }
Example 19
Source File: CustomComponent.java From hottub with GNU General Public License v2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int span[] = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }
Example 20
Source File: CustomComponent.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 4 votes |
public void Blit(SurfaceData src, SurfaceData dst, Composite comp, Region clip, int srcx, int srcy, int dstx, int dsty, int w, int h) { Raster srcRast = src.getRaster(srcx, srcy, w, h); ColorModel srcCM = src.getColorModel(); Raster dstRast = dst.getRaster(dstx, dsty, w, h); IntegerComponentRaster icr = (IntegerComponentRaster) dstRast; int[] dstPix = icr.getDataStorage(); Region roi = CustomComponent.getRegionOfInterest(src, dst, clip, srcx, srcy, dstx, dsty, w, h); SpanIterator si = roi.getSpanIterator(); Object srcPix = null; int dstScan = icr.getScanlineStride(); // assert(icr.getPixelStride() == 1); srcx -= dstx; srcy -= dsty; int span[] = new int[4]; while (si.nextSpan(span)) { int rowoff = icr.getDataOffset(0) + span[1] * dstScan + span[0]; for (int y = span[1]; y < span[3]; y++) { int off = rowoff; for (int x = span[0]; x < span[2]; x++) { srcPix = srcRast.getDataElements(x+srcx, y+srcy, srcPix); dstPix[off++] = srcCM.getRGB(srcPix); } rowoff += dstScan; } } // Pixels in the dest were modified directly, we must // manually notify the raster that it was modified icr.markDirty(); // REMIND: We need to do something to make sure that dstRast // is put back to the destination (as in the native Release // function) // src.releaseRaster(srcRast); // NOP? // dst.releaseRaster(dstRast); }