Re: Array from C++ DLL to Euphoria
- Posted by TheresNoTime Jul 13, 2013
- 1638 views
Thanks! But I do not understand how Euphoria find the internal structure of the array? I guess, Euphoria always sees it as a sequence of bytes?
A SAFEARRAY is a special thing that Microsoft created for COM / ActiveX / OLE Automation. It's not just a native C++ array. There is a whole API for dealing with them.
Matt
I have idea: transform SAFEARRAY with screenshot to more compact array. I needn't full information about pixels. It is possible to squeeze RGB to one byte. I can see two methods:
1. Eight bits composed by three bits from R, three from G and two from B. May be even this: four bits of R and four bits G. I know in advance that the blue color will rarely see in my screenshots.
2. (R+G+B)/3. So, we get brightness (from 0 to 255). Other formula: (R+G+B)>>2 (from 0 to 191).
Do you think this makes sense? Whether such transformation will be compensated by simplifying and/or accelerating export of an byte[] to Euphoria program?