Wednesday, April 18, 2012

Lua Scripting and C#

this is quite tricky for me and i'm hoping someone can help me out.



The situation: I'm currently working an application in C# 3.5 .NET , it interfaces with a DLL written in C++ using DLL Imports, that all works fine. I also have a Lua script, this script is as follows:



Width           = XCamera():GetWidth()
Height = XCamera():GetHeight()
Img = XSensorImage()


then for example, there is a function that calculates the temperature from Img by:



function OnFrame()
local CoordsTable = { i, j }
local PixelTable = Img:GetPixels( CoordsTable )
PixelValue = FromLinearizedADU( PixelTable[1] or 0 )
end


what I want to be able to do, is return PixelValue to my application.



XCamera() & XSensorImage() are instances created when the camera filters are initialized and the Lua script is active.



Is there anyway of accessing Pixel Value from this script when it is running?
I'm sorry if I'm not being detailed enough, please ask if you require more, your feedback is much appreciated.





No comments:

Post a Comment