summaryrefslogtreecommitdiff
path: root/test/lua/fft.lua
diff options
context:
space:
mode:
authorscuri <scuri>2008-10-17 06:10:15 +0000
committerscuri <scuri>2008-10-17 06:10:15 +0000
commit5a422aba704c375a307a902bafe658342e209906 (patch)
tree5005011e086bb863d8fb587ad3319bbec59b2447 /test/lua/fft.lua
First commit - moving from LuaForge to SourceForge
Diffstat (limited to 'test/lua/fft.lua')
-rw-r--r--test/lua/fft.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/lua/fft.lua b/test/lua/fft.lua
new file mode 100644
index 0000000..3589635
--- /dev/null
+++ b/test/lua/fft.lua
@@ -0,0 +1,17 @@
+require"imlua"
+require"imlua_process"
+require"imlua_fftw"
+
+local filename = "lena.jpg"
+local image = im.FileImageLoad(filename)
+
+local complex = im.ImageCreate(image:Width(), image:Height(), image:ColorSpace(), im.CFLOAT)
+im.ProcessFFT(image, complex)
+
+local c = complex[0][5][10] -- component=0(Red), y = 5 x =10
+print(c[1], c[2])
+
+complex[0][5][10] = { 2*c[1], c[2]/2 }
+
+local c = complex[0][5][10]
+print(c[1], c[2])