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


Java GraphicsUtilities.getPixels方法代码示例

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


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

示例1: filter

import org.jdesktop.swingx.graphics.GraphicsUtilities; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
    if (dst == null) {
        dst = createCompatibleDestImage(src, null);
    }

    int width = src.getWidth();
    int height = src.getHeight();

    int[] pixels = new int[width * height];
    GraphicsUtilities.getPixels(src, 0, 0, width, height, pixels);
    mixColor(pixels);
    GraphicsUtilities.setPixels(dst, 0, 0, width, height, pixels);

    return dst;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:20,代码来源:ColorTintFilter.java

示例2: filter

import org.jdesktop.swingx.graphics.GraphicsUtilities; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
    int width = src.getWidth();
    int height = src.getHeight();

    if (dst == null) {
        dst = createCompatibleDestImage(src, null);
    }

    int[] srcPixels = new int[width * height];
    int[] dstPixels = new int[width * height];

    GraphicsUtilities.getPixels(src, 0, 0, width, height, srcPixels);
    // horizontal pass
    blur(srcPixels, dstPixels, width, height, radius);
    // vertical pass
    //noinspection SuspiciousNameCombination
    blur(dstPixels, srcPixels, height, width, radius);
    // the result is now stored in srcPixels due to the 2nd pass
    GraphicsUtilities.setPixels(dst, 0, 0, width, height, srcPixels);

    return dst;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:27,代码来源:FastBlurFilter.java

示例3: filter

import org.jdesktop.swingx.graphics.GraphicsUtilities; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
    int width = src.getWidth();
    int height = src.getHeight();

    if (dst == null) {
        dst = createCompatibleDestImage(src, null);
    }

    int[] srcPixels = new int[width * height];
    int[] dstPixels = new int[width * height];

    GraphicsUtilities.getPixels(src, 0, 0, width, height, srcPixels);
    for (int i = 0; i < iterations; i++) {
        // horizontal pass
        FastBlurFilter.blur(srcPixels, dstPixels, width, height, radius);
        // vertical pass
        FastBlurFilter.blur(dstPixels, srcPixels, height, width, radius);
    }
    // the result is now stored in srcPixels due to the 2nd pass
    GraphicsUtilities.setPixels(dst, 0, 0, width, height, srcPixels);

    return dst;
}
 
开发者ID:teddyted,项目名称:iSeleda,代码行数:28,代码来源:StackBlurFilter.java

示例4: filter

import org.jdesktop.swingx.graphics.GraphicsUtilities; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@SuppressWarnings({ "SuspiciousNameCombination" })
@Override
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
    int width = src.getWidth();
    int height = src.getHeight();

    if (dst == null) {
        dst = createCompatibleDestImage(src, null);
    }

    int[] srcPixels = new int[width * height];
    int[] dstPixels = new int[width * height];

    float[] kernel = createGaussianKernel(radius);

    GraphicsUtilities.getPixels(src, 0, 0, width, height, srcPixels);
    // horizontal pass
    blur(srcPixels, dstPixels, width, height, kernel, radius);
    // vertical pass
    blur(dstPixels, srcPixels, height, width, kernel, radius);
    // the result is now stored in srcPixels due to the 2nd pass
    GraphicsUtilities.setPixels(dst, 0, 0, width, height, srcPixels);

    return dst;
}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:29,代码来源:GaussianBlurFilter.java


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