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


Java GraphicsUtil.getDestinationColorSpace方法代码示例

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


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

示例1: paintRable

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
/**
 * Should perform the equivilent action as
 * createRendering followed by drawing the RenderedImage to
 * Graphics2D, or return false.
 *
 * @param g2d The Graphics2D to draw to.
 * @return true if the paint call succeeded, false if
 *         for some reason the paint failed (in which
 *         case a createRendering should be used).
 */
public boolean paintRable(Graphics2D g2d) {
    // This optimization only apply if we are using
    // SrcOver.  Otherwise things break...
    Composite c = g2d.getComposite();
    if (!SVGComposite.OVER.equals(c))
        return false;

    // For the over mode we can just draw them in order...
    if (getCompositeRule() != CompositeRule.OVER)
        return false;

    ColorSpace crCS = getOperationColorSpace();
    ColorSpace g2dCS = GraphicsUtil.getDestinationColorSpace(g2d);
    if ((g2dCS == null) || (g2dCS != crCS)) {
        return false;
    }

    // System.out.println("drawImage : " + g2dCS +
    //                    crCS);
    Iterator i = getSources().iterator();
    while (i.hasNext()) {
        GraphicsUtil.drawImage(g2d, (Filter)i.next());
    }
    return true;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:36,代码来源:CompositeRable8Bit.java

示例2: paintRable

import org.apache.batik.ext.awt.image.GraphicsUtil; //导入方法依赖的package包/类
/**
 * Should perform the equivilent action as 
 * createRendering followed by drawing the RenderedImage to 
 * Graphics2D, or return false.
 *
 * @param g2d The Graphics2D to draw to.
 * @return true if the paint call succeeded, false if
 *         for some reason the paint failed (in which 
 *         case a createRendering should be used).
 */
public boolean paintRable(Graphics2D g2d) {
    // This optimization only apply if we are using
    // SrcOver.  Otherwise things break...
    Composite c = g2d.getComposite();
    if (!SVGComposite.OVER.equals(c))
        return false;
    
    ColorSpace g2dCS = GraphicsUtil.getDestinationColorSpace(g2d);
    if ((g2dCS == null) ||
        (g2dCS != ColorSpace.getInstance(ColorSpace.CS_sRGB))){
        // Only draw directly into sRGB destinations...
        return false;
    }

    // System.out.println("drawImage GNR: " + g2dCS);
    GraphicsNode gn = getGraphicsNode();
    if (getUsePrimitivePaint()){
        gn.primitivePaint(g2d);
    }
    else{
        gn.paint(g2d);
    }

    // Paint did the work...
    return true;
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:37,代码来源:GraphicsNodeRable8Bit.java


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