//scanning/com.pixelnetica.scanning/ScanText
ScanText
[androidJvm]
class ScanText : ScanningSdkLibrary.Instance, Parcelable
Contains text with layout as recognition result
Constructors
| ScanText | [androidJvm] constructor() Create an undefined instance of ScanText constructor(source: ScanText?) Create a copy or undefined if null constructor(text: CharSequence) Parse CharSequence built by buildCharSequence constructor(parcel: Parcel) Read ScanText from an android.os.Parcel constructor(bytes: ByteArray) Read ScanText from byte array |
Types
| Name | Summary |
|---|---|
| CREATOR | [androidJvm] object CREATOR : Parcelable.Creator<ScanText> Implement android.os.Parcelable interface |
| Flag | [androidJvm] enum Flag : Enum<ScanText.Flag> Flags to generate String |
Properties
| Name | Summary |
|---|---|
| isReady | [androidJvm] val isReady: Boolean Image was recognized (not cancelled) and text may be empty |
| isTextEmpty | [androidJvm] val isTextEmpty: Boolean Text was recognized but text is empty (no text on image) |
| isTextReady | [androidJvm] val isTextReady: Boolean Image was recognized and text is NOT empty |
| languages | [androidJvm] val languages: String Languages string with which text was recognized |
| text | [androidJvm] val text: String Retrieve the text part of ScanText Don’t use toString to get the text. |
Functions
| Name | Summary |
|---|---|
| buildCharSequence | [androidJvm] @JvmOverloads external fun buildCharSequence(flags: EnumSet<ScanText.Flag> = defaultFlags, suggestionColor: Int = Color.RED): CharSequence? Build a CharSequence represented the ScanText |
| checkLanguages | [androidJvm] external fun checkLanguages(languages: String): Boolean Check specified language string corresponds with our |
| contentEquals | [androidJvm] external fun contentEquals(text: String): Boolean Internal purpose only! Fast compare text only without whitespaces. |
| describeContents | [androidJvm] open override fun describeContents(): Int Implement android.os.Parcelable interface |
| equals | [androidJvm] open operator override fun equals(other: Any?): Boolean Compare ScanText instances |
| filterInwardIds | [androidJvm] external fun filterInwardIds(ids: IntArray, lookup: IntArray?): IntArray Internal purpose only! Remove tags which completely placed in others. E.g. all words in a paragraph. |
| findPoint | [androidJvm] external fun findPoint(pt: PointF): Int Internal purpose only! Find tag under specified coordinates |
| getAllIds | [androidJvm] external fun getAllIds(): IntArray Internal purpose only! Retrieve all tags |
| getIdBounds | [androidJvm] external fun getIdBounds(id: Int): RectF? Internal purpose only! Retrieve tag rectangle |
| getIdPosition | [androidJvm] external fun getIdPosition(id: Int): Pair<Int, Int> Internal purpose only! Retrieve tag’s text position |
| getIdText | [androidJvm] @JvmOverloads external fun getIdText(id: Int, filterWhitespaces: Boolean = false): String Internal purpose only! Retrieve text for specified id |
| hashCode | [androidJvm] open override fun hashCode(): Int |
| replaceId | [androidJvm] external fun replaceId(source: ScanText, id: Int) Internal purpose only! Replace tag content from source with tag id Used to restore modified text |
| toString | [androidJvm] open external override fun toString(): String Returns partial internal representation of the object. To get text value use the property text. |
| writeBytes | [androidJvm] external fun writeBytes(packed: Boolean): ByteArray |
| writeToParcel | [androidJvm] open override fun writeToParcel(parcel: Parcel, flags: Int) Implement android.os.Parcelable interface |