Skip to main content
Known Participant
November 16, 2015
Question

compositing an image into the layer with rotation?

  • November 16, 2015
  • 1 reply
  • 1076 views

plugin newbie,

looking for information about copying an image (a relatively small layer, selected in a  menu)

into my effected layer, with rotation.

currently using :

WorldTransformSuite1()->composite_rect (

to do my copy, but I do not see anything about a transform matrix or a way to transform the world prior to doing the copy (with any of the different macros I found.)

what am I missing?

thnx,

-td

This topic has been closed for replies.

1 reply

Community Expert
November 16, 2015

transform_world()

ebluBetaAuthor
Known Participant
November 16, 2015

ok... I like that. straight forward. Thanks.

I do have a question or two about that though:

1. I've been staring at the documentation for transform_world() for a while, and it says :

The matrices pointer points to a matrix array used for motion-blur.

there's only 1 reference to a matrix. the documentation seems to be saying that the matrix is strictly used for information regarding motion blur. this is untrue?

2. the only example that Adobe ships that uses transform_world, sadly does not rotate the image. Could you point out an example somewhere?  Thanks.

Richard Rosenman
Inspiring
October 17, 2022

Hi,

1.Use an array of matrices only if you want motion blur.

You can check this thread:

Transform_world and motion blur

Otherwise just pass a simple matrix like so:

ERR(suites.WorldTransformSuite1()->transform_world( in_data->effect_ref,

  in_data->quality,

  PF_MF_Alpha_STRAIGHT,

  PF_Field_FRAME,

  &sourceWorld,

  &compositeMode,

  NULL,

  &mat, //here's your matrix

  1L,

  FALSE,

  &dstRect,

  &newWorld));

2.And here you'll find the matrix transform functions you need (thanx to Shachar):

https://forums.adobe.com/message/5565152#expires_in=86399993&token_type=bearer&access_token=eyJhbGciOiJSUzI1NiIsIng1dSI6…

The order I use is this one:

PF_FloatMatrix mat;

  SetIdentityMatrix( &mat);

  TranslateMatrix( &mat, posX, posY, NULL, NULL);

  RotateMatrix( &mat, in_data, angle, NULL, NULL);

  ScaleMatrix( &mat, scale, scale, NULL, NULL);

  TranslateMatrix( &mat,  - anchorX,  - anchorY, NULL, NULL);

Then transform_world()

Have fun!

heers,

François


Hi Francois;

 

I came across this post while searching for the matrix transform functions (I need to perform basic 2D translation, rotation and scale). However, all your links are dead.

 

Would it be possible for you to post those functions for me? I don't see them anywhere in the SDK. It would be highly appreciated.

 

Thanks!

Rich