summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/fft/ImageView.java
blob: a1bb94e09479bc59b0481b4c0883521e6b9021d5 (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
26
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
 */
@SuppressWarnings("serial")
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);
    }
}