DocumentModel

A base class containing images for a scanned document

import com.sybrin.identity.models.DocumentModel

Summary

Public methods

Data source

<T extends DocumentModel>

castToModel(Class<T> class)

Casts the current model to the

type specified by the class parameter.

N/A

Bitmap

Front of document

String

Local storage

Bitmap

Front of document

String

Local storage

Bitmap

Front of document

String

Local storage

void

saveImages(Context context)

Saves all images within the model

to the local device and populates

all path fields.

N/A

Public methods

castToModel

public <T extends DocumentModel> castToModel (Class<T> class)

Casts the current model to the type specified by the class parameter. The specified type must be a child of DocumentModel.

Parameters

class

Class<T>: Type of class the result is being cast to.

Returns

<T extends DocumentModel>

Value is null if casting was not possible.

getCroppedDocumentImage

public Bitmap getCroppedDocumentImage ()

Returns a cropped image of the scanned document.

Returns

Bitmap

This value cannot be null.

getCroppedDocumentImagePath

public String getCroppedDocumentImagePath ()

Returns the file path of the saved cropped document image.

Returns

String

Value is null if image was not saved.

getDocumentImage

public Bitmap getDocumentImage ()

Returns an image of the scanned document.

Returns

Bitmap

This value cannot be null.

getDocumentImagePath

public String getDocumentImagePath ()

Returns the file path of the saved document image.

Returns

String

Value is null if image was not saved.

getPortraitImage

public Bitmap getPortraitImage ()

Returns cropped image of the face found on the scanned document.

Returns

Bitmap

This value cannot be null.

getPortraitImagePath

public String getPortraitImagePath ()

Returns the file path of the saved portrait image.

Returns

String

Value is null if image was not saved.

saveImages

public void saveImage (Context context)

Saves all images within the model to the local device and populates all path fields.

Parameters

Context

Value cannot be null.