Copy link to clipboard
Copied
I am trying to recreate the default transform effect.
First, I implemented rotation, but the areas that should be transparent are translucent purple. Do you see what is happening?
I use SmartFX
PF_FloatMatrix mat;
const double ratio = (double)in_data->downsample_x.num / (double)in_data->downsample_x.den;
PF_FpLong radiansF = PF_RAD_PER_DEGREE * FIX_2_FLOAT(params[CircleSlicer_ANGLE]->u.ad.value);
PF_FpLong sF = suites.ANSICallbacksSuite1()->sin(radiansF);
PF_FpLong cF = suites.ANSICallbacksSuite1()->cos(radiansF);
PF_FpLong aboutXF = in_data->width / 2 * ratio;
PF_FpLong aboutYF = in_data->height / 2 * ratio;
mat.mat[0][0] = cF;
mat.mat[0][1] = sF;
mat.mat[0][2] = 0.0;
mat.mat[1][0] = -sF;
mat.mat[1][1] = cF;
mat.mat[1][2] = 0.0;
mat.mat[2][0] = (aboutXF * (1.0 - cF) + aboutYF * sF);
mat.mat[2][1] = (aboutYF * (1.0 - cF) - aboutXF * sF);
mat.mat[2][2] = 1;
err = suites.WorldTransformSuite1()->transform_world(in_data->effect_ref, PF_Quality_HI, PF_MF_Alpha_STRAIGHT,
in_data->field, input, &mode, NULL, &mat, 1, true, &input->extent_hint, output);
Copy link to clipboard
Copied
Hi in_the_sky,
That looks a bit like uninitialized memory. Have you tried clearing the output before writing to it? PF_FillMatteSuite2 is available for this.
Cheers,
Jason
Copy link to clipboard
Copied
Thank you! I solved it.