Another "External library" problem..
[1/4] from: cyphre:seznam:cz at: 3-Jul-2003 18:43
Hi List,
I have another problem (but I'm not sure if this is solvable):
I have a C function which returns pointer to rendering area containing RGB
data. I need to MAKE image! which will be referencing to this data directly
so when I use this image! in FACE and call SHOW FACE then Rebol should show
me the current image without any additional data manipulation(like
Ladislav's Get-mem? function does). This is the only way how to achieve
realtime rendering...
Has anyone Idea how to MAKE such kind of image! in Rebol?
thanks in advance,
Cyphre
[2/4] from: rotenca:telvia:it at: 4-Jul-2003 10:02
> I have a C function which returns pointer to rendering area containing RGB
> data. I need to MAKE image! which will be referencing to this data directly
<<quoted lines omitted: 3>>
> realtime rendering...
> Has anyone Idea how to MAKE such kind of image! in Rebol?
This should work:
http://www.escribe.com/internet/rebol/m32043.html
or i don't understand well your problem.
---
Ciao
Romano
[3/4] from: cyphre::seznam::cz at: 4-Jul-2003 11:17
Hi Romano,
Your method is not suitable for this purpose:
1) allocation of block of struct! containing for example 512x512 * 4 bytes
of chars! takes more than 30MB of memory!!
2)doing for example:
img: make image! reduce [512x512 third z/data]
30 and more times per second gives you poor performance
I meant any method which avoid ani image! data manipulation(like reduce in
this case) from Rebol side. You only make image! referencing to the pointer
you got from the external C function...then you need only do a SHOW to
refresh face which contains this image with data which are frequently
changed by extenral rendering library(in this case OpenGL)
I think this is not possible but anyway, any idas are welcome.
regards,
Cyphre
[4/4] from: rotenca:telvia:it at: 4-Jul-2003 12:53
Hi Cyphre,
> I think this is not possible but anyway
If you cannot build the image in REBOL and then pass the pointer to the
external routine,
i agree: there is no solution. From this point of view image! seems an
immutable value and the construction of an image! datatype always make a copy
of the binary string.
Whe should need a new refinement:
img: make image! ...
img/data: binary-string
---
Ciao
Romano
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted