PictureEffectsRaw Xojo Plugin

ContrastEffectRaw.ApplyInPlaceAsync Method (console safe)

Applies the effect asynchronously on a RawBitmap image with parameters that have been set on the class instance, and the RawBitmap passed in will also get the result image.

   source as RawBitmap,
   completeTarget as Object,
   completeMethod as Ptr)


The source image as RawBitmap
Instance of target class that should receive complete signal. (Or nil if no signal is wanted)
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 ContrastEffectRaw or to let the parameter be effect as ContrastEffectRaw if wanted.

Wrong parameters on the completeMethod will give you crash.

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


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

ContrastEffectRaw Class