Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits.
As an example of the different masks, consider the following example: