I am trying to retrieve the layer transform of a layer put into a generator’s image well parameter.
I setup like this:
[ l_FxParameterCreationAPI_v5 addImageReferenceWithName : [l_Bundle localizedStringForKey: @"Source" value:NULL table:NULL] parameterID : k_Parameter_ID_Source_Texture parameterFlags : kFxParameterFlag_DEFAULT ];
- ( BOOL ) properties : ( NSDictionary * _Nonnull * ) properties
error : ( NSError * _Nullable * ) error
{
*properties = @{
kFxPropertyKey_MayRemapTime : @NO,
kFxPropertyKey_IsThreadSafe : @NO,
kFxPropertyKey_UsesRationalTime : @YES,
kFxPropertyKey_PixelTransformSupport : [ NSNumber numberWithInt : kFxPixelTransform_ScaleTranslate ], // kFxPixelTransform_Full ],
kFxPropertyKey_VariesWhenParamsAreStatic : @YES,
kFxPropertyKey_NeedsFullBuffer : @YES,
kFxPropertyKey_ChangesOutputSize : @YES
};
return YES;
}
- ( BOOL ) destinationImageRect : ( FxRect * ) m_Destination_Image_Rectangle
sourceImages : ( NSArray < FxImageTile * > * ) m_Source_Images
destinationImage : ( FxImageTile * ) m_Destination_Image
pluginState : ( NSData * ) m_Plugin_State
atTime : ( CMTime ) m_Render_Time
error : ( NSError * _Nullable * ) m_Out_Error
{
Matrix44Data* pt = [ m_Source_Images [ 0 ].pixelTransform matrix ];
NSLog( @"NECTAR . PT . 0x:%f 0y:%f 0z:%f 0w:%f", (*pt)[0][0], (*pt)[0][1], (*pt)[0][2], (*pt)[0][3] ); // •••
NSLog( @"NECTAR . PT . 1x:%f 1y:%f 1z:%f 1w:%f", (*pt)[1][0], (*pt)[1][1], (*pt)[1][2], (*pt)[1][3] ); // •••
NSLog( @"NECTAR . PT . 2x:%f 2y:%f 2z:%f 2w:%f", (*pt)[2][0], (*pt)[2][1], (*pt)[2][2], (*pt)[2][3] ); // •••
NSLog( @"NECTAR . PT . 3x:%f 3y:%f 3z:%f 3w:%f", (*pt)[3][0], (*pt)[3][1], (*pt)[3][2], (*pt)[3][3] ); // •••
return YES;
}
Result:
PT . 0x:1.000000 0y:0.000000 0z:0.000000 0w:0.000000
PT . 1x:0.000000 1y:1.000000 1z:0.000000 1w:0.000000
PT . 2x:0.000000 2y:0.000000 2z:1.000000 2w:0.000000
PT . 3x:0.000000 3y:0.000000 3z:0.000000 3w:1.000000
The source layer is rotated 90° so the following identity matrix does make sense? How do I retrieve the transform matrix of the source layer correctly?
I tried in the render method as well with the same results.
Thank you,
David