Package-level declarations Package

The engine’s public surface: scan pages and their cutouts, detection, text recognition, document export, and the entry point that loads the engine and applies the licence.

Types

Device

enum Device : Enum<Device>

The camera a page was captured with, so the engine can compensate for that hardware’s known characteristics.

FlashMode

enum FlashMode : Enum<FlashMode>

Whether the flash fired when a page was captured, which tells the engine to expect glare and uneven lighting.

FrameObserver

class FrameObserver : ScanningSdkLibrary.Instance

Analyses live camera frames and reports how well a document is framed, so a viewfinder can guide the user and decide when to take the shot.

ImageFileWriter

interface ImageFileWriter

Writes a page that is already on disk, without decoding it first.

ImageWriter

abstract class ImageWriter : ScanningSdkLibrary.Instance, Closeable

Writes scanned pages out to a file, one page at a time.

ImageWriterPdf

class ImageWriterPdf(file: File) : ImageWriter, ImageFileWriter

Writes scanned pages into a PDF document, one page per image.

ImageWriterPng

class ImageWriterPng(file: File) : ImageWriter

Writes a scanned page to a PNG file.

ImageWriterTiff

class ImageWriterTiff(file: File) : ImageWriter

Writes scanned pages to a black-and-white TIFF.

RefineFeature

sealed class RefineFeature

What ScanPicture.refine should do to a page: how to crop it, how to treat its colour, and which way up to leave it.

ScanCutout

class ScanCutout : ScanningSdkLibrary.Instance, Parcelable

The outline of a document within a page: the corner points that say which part of the image is the sheet of paper.

ScanDetector

class ScanDetector : ScanningSdkLibrary.Instance

A loaded detection model, used to work out which way up a page is.

ScanLayout

class ScanLayout : ScanningSdkLibrary.Instance

The structure recognition found on a page: the regions of text, and how they nest.

ScanningSdkException

class ScanningSdkException : RuntimeException

Thrown when an SDK operation fails: the engine could not complete the work, or the object it was asked to work on has been closed.

ScanningSdkLibrary

object ScanningSdkLibrary : Tag

Entry point to the document-scanning SDK: loads the native engine, applies your licence, and reports what this build is.

ScanOrientation

enum ScanOrientation : Enum<ScanOrientation>

Which way up an image is, using the same eight cases as the EXIF orientation tag.

ScanPicture

class ScanPicture : ScanningSdkLibrary.Instance

A page being scanned: its pixels, the document outline detected on it, and any text recognised from it.

ScanReader

class ScanReader : ScanningSdkLibrary.Instance

A loaded text-recognition engine, with its language data.

ScanText

class ScanText : ScanningSdkLibrary.Instance, Parcelable

The text recognised on a page, together with where each piece of it sits on the image.

Properties

hasText

val ScanPicture.hasText: Boolean

Whether this page carries a recognition result.

profileType

var MutableSet<RefineFeature>.profileType: RefineFeature.Profile.Type

The colour-processing type in this feature set.

shadows

var MutableSet<RefineFeature>.shadows: Boolean

Whether this feature set asks for shadow compensation.

Functions

copy

fun ScanCutout?.copy(): ScanCutout?

Safe copy cutout.

display

fun ScanPicture.display()

Marks this page as the one currently displayed, so processing can favour on-screen quality.

getOrientation

fun Bundle.getOrientation(name: String, default: ScanOrientation = ScanOrientation.Undefined): ScanOrientation

Reads an orientation previously stored by putOrientation.

getOrientationExtra

fun Intent.getOrientationExtra(name: String, default: ScanOrientation = ScanOrientation.Undefined): ScanOrientation

Reads an orientation previously stored by putOrientationExtra.

makeRefineProfile

fun Int.makeRefineProfile(): RefineFeature.Profile

Builds the colour-processing feature from a stored profile value.

makeTransform

fun Bitmap.makeTransform(orientation: ScanOrientation): Matrix

Builds the transform matrix that applies an EXIF orientation to this bitmap.

or

infix fun EnumSet<ScanReader.Flag>.or(other: ScanReader.Flag): EnumSet<ScanReader.Flag>

Adds a flag to an existing set, so options can be combined with or.

orUndefined

fun ScanOrientation?.orUndefined(): ScanOrientation

Returns this orientation, or ScanOrientation.Undefined when it is null.

putOrientation

fun Bundle.putOrientation(name: String, orientation: ScanOrientation)

Stores an orientation in this bundle.

putOrientationExtra

fun Intent.putOrientationExtra(name: String, orientation: ScanOrientation): Intent

Stores an orientation in this intent, so it survives being passed between screens.

rectify

fun ScanCutout?.rectify(): RefineFeature

Chooses the right crop mode for a cutout that may be absent: crop to it when there is one, and leave the page uncropped when there is not.

fun ScanPicture.rectify(cutout: ScanCutout)

Crops and straightens the page to an outline, leaving its colours untouched.

resize

fun ScanPicture.resize(size: Size, uniform: Boolean = false)

Scales this page to the given size.

safeMakeTransform

fun Bitmap?.safeMakeTransform(orientation: ScanOrientation?): Matrix

Builds the orientation transform for a bitmap that may be absent, returning an identity matrix when either the bitmap or the orientation is null.

toScanOrientation

fun Int.toScanOrientation(): ScanOrientation

Converts an EXIF integer into the orientation it represents.

transform

fun Bitmap.transform(orientation: ScanOrientation): Bitmap

Returns this bitmap rotated into the given orientation, or the same bitmap if it is already displayable as-is.

withOrientation

fun ScanPicture.withOrientation(newOrientation: ScanOrientation): ScanPicture

Returns this page at the given orientation.

Top