Class DocumentCleanup

java.lang.Object
io.scanbot.sdk.imageprocessing.DocumentCleanup
All Implemented Interfaces:
AutoCloseable

public class DocumentCleanup extends Object implements AutoCloseable
API for document cleanup. Required licence feature(s): ImageProcessing.
  • Constructor Details

  • Method Details

    • run

      cleans the masked areas up.
      Parameters:
      mask - Specifies the regions to clean up. Non-zero pixels indicate the region to be cleaned up.
      Returns:
      Cleanup result with status and the cleaned up image.
      Throws:
      InvalidImageRefException - If an invalid image reference is used
      LicenseException - If license requirements for the API are not met
    • undo

      Reverts the last cleanup operation. If no operations are available to undo, returns the current image unchanged. The number of available undo operations is limited by maxUndoRedoStackSize. When the operation limit is exceeded, the oldest operations cannot be undone.
      Returns:
      Image with last operation reverted, or current image if no operations to undo.
      Throws:
      InvalidImageRefException - If an invalid image reference is used
      LicenseException - If license requirements for the API are not met
    • redo

      Re-applies the last undone cleanup operation. If no operations are available to redo, returns the current image unchanged. Performing a new cleanup operation after undo will clear the redo history.
      Returns:
      Image with last undone operation re-applied, or current image if no operations to redo.
      Throws:
      InvalidImageRefException - If an invalid image reference is used
      LicenseException - If license requirements for the API are not met
    • reset

      Restores the original image, and clears the undo/redo history. After reset, both canUndo and canRedo return false.
      Returns:
      The original, unmodified image.
      Throws:
      InvalidImageRefException - If an invalid image reference is used
      LicenseException - If license requirements for the API are not met
    • canUndo

      public boolean canUndo()
      Returns whether an undo operation is currently available. This is true when at least one cleanup operation has been performed and not yet fully undone.
      Returns:
      True if undo is available, false otherwise.
    • canRedo

      public boolean canRedo()
      Returns whether a redo operation is currently available. This is true when at least one undo operation has been performed and not yet overwritten by a new cleanup.
      Returns:
      True if redo is available, false otherwise.
    • close

      public void close()
      Closes native resources held by the object.
      Specified by:
      close in interface AutoCloseable
    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable