Example usage for java.awt.image Kernel getWidth

List of usage examples for java.awt.image Kernel getWidth

Introduction

In this page you can find the example usage for java.awt.image Kernel getWidth.

Prototype

public final int getWidth() 

Source Link

Document

Returns the width of this Kernel .

Usage

From source file:view.FramePrincipal.java

private void applyKernelJava(Kernel kernel, String DescricaoKernel) {
    long before = 0;
    long after = 0;
    double durationMS = 0;
    String message = null;/*from w w  w .  j av a 2  s  . c  o m*/

    BufferedImageOp bop = new ConvolveOp(kernel);
    before = System.nanoTime();
    outputImage = bop.filter(inputImage, outputImage);
    after = System.nanoTime();
    durationMS = (after - before) / 1e6;
    message = "Java: " + String.format("%.2f", durationMS) + " ms" + " Descrio : "
            + truncate(DescricaoKernel, 13);
    DadosEstatisticos dadosEstatisticos = new DadosEstatisticos(truncate(DescricaoKernel, 13),
            kernel.getWidth(), kernel.getHeight(), (float) durationMS);
    listaDadosEstatisticosJava.add(dadosEstatisticos);
    setInfoProcesso(dadosEstatisticos);
    System.out.println(message);

}

From source file:view.FramePrincipal.java

private void applyKernelOpenCl(Kernel kernel, String DescricaoKernel) {
    long before = 0;
    long after = 0;
    double durationMS = 0;

    String message = null;/*w  w  w  .j  a v a  2  s  .c  om*/

    JOCLRenderizador jop = JOCLRenderizador.create(kernel);
    before = System.nanoTime();
    outputImage = jop.filter(inputImage, outputImage);
    after = System.nanoTime();
    durationMS = (after - before) / 1e6;
    message = "JOCL: " + String.format("%.2f", durationMS) + " ms" + " Descrio : "
            + truncate(DescricaoKernel, 13);
    System.out.println(message);
    DadosEstatisticos dadosEstatisticos = new DadosEstatisticos(truncate(DescricaoKernel, 13),
            kernel.getWidth(), kernel.getHeight(), (float) durationMS);
    listaDadosEstatisticosOPENCL.add(dadosEstatisticos);
    setInfoProcesso(dadosEstatisticos);
    jop.shutdown();

}

From source file:view.FramePrincipal.java

private void applyKernelJavaThread(final Kernel kernel, final String DescricaoKernel) {
    new Thread(new Runnable() {
        @Override//from  w ww  .  ja  v  a  2  s .  co  m
        public void run() {
            long before = 0;
            long after = 0;
            double durationMS = 0;
            String message = null;

            BufferedImageOp bop = new ConvolveOp(kernel);
            before = System.nanoTime();
            outputImage = bop.filter(inputImage, outputImage);
            after = System.nanoTime();
            durationMS = (after - before) / 1e6;
            message = "Java ThRead: " + String.format("%.2f", durationMS) + " ms" + " Descrio : "
                    + truncate(DescricaoKernel, 13);
            DadosEstatisticos dadosEstatisticos = new DadosEstatisticos(truncate(DescricaoKernel, 13),
                    kernel.getWidth(), kernel.getHeight(), (float) durationMS);
            listaDadosEstatisticosJavaTHREAD.add(dadosEstatisticos);
            setInfoProcesso(dadosEstatisticos);
            System.out.println(message);

        }
    }).start();

}