Skip to main content
Inspiring
March 3, 2022
Question

WorldTransformSuite1()->transform_world purple alpha

  • March 3, 2022
  • 1 reply
  • 310 views

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);

 

This topic has been closed for replies.

1 reply

Community Manager
March 4, 2022

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

Inspiring
March 8, 2022

Thank you! I solved it.