当前位置: 首页>>代码示例>>Java>>正文


Java IntegerComponentRaster类代码示例

本文整理汇总了Java中sun.awt.image.IntegerComponentRaster的典型用法代码示例。如果您正苦于以下问题:Java IntegerComponentRaster类的具体用法?Java IntegerComponentRaster怎么用?Java IntegerComponentRaster使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IntegerComponentRaster类属于sun.awt.image包,在下文中一共展示了IntegerComponentRaster类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getRaster

import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:GradientPaintContext.java

示例2: getRaster

import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:ColorPaintContext.java

示例3: createNativeImage

import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
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());
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:WTrayIconPeer.java

示例4: getRaster

import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
/**
    * 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;
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:28,代码来源:GradientPaintContext.java

示例5: getRaster

import sun.awt.image.IntegerComponentRaster; //导入依赖的package包/类
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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:JBGradientPaint.java


注:本文中的sun.awt.image.IntegerComponentRaster类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。