本文整理汇总了Java中sun.java2d.SurfaceData.pixelFor方法的典型用法代码示例。如果您正苦于以下问题:Java SurfaceData.pixelFor方法的具体用法?Java SurfaceData.pixelFor怎么用?Java SurfaceData.pixelFor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.java2d.SurfaceData
的用法示例。
在下文中一共展示了SurfaceData.pixelFor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MaskFill
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
public void MaskFill(SunGraphics2D sg2d,
SurfaceData sData,
Composite comp,
int x, int y, int w, int h,
byte mask[], int offset, int scan)
{
BufferedImage dstBI =
new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
SurfaceData tmpData = BufImgSurfaceData.createData(dstBI);
// REMIND: This is not pretty. It would be nicer if we
// passed a "FillData" object to the Pixel loops, instead
// of a SunGraphics2D parameter...
Region clip = sg2d.clipRegion;
sg2d.clipRegion = null;
int pixel = sg2d.pixel;
sg2d.pixel = tmpData.pixelFor(sg2d.getColor());
fillop.FillRect(sg2d, tmpData, 0, 0, w, h);
sg2d.pixel = pixel;
sg2d.clipRegion = clip;
maskop.MaskBlit(tmpData, sData, comp, null,
0, 0, x, y, w, h,
mask, offset, scan);
}
示例2: BlitBg
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
@Override
public void BlitBg(SurfaceData src, SurfaceData dst,
Composite comp, Region clip, int bgColor,
int sx, int sy,
int dx, int dy,
int w, int h)
{
SunToolkit.awtLock();
try {
int pixel = dst.pixelFor(bgColor);
X11SurfaceData x11sd = (X11SurfaceData)dst;
// use false for needExposures since we clip to the pixmap
long xgc = x11sd.getBlitGC(clip, false);
nativeBlitBg(src.getNativeOps(), dst.getNativeOps(),
xgc, pixel,
sx, sy, dx, dy, w, h);
} finally {
SunToolkit.awtUnlock();
}
}
示例3: XORComposite
import sun.java2d.SurfaceData; //导入方法依赖的package包/类
public XORComposite(Color xorColor, SurfaceData sd) {
this.xorColor = xorColor;
SurfaceType sType = sd.getSurfaceType();
this.xorPixel = sd.pixelFor(xorColor.getRGB());
this.alphaMask = sType.getAlphaMask();
}