[Imtoolkit-users] RE : IM C++ bindings to Lua
Brought to you by:
scuri
From: DONGIEUX-AKKA C. (S. D. SECURITE)
<chr...@sa...> - 2010-07-23 06:47:27
|
Hi Antonio, No, there is no inheritance from the imImage structure, I just wanted to say that I want to "improve" my software by adding image treatments executed from Lua. I tried to do something like that, but I couldn't make it work, maybe you could give my some hints: // in C++ class Foo { public: Foo(); { p_img = imImageCreate( ... ); } imImage* getImage() { return p_img; } }; ... // I init the imLua libraries imlua_open( L); imlua_open_fftw( L); imlua_open_process( L); ... // I expose my Foo class to Lua with Luabind luabind::module( L ) [ luabind::class_< Foo>( "Foo" ) .def( luabind::constructor<>() ) .def( "getImage", &Foo::getImage) ]; ... // I execute the below Lua script luaL_dofile( pState, "testIM.lua" ); // this function returns an error : "std::runtime_error: 'Trying to use unregistered class'" // the Lua script: f = Foo() img = f:getImage() im.ImageMakeBinary( img ) Do you have an idea of what is the problem and how could I do to solve it? Regards, Chris. ________________________________________ De : Antonio Scuri [sc...@te...] Date d'envoi : jeudi 22 juillet 2010 18:51 À : 'IM discussion list.' Objet : Re: [Imtoolkit-users] IM C++ bindings to Lua Hi Chris, ImLua already expose the imImage structure to Lua. Are you saying that you created a class that inherit from the imImage structure in C++ to extend it? Anyway, in ImLua the image data is still stored in C/C++, it is not duplicated in Lua. If you create algorithms in Lua by combining IM functions then the cost is very low. But to implement the algorithm in Lua accessing image pixels it will be very slow. Best Regards, Antonio Scuri > -----Original Message----- > From: DONGIEUX-AKKA Christophe (SAGEM DEFENSE SECURITE) > [mailto:chr...@sa...] > Sent: quinta-feira, 22 de julho de 2010 10:03 > To: imt...@li... > Subject: [Imtoolkit-users] IM C++ bindings to Lua > > Hello, > > I am writing a C++ program to display some image processed videos. My > program has some basic image processing functions available through IM, > but I'd like to extend it thanks to Lua/imLua. > IM is working in C++ and Lua, so I'd like to expose my imImage instance > in C++ to Lua, make some treatments, and then go back to C++ to display > it. > Do you think it's possible? (I already know how to do bindings thanks > to Luabind) > Will the data buffer contained in the C++ part of the imImage instance > be copied to the Lua world, or will C++ and Lua (imLua) share the same > memory zone? > What CPU and memory will it cost compared to C++ only image processing > with imLua? > > Thanks in advance, > Chris. > # > " Ce courriel et les documents qui lui sont joints peuvent contenir des > informations confidentielles ou ayant un caractère privé. S'ils ne vous > sont > pas destinés, nous vous signalons qu'il est strictement interdit de les > divulguer, de les reproduire ou d'en utiliser de quelque manière que ce > soit le contenu. Si ce message vous a été transmis par erreur, merci > d'en > informer l'expéditeur et de supprimer immédiatement de votre système > informatique ce courriel ainsi que tous les documents qui y sont > attachés." > ****** > " This e-mail and any attached documents may contain confidential or > proprietary information. If you are not the intended recipient, you are > notified that any dissemination, copying of this e-mail and any > attachments > thereto or use of their contents by any means whatsoever is strictly > prohibited. If you have received this e-mail in error, please advise > the > sender immediately and delete this e-mail and all attached documents > from your computer system." > # > ----------------------------------------------------------------------- > ------- > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first > _______________________________________________ > Imtoolkit-users mailing list > Imt...@li... > https://lists.sourceforge.net/lists/listinfo/imtoolkit-users ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Imtoolkit-users mailing list Imt...@li... https://lists.sourceforge.net/lists/listinfo/imtoolkit-users # " Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés." ****** " This e-mail and any attached documents may contain confidential or proprietary information. If you are not the intended recipient, you are notified that any dissemination, copying of this e-mail and any attachments thereto or use of their contents by any means whatsoever is strictly prohibited. If you have received this e-mail in error, please advise the sender immediately and delete this e-mail and all attached documents from your computer system." # |