Enum InspectTokenAction
- Namespace
- PaintDotNet.Effects.Gpu
- Assembly
- PaintDotNet.Effects.Core.dll
public enum InspectTokenAction
Fields
None = 0
If this value is returned from OnInspectTokenChanges(), the output image created by OnCreateOutput() will be retained. OnUpdateOutput() will not be called, and then the output image will be rendered using IDeviceContext.DrawImage().
This value is useful if you can safely determine that the changes to the token do not actually affect the output image.
RecreateOutput = 1
If this value is returned from OnInspectTokenChanges(), the output image created by OnCreateOutput() will be disposed.
Then, both OnCreateOutput() and OnUpdateOutput() will be called, and then the output image will be rendered using IDeviceContext.DrawImage().If this value is always returned from OnInspectTokenChanges() then there is no need to implement OnUpdateOutput(). This affords a much simpler programming model, but not the best performance.
It is always safe to return this value from OnInspectTokenChanges().UpdateOutput = 2
If this value is returned from OnInspectTokenChanges(), the output image created by the earlier call to OnCreateOutput() will be retained. OnCreateOutput() will not be called again.
Then, OnUpdateOutput() will be called, and then the output image will be rendered using IDeviceContext.DrawImage().Using this value can be significantly faster than RecreateOutput in scenarios where creating the output image is expensive (that is, OnCreateOutput() is expensive, or if the output has internal caching). However, it can be difficult -- sometimes significantly -- to correctly implement OnUpdateOutput(). Therefore, using this value is recommended only for experienced developers who are seeking maximum performance.