/* A basic extension of the java.applet.Applet class */ import java.awt.*; import java.applet.*; public class Applet1 extends Applet { public void init() { // Take out this line if you don't use symantec.itools.net.RelativeURL or symantec.itools.awt.util.StatusScroller symantec.itools.lang.Context.setApplet(this); // This code is automatically generated by Visual Cafe when you add // components to the visual environment. It instantiates and initializes // the components. To modify the code, only use code syntax that matches // what Visual Cafe can generate, or Visual Cafe may be unable to back // parse your Java file into its visual environment. //{{INIT_CONTROLS setLayout(null); setSize(430,270); button1 = new java.awt.Button(); button1.setLabel("test"); button1.setBounds(156,48,171,84); button1.setBackground(new Color(12632256)); add(button1); //}} //{{REGISTER_LISTENERS SymAction lSymAction = new SymAction(); button1.addActionListener(lSymAction); //}} } //{{DECLARE_CONTROLS java.awt.Button button1; //}} class SymAction implements java.awt.event.ActionListener { public void actionPerformed(java.awt.event.ActionEvent event) { Object object = event.getSource(); if (object == button1) button1_ActionPerformed(event); } } void button1_ActionPerformed(java.awt.event.ActionEvent event) { // test the damn FFT ComplexImage ci = new ComplexImage(4,4); ComplexImage fi = new ComplexImage(4,4); ComplexImage gi = new ComplexImage(4,4); for(int x = 0; x<4 ;x++) { for(int y = 0 ;y<4 ;y++) { ci.imagedata.r[y*4+x] = x;//(int)(4*Math.sin(2*Math.PI*x/4)); ci.imagedata.i[y*4+x] = y; //ci.imagedata.r[2] = 1; System.out.println("in : "+ci.imagedata.r[y*4+x]+" "+ci.imagedata.i[y*4+x]); } } ci.fFFT(fi,new TwoDimMappingFunction()); /*for(int x = 0 ; x<4 ;x++) { for(int y = 0 ;y<1 ;y++) { System.out.println("mid: "+fi.imagedata.r[y*4+x]+" "+fi.imagedata.i[y*4+x]); } }*/ fi.iFFT(gi,new TwoDimMappingFunction()); /*ci.fFFT(fi,new TwoDimMappingFunction()); fi.iFFT(ci,new TwoDimMappingFunction()); ci.fFFT(fi,new TwoDimMappingFunctio for(int x = 0 ; x<4 ;x++)n()); fi.iFFT(gi,new TwoDimMappingFunction());*/ { for(int y = 0 ;y<4 ;y++) { System.out.println("out: "+gi.imagedata.r[y*4+x]+" "+gi.imagedata.i[y*4+x]); } } // test complete. } }