Alternative to pre_effect_origin
I have created a plugin that tints an image with a color. In a previous post, I explained how the iterate function was iterating over every pixel of the sequence, and not the clip, leading to performance issue and bugs. The issue was partially solved by passing an effect area to the function. The following code is how I am creating the effect area.
const PF_Rect effectArea = {
in_data->pre_effect_source_origin_x,
in_data->pre_effect_source_origin_y,
params[PLUGIN_INPUT]->u.ld.width - in_data->pre_effect_source_origin_x,
params[PLUGIN_INPUT]->u.ld.height - in_data->pre_effect_source_origin_y
};While I was testing my plugin to look for bugs, I realized that the effect area was never changing, regardless of other effects applied alongside my plugin that would change the clip's origin. I discovered this bug using an animated "Transform" effect on the clip.
I linked two videos of the bug for a better understanding of my issue (one with the tint effect before the transform, and another the other way around).
As the coordinates of the clip's pre_effect_source_origin are always the same, I understand where the problem comes from. However, I have no idea if there is a workaround to adapt the effect area to the clip area... Also note that the origin and dimensions are indeed changing when my plugin is beeing applied after the transform effect, when the transform scale is above 100%, so maybe I missed something in my area values...
The followings could help me solve the issue :
- Another method to retrieve the clip's origin point and dimensions within the sequence
- Another method to prevent the iterate function to run on every sequence's pixel
