summaryrefslogtreecommitdiff
path: root/html/examples/fft.lua
blob: 35896352cd8419ce7d15270d34410f431d886e53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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])