lets say that i want to make an effect thats all it does is to change the buffer size,
so in the FRAME_SETUP i set the new height and width,
then, in the RENDER i have a problem because the input (params->u.ld.data) is not the same size as the output (output->data)
so i can't copy the pixels from one to another...
what is the right way to deal with this?
(i know the PF_COPY can manage this problem, but i want to know to do it myself)
you're asking something very general.
if it's just a matter of copying the input buffer into the center of the enlarged output buffer, then PF_COPY takes two rectangles with which you can resolve this issue easily.
there are a few other transformation functions that can handle the translation of images between buffers of different sizes. (transform_world() for instance)
if by "do it myself" you mean to ask how to access the image buffers directly in RAM, the take a look in the CCU sample project.
the drawing of the green circle is done directly into each pixel's location in memory.
this way you can copy data between buffers of different sizes. (or do any other thing, now that you can access random pixels in any buffer)
i'll check the transform functions, and the CCU sample as u suggested...
what i'm trying to figure out is if i make some effects on an image (like change the color and the alpha in the pixels)
and addtionally i want to change the output buffer, i can't understand how to both in the some effect.
i can allocate a new PF_EffectWorld make the modification on the new one and then copy it to the output, but i suspect there a better way...
actually, that's pretty much it.
it's now up to you to optimize the process.
a couple of examples:
a blur effect is calculated over the expanded buffer,
so you copy the small input to the large output, and blur the output buffer.
a warp effect would iterate over the large output, calculate it's origin pixel, and copy it from the small input.
if you want to color correct the image while expanding the buffer because... i don't know... you have fat pixels, the you can either copy the small input into a small intermediate, process the intermediate and then copy to the large output.
or, you can work directly on the small input (you can do that technically, just test your plug-in thoroughly), and copy the result to the output.
only you know what you want to do,
so figure out the route with the least redundant operations.
fun fun fun!
Europe, Middle East and Africa