aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/fft/ImageView.java
blob: c5d07a179c47cf5f67e54ca6f76ca561efa5813f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.jogamp.opencl.demos.fft;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JComponent;

/**
 * Just draws an image.
 * @author notzed
 */
class ImageView extends JComponent {

    BufferedImage img;

    public ImageView(BufferedImage img) {
        this.img = img;
        this.setPreferredSize(new Dimension(img.getWidth(), img.getHeight()));
    }

    @Override
    protected void paintComponent(Graphics g) {
        g.drawImage(img, 0, 0, null);
    }
}