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


Java SpanIterator.nextSpan方法代码示例

本文整理汇总了Java中sun.java2d.pipe.SpanIterator.nextSpan方法的典型用法代码示例。如果您正苦于以下问题:Java SpanIterator.nextSpan方法的具体用法?Java SpanIterator.nextSpan怎么用?Java SpanIterator.nextSpan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.java2d.pipe.SpanIterator的用法示例。


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

示例1: Blit

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
public void Blit(SurfaceData srcData,
                 SurfaceData dstData,
                 Composite comp,
                 Region clip,
                 int srcx, int srcy,
                 int dstx, int dsty,
                 int width, int height)
{
    ColorModel srcCM = srcData.getColorModel();
    ColorModel dstCM = dstData.getColorModel();
    // REMIND: Should get RenderingHints from sg2d
    CompositeContext ctx = comp.createContext(srcCM, dstCM,
                                              new RenderingHints(null));
    Raster srcRas = srcData.getRaster(srcx, srcy, width, height);
    WritableRaster dstRas =
        (WritableRaster) dstData.getRaster(dstx, dsty, width, height);

    if (clip == null) {
        clip = Region.getInstanceXYWH(dstx, dsty, width, height);
    }
    int span[] = {dstx, dsty, dstx+width, dsty+height};
    SpanIterator si = clip.getSpanIterator(span);
    srcx -= dstx;
    srcy -= dsty;
    while (si.nextSpan(span)) {
        int w = span[2] - span[0];
        int h = span[3] - span[1];
        Raster tmpSrcRas = srcRas.createChild(srcx + span[0], srcy + span[1],
                                              w, h, 0, 0, null);
        WritableRaster tmpDstRas = dstRas.createWritableChild(span[0], span[1],
                                                              w, h, 0, 0, null);
        ctx.compose(tmpSrcRas, tmpDstRas, tmpDstRas);
    }
    ctx.dispose();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:36,代码来源:Blit.java

示例2: doFillSpans

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
public void doFillSpans(SunGraphics2D sg2d, SpanIterator si) {
    int box[] = new int[4];
    GDIWindowSurfaceData sd;
    try {
        sd = (GDIWindowSurfaceData)sg2d.surfaceData;
    } catch (ClassCastException e) {
        throw new InvalidPipeException("wrong surface data type: " + sg2d.surfaceData);
    }
    Region clip = sg2d.getCompClip();
    Composite comp = sg2d.composite;
    int eargb = sg2d.eargb;
    while (si.nextSpan(box)) {
        doFillRect(sd, clip, comp, eargb,
                   box[0], box[1], box[2]-box[0], box[3]-box[1]);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:GDIRenderer.java

示例3: fillSpans

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
protected void fillSpans(SunGraphics2D sg2d, SpanIterator si,
                         int transx, int transy) {
    SunToolkit.awtLock();
    try {
        validateSurface(sg2d);
        int[] spanBox = new int[4];
        while (si.nextSpan(spanBox)) {
            rectBuffer.pushRectValues(spanBox[0] + transx,
                                spanBox[1] + transy,
                                spanBox[2] - spanBox[0],
                                spanBox[3] - spanBox[1]);
        }
        tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XRRenderer.java

示例4: fillSpans

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
protected void fillSpans(SunGraphics2D sg2d, SpanIterator si,
                         int transx, int transy) {
    SunToolkit.awtLock();
    try {
        validateSurface(sg2d);
        int[] spanBox = new int[4];
        while (si.nextSpan(spanBox)) {
            tileManager.addRect(spanBox[0] + transx,
                                spanBox[1] + transy,
                                spanBox[2] - spanBox[0],
                                spanBox[3] - spanBox[1]);
        }
        tileManager.fillMask(((XRSurfaceData) sg2d.surfaceData));
    } finally {
        SunToolkit.awtUnlock();
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:18,代码来源:XRRenderer.java

示例5: FillSpans

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
public void FillSpans(SunGraphics2D sg2d, SurfaceData sData,
                      SpanIterator si)
{
    PixelWriter pw = GeneralRenderer.createSolidPixelWriter(sg2d, sData);

    int span[] = new int[4];
    while (si.nextSpan(span)) {
        GeneralRenderer.doSetRect(sData, pw,
                                  span[0], span[1], span[2], span[3]);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:GeneralRenderer.java

示例6: FillSpans

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
public void FillSpans(SunGraphics2D sg2d, SurfaceData sData,
                      SpanIterator si)
{
    PixelWriter pw = GeneralRenderer.createXorPixelWriter(sg2d, sData);

    int span[] = new int[4];
    while (si.nextSpan(span)) {
        GeneralRenderer.doSetRect(sData, pw,
                                  span[0], span[1], span[2], span[3]);
    }
}
 
开发者ID:greghaskins,项目名称:openjdk-jdk7u-jdk,代码行数:12,代码来源:GeneralRenderer.java

示例7: doFillSpans

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
public void doFillSpans(SunGraphics2D sg2d, SpanIterator si) {
    int box[] = new int[4];
    SurfaceData sd = sg2d.surfaceData;
    Region clip = sg2d.getCompClip();
    Composite comp = sg2d.composite;
    int eargb = sg2d.eargb;
    while (si.nextSpan(box)) {
        doFillRect(sd, clip, comp, eargb,
                   box[0], box[1], box[2]-box[0], box[3]-box[1]);
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:12,代码来源:GDIRenderer.java

示例8: Blit

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
public void Blit(SurfaceData srcData,
                 SurfaceData dstData,
                 Composite comp,
                 Region clip,
                 int srcx, int srcy,
                 int dstx, int dsty,
                 int width, int height)
{
    ColorModel srcCM = srcData.getColorModel();
    ColorModel dstCM = dstData.getColorModel();
    // REMIND: Should get RenderingHints from sg2d
    CompositeContext ctx = comp.createContext(srcCM, dstCM,
                                              new RenderingHints(null));
    Raster srcRas = srcData.getRaster(srcx, srcy, width, height);
    WritableRaster dstRas =
        (WritableRaster) dstData.getRaster(dstx, dsty, width, height);

    if (clip == null) {
        clip = Region.getInstanceXYWH(dstx, dsty, width, height);
    }
    int span[] = {dstx, dsty, dstx+width, dsty+height};
    SpanIterator si = clip.getSpanIterator(span);
    srcx -= dstx;
    srcy -= dsty;
    while (si.nextSpan(span)) {
        int w = span[2] - span[0];
        int h = span[3] - span[1];
        srcRas = srcRas.createChild(srcx + span[0], srcy + span[1],
                                    w, h, 0, 0, null);
        dstRas = dstRas.createWritableChild(span[0], span[1],
                                            w, h, 0, 0, null);
        ctx.compose(srcRas, dstRas, dstRas);
    }
    ctx.dispose();
}
 
开发者ID:aducode,项目名称:openjdk-source-code-learn,代码行数:36,代码来源:Blit.java

示例9: Blit

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:44,代码来源:CustomComponent.java

示例10: Blit

import sun.java2d.pipe.SpanIterator; //导入方法依赖的package包/类
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);
    IntegerComponentRaster icr = (IntegerComponentRaster) srcRast;
    int[] srcPix = icr.getDataStorage();

    WritableRaster dstRast =
        (WritableRaster) dst.getRaster(dstx, dsty, w, h);
    ColorModel dstCM = dst.getColorModel();

    Region roi = CustomComponent.getRegionOfInterest(src, dst, clip,
                                                     srcx, srcy,
                                                     dstx, dsty, w, h);
    SpanIterator si = roi.getSpanIterator();

    Object dstPix = null;

    int srcScan = icr.getScanlineStride();
    // assert(icr.getPixelStride() == 1);
    srcx -= dstx;
    srcy -= dsty;
    int span[] = new int[4];
    while (si.nextSpan(span)) {
        int rowoff = (icr.getDataOffset(0) +
                      (srcy + span[1]) * srcScan +
                      (srcx + span[0]));
        for (int y = span[1]; y < span[3]; y++) {
            int off = rowoff;
            for (int x = span[0]; x < span[2]; x++) {
                dstPix = dstCM.getDataElements(srcPix[off++], dstPix);
                dstRast.setDataElements(x, y, dstPix);
            }
            rowoff += srcScan;
        }
    }
    // 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);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:44,代码来源:CustomComponent.java


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