Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^4: Open CV problem

by Anonyrnous Monk (Hermit)
on Dec 09, 2010 at 18:25 UTC ( [id://876297]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Open CV problem
in thread Open CV problem

I've never used Gtk2::Gdk::Pixbuf myself, so this is just speculation...
What might be a problem is that binary data may normally contain \0, which terminates a regular C char* string (as opposed to Perl strings, which may contain \0 without problems). In other words, if you cast the binary blob to char*, you're (likely) cutting off any data after the first \0... (which would explain why it works in some cases)

There are Perl API functions that allow you to specifiy the number of bytes to be copied into a scalar (e.g. sv_setpvn(), see perlapi), but I have no idea how to tell Inline::C to do custom conversions... So, what I would try is to convert the data to a scalar (SV*) myself on the C side, and then specify that as the return type of GetImage().  Also, you'd have to figure out where to get the proper length from... (header?)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://876297]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-23 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found