Example usage for java.awt.image Kernel getHeight

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

Introduction

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

Prototype

public final int getHeight() 

Source Link

Document

Returns the height 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 ww w .j a  va2 s .co 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;//from   w w  w.  j  a  va  2  s  .  c o  m

    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 w w .  j  a v a2  s  .c  o 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();

}