diff options
Diffstat (limited to 'src/com/jogamp/opencl/demos/fft/ImageView.java')
-rw-r--r-- | src/com/jogamp/opencl/demos/fft/ImageView.java | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/jogamp/opencl/demos/fft/ImageView.java b/src/com/jogamp/opencl/demos/fft/ImageView.java new file mode 100644 index 0000000..c5d07a1 --- /dev/null +++ b/src/com/jogamp/opencl/demos/fft/ImageView.java @@ -0,0 +1,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); + } +} |