Quantcast
Channel: Adobe Community : Popular Discussions - After Effects SDK
Viewing all articles
Browse latest Browse all 73444

Reading Pixels From Other Layers

$
0
0

Hi all;

 

I've been struggling with this and decided to clean up the old thread and outline my steps more clearly. I'm still trying to understand the basic procedure for reading pixel data from other layers, but without using the iteration suite.

 

Let me walk you through what I'm doing.

 

First I set up my layer selection controller (and the appropriate vars in the .h file):

 

AEFX_CLR_STRUCT(def);

PF_ADD_LAYER("Source", 0, SOURCE);

 

Then in my render function I check out the layer using the following:

 

PF_ParamDef check;

AEFX_CLR_STRUCT(check);

 

 

ERR(PF_CHECKOUT_PARAM(  in_data,
SOURCE,
in_data->current_time,
in_data->time_step,
in_data->time_scale,

&check));

 

Then supposedly here, I should be able to get the specified layer's pixel info using check.u.ld but this is where I'm stuck. I don't know how to do this. How do I get the red channel, green channel, blue channel and alpha channels? A lot of my confusion stems from the fact that I don't fully understand the logic of effect worlds.

 

And finally, when I'm done all this, I check in the layer:

 

ERR2(PF_CHECKIN_PARAM(in_data,

&check));

 

 

I am not using the iteration suite so I have been using this function listed in the SDK documentation to read and write pixel info in my current layer:

 

PF_Pixel *sampleIntegral32(PF_EffectWorld &def, int x, int y){

return (PF_Pixel*)((char*)def.data +

(y * def.rowbytes) +

(x * sizeof(PF_Pixel)));

}

 

Any help so that I can get this working would be highly appreciated and apologies in advance for what I'm sure is a very basic question but I am still learning... go easy on me.

 

Thanks,

-Rich


Viewing all articles
Browse latest Browse all 73444


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>