summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/fft/ImageView.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-08-31 01:25:59 +0200
committerMichael Bien <[email protected]>2010-08-31 01:25:59 +0200
commit4455385dd411375345688685dd561652708a7024 (patch)
tree1ddd2240d94e8c0571b29562bde411fb72fb2c82 /src/com/jogamp/opencl/demos/fft/ImageView.java
parent38641e01d3540e279ee91c9c6cfbc28414a6ed8d (diff)
initial import of Michael Zucchi's port of Apples FFT example (RFE 408).
small modifications: - pick CLPlatform with a GPU - replaced tabs with spaces :)
Diffstat (limited to 'src/com/jogamp/opencl/demos/fft/ImageView.java')
-rw-r--r--src/com/jogamp/opencl/demos/fft/ImageView.java25
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);
+ }
+}