lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


For instance, a "memoryview" module can be put together quite
easily using LuaJIT (just to avoid a C interface) and Roberto's struct:

Well, let's say I have an ImageMagic library and an ndarray library.  How do I use your memoryview module to convert the ImageMagic image to an ndarray?

-- load an image using ImageMagick library
img = Image()
img:open("lena.jpg")

-- allocate an array
a = ndarray(img.height,img.width)

-- efficiently copy the pixels of img into a
>>> put some FFI _expression_ here <<<

Tom