Re: How can you get an FxBitmap and display it to an open gl context
Re: How can you get an FxBitmap and display it to an open gl context
- Subject: Re: How can you get an FxBitmap and display it to an open gl context
- From: Darrin Cardani <email@hidden>
- Date: Mon, 28 Jul 2008 09:15:50 -0700
On Jul 25, 2008, at 4:58 PM, Brad Wright wrote:
I'm trying to read an FxBitmap and then render it as a texture to
the open gl context instead of writing it to the output image. Is
this at all possible to get fcp to ignore the output image and just
display to the open gl window? I need the raw bitmap data to do
analysis of that I can't do with an fxtexture.
Brad,
What are you actually trying to do? It's certainly possible to send
the image data from an FxBitmap to a texture, but in most
circumstances you wouldn't want to. You say in your description above
that you need to work on a bitmap because you can't do your analysis
on the GPU. Why do you then want to upload the bitmap to a texture? If
you don't need to do any additional work on it, it may make more sense
to simply return a bitmap to FCP. FCP is more efficient at working
with bitmaps than Motion, so it may actually be slowing you down if
you then upload the bitmap to a texture to work on it.
However, if you do need to do so, you can do something along these
lines (from memory, not compiled or tested):
UInt8* baseAddr = [bitmap dataPtr];
glTexImage2D (GL_TEXTURE_RECTANGLE_EXT, 0, GL_BGRA, [bitmap width],
[bitmap height], 0, GL_RGBA,
GL_UNSIGNED_INT_8_8_8_8, baseAddr);
Darrin
--
Darrin Cardani
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden