PictureEffectsRaw Xojo Plugin

RotateEffectRaw.ApplyAsync Method (console safe)

Applies the effect asynchronously on a RawBitmap image with parameters that have been set on the class instance.

ApplyAsync(
   source as RawBitmap,
   angle as Double,
   backColor as Color,
   method as Integer,
   completeTarget as Object,
   completeMethod as Ptr)

Parameters

source
The source RawBitmap to work with. This can be any valid RawBitmap instance with 1, 2, 3 or 4 channels.
angle
The number of degrees to rotate. If you pass 90, 180 or 270 to it then native rotation mode for the specified value is selected for extra speed and extra precision. It is perfectly valid to pass a number larger than 360 to this parameter.
backColor
The number of degrees to rotate. If you pass 90, 180 or 270 to it then native rotation mode for the specified value is selected for extra speed and extra precision. It is perfectly valid to pass a number larger than 360 to this parameter.
method
Use this parameter to specify the quality of the rotation. (See the rotation constants on this class.)
completeTarget
Instance of target class that should receive complete signal. (Or nil if no signal is wanted)
completeMethod
Address of a method on the class instance passed into the completeTarget parameter. This method must take exactly one parameter which is:
effect as MPImageFilterRaw

It is all right to cast effect to RotateEffectRaw or to let the parameter be effect as RotateEffectRaw if wanted.

Wrong parameters on the completeMethod will give you crash.

If completeTarget is nil then this parameter should also be nil.

Remarks

Please note that asynchronous mode is advanced feature, you really need to understand it if you use this mode, since misunderstanding how it works could make your application behave in unexpected ways.

Asynchronous mode explained:



Time line on left is showing old style synchronous mode, time line in the middle showing asynchronous mode with complete hook and time line on right showing asynchronous mode without complete hook

There is right time and place for all of the modes, like old style synchronous might be the clear choice on images that are not extremely big while you might want the more complex asynchronous modes when dealing with huge images that take time to process.

See the Async examples to see how asynchronous mode with complete hook is used and how asynchronous mode without complete hook is used.

It is also important to realize when going asynchronous mode and choosing to use only one CPU core then one thread will be spawned, while if choosing just one CPU core in synchronous mode then no thread is spawned.

See Also

RotateEffectRaw Class