Hey guys. In my import plugin's DrawSparseFrame, I'm trying to figure out the PixelFormat of the PF_EffectWorld* passed in. My prototype looks like this:
const AEIO_DrawSparseFramePB *sparse_framePPB,
So how do you get the pixel format? From the wP, you can get width/height/pitch/base address. I'd like to use the WorldSuite3 but all the calls need an AEGP_WorldH. So is there some way to get the AEGP_WorldH from the passed in PF_EffectWorld*, or is there another way to get the pixel format without using older, deprecated suites?
PF_WorldSuite2 *wsP = NULL;
ERR(suites.Pica()->AcquireSuite( kPFWorldSuite, kPFWorldSuiteVersion2, (const void**)&wsP));
ERR(suites.Pica()->ReleaseSuite( kPFWorldSuite, kPFWorldSuiteVersion2));
as far as i know, you can't do that with ver3, because the PF_GetPixelFormat() function doesn't seem to be defined in it.
is the given world not always in the same depth as the project? (or the render settings?)
It might. It definitely does not match the Spec's depth. Originally I tried using:
But IIRC in some cases the depth didn't match the world's depth. In case you haven't noticed, I'm kindof blindly fumbling through examples trying to just make things work. (-:
In case you haven't noticed, I'm kindof blindly fumbling through examples trying to just make things work. (-:
your secret is safe with me...
i thought of another trick that might help.
PF_EffectWorld also denotes rowbytes.
rowbytes / width == roughly the pixel size in bytes.
why roughly? because each row has some added bytes at the end of each row for padding.
Yeah, that's actuallly what I was doing. It seemed to work, although it's a little scary. What if AE decides that it wants to put me in a world that is 4x as wide as a normal one and wants to me to draw on the far left side, which according the API it could legally do, but never seems to do. Your first solution definitely seems the safest. But it would be nice if anyone knows of a "proper" solution to this problem that only uses latest APIs.
Europe, Middle East and Africa