Instance Class
abstract class Instance : AutoCloseable
Base class of every SDK object backed by memory the Java garbage collector does not manage.
Two things every subclass inherits are worth knowing before you use one.
Licensing is captured at construction. An instance records the licence state in force when it is created, and keeps it for its whole life. Construct one before ScanningSdkLibrary.load and it is bound to the unlicensed state permanently, so its output stays watermarked no matter what you do afterwards. This is silent — nothing throws — so load first.
Confine an instance to one thread unless its own documentation says otherwise. Most types here hold native state with no locking of their own, so concurrent use is undefined. FrameObserver is the exception and documents what it does support. In every case close must not run while another thread is inside a call that uses the instance.
See also
Inheritors
- FrameObserver
- ImageWriter
- ImageCompression
- ScanCutout
- ScanDetector
- ScanLayout
- ScanPicture
- ScanReader
- ScanText
- Helper
Functions
close
@Synchronized open override fun close()
Releases the native memory held by this instance immediately instead of waiting for the garbage collector.