Common Data Structures

Geometric Types

Defined under the namespace Scandit.Datacapture.Core

MeasureUnit

Added in version 6.8.0

Specifies in what units the value has been specified (fraction, device-independent pixels, pixels).

DIP

Added in version 6.8.0

Value is measured in device-independent pixels.

Pixel

Added in version 6.8.0

Value is measured in pixels.

Fraction

Added in version 6.8.0

Value is measured as a fraction. Valid values range from 0 to 1. This can be used to specify values in relative coordinates with respect to a reference, e.g. the view width or height.

SizingMode

Added in version 6.8.0

An enumeration of possible ways to define a rectangular size.

WidthAndHeight

Added in version 6.8.0

This value will use a SizeWithUnit to determine width and the height.

WidthAndAspectRatio

Added in version 6.8.0

This value will use a NumberWithUnit to determine the width and a float multiplier to determine the height.

HeightAndAspectRatio

Added in version 6.8.0

This value will use a NumberWithUnit to determine the height and a float multiplier to determine the width.

ShorterDimensionAndAspectRatio

Added in version 6.8.0

This value will use a NumberWithUnit to determine the rectangle length on the short side of the reference and a float multiplier to determine the length on the long side.

Point
class Point

Added in version 6.8.0

constructor(x, y)
constructor(x: number,
        y: number)

Added in version 6.8.0

Construct a new point at position x and y.

x
get x(): number

Added in version 6.8.0

X coordinate of the point.

y
get y(): number

Added in version 6.8.0

Y coordinate of the point.

PointWithUnit
class PointWithUnit

Added in version 6.8.0

x
get x(): NumberWithUnit

Added in version 6.8.0

X coordinate of the point.

y
get y(): NumberWithUnit

Added in version 6.8.0

Y coordinate of the point.

Rect
class Rect

Added in version 6.8.0

constructor(origin, size)
constructor(origin: Point,
        size: Size)

Added in version 6.8.0

Construct a new rectangle.

origin
get origin(): Point

Added in version 6.8.0

The origin (top-left corner) of the rectangle.

size
get size(): Size

Added in version 6.8.0

The size of the rectangle.

RectWithUnit
class RectWithUnit

Added in version 6.8.0

origin
get origin(): PointWithUnit

Added in version 6.8.0

The origin (top-left corner) of the rectangle.

size
get size(): SizeWithUnit

Added in version 6.8.0

The size of the rectangle.

SizeWithUnit
class SizeWithUnit

Added in version 6.8.0

width
get width(): NumberWithUnit

Added in version 6.8.0

The width.

height
get height(): NumberWithUnit

Added in version 6.8.0

The height.

SizeWithAspect
class SizeWithAspect

Added in version 6.8.0

Holds values to define a rectangular size using a dimension and an aspect ratio multiplier.

size
get size(): NumberWithUnit

Added in version 6.8.0

The size of one dimension.

aspect
get aspect(): number

Added in version 6.8.0

The aspect ratio for the other dimension.

NumberWithUnit
class NumberWithUnit

Added in version 6.8.0

Holds a floating-point value plus a measure unit.

value
get value(): number

Added in version 6.8.0

unit
get unit(): MeasureUnit

Added in version 6.8.0

MarginsWithUnit
class MarginsWithUnit

Added in version 6.8.0

Holds margin values (left, top, right, bottom) that can each be expressed with a different measure unit.

left
get left(): NumberWithUnit

Added in version 6.8.0

Left margin.

right
get right(): NumberWithUnit

Added in version 6.8.0

Right margin.

top
get top(): NumberWithUnit

Added in version 6.8.0

Top margin.

bottom
get bottom(): NumberWithUnit

Added in version 6.8.0

Bottom margin.

Quadrilateral
class Quadrilateral

Added in version 6.8.0

Polygon represented by 4 corners.

topLeft
get topLeft(): Point

Added in version 6.8.0

topRight
get topRight(): Point

Added in version 6.8.0

bottomRight
get bottomRight(): Point

Added in version 6.8.0

bottomLeft
get bottomLeft(): Point

Added in version 6.8.0

Size
class Size

Added in version 6.8.0

constructor(width, height)
constructor(width: number,
        height: number)

Added in version 6.8.0

width
get width(): number

Added in version 6.8.0

The width.

height
get height(): number

Added in version 6.8.0

The height.

SizeWithUnitAndAspect
class SizeWithUnitAndAspect

Added in version 6.8.0

Holds a SizingMode - and corresponding required values - to define a rectangular size.

widthAndHeight
get widthAndHeight(): SizeWithUnit | null

Added in version 6.8.0

The values for width and height.

Note

This value will always be null unless sizingMode is SizingMode.WidthAndHeight.

widthAndAspectRatio
get widthAndAspectRatio(): SizeWithAspect | null

Added in version 6.8.0

The value for width and the aspect ratio for height.

Note

This value will always be null unless sizingMode is SizingMode.WidthAndAspectRatio.

heightAndAspectRatio
get heightAndAspectRatio(): SizeWithAspect | null

Added in version 6.8.0

The value for height and the aspect ratio for width.

Note

This value will always be null unless sizingMode is SizingMode.HeightAndAspectRatio.

shorterDimensionAndAspectRatio
get shorterDimensionAndAspectRatio(): SizeWithAspect | null

Added in version 6.8.0

The value for the short dimension of the reference view and the aspect ratio for the long dimension of the reference view.

Note

This value will always be null unless sizingMode is SizingMode.ShorterDimensionAndAspectRatio.

sizingMode
get sizingMode(): SizingMode

Added in version 6.8.0

The sizing mode.

Misc Types

Defined under the namespace Scandit.Datacapture.Core

Defined under the namespace Scandit.Datacapture.Core

EncodingRange
class EncodingRange

Added in version 6.8.0

Defines the encoding of a range of bytes.

ianaName
get ianaName(): string

Added in version 6.8.0

Charset encoding name as defined by IANA.

startIndex
get startIndex(): number

Added in version 6.8.0

Start index of this encoding range.

endIndex
get endIndex(): number

Added in version 6.8.0

End index (first index after the last) of this encoding range.

Defined under the namespace Scandit.Datacapture.Core

Orientation

Added in version 6.8.0

Unknown

Added in version 6.8.0

Portrait

Added in version 6.8.0

PortraitUpsideDown

Added in version 6.8.0

LandscapeRight

Added in version 6.8.0

LandscapeLeft

Added in version 6.8.0

Color
class Color

Added in version 6.8.0

fromHex(hex)
static fromHex(hex: string): Color

Added in version 6.8.0

Create a color from a hexadecimal string. Colors can be represented by hexadecimal strings in the following formats (R = red, G = green, B = blue, A = alpha) with an optional # prefix. The characters can be upper or lower case:

  • RRGGBB

  • RRGGBBAA

  • #RRGGBB

  • #RRGGBBAA

  • RGB

  • RGBA

  • #RGB

  • #RGBA

fromRGBA(red, green, blue, alpha)
static fromRGBA(red: number,
        green: number,
        blue: number,
        alpha: number): Color

Added in version 6.8.0

Create a color from numerical color components.

withAlpha(alpha)
withAlpha(alpha: number): Color

Added in version 6.8.0

Create a color that only differs in it’s alpha component.

redComponent
get redComponent(): string

Added in version 6.8.0

Red component of the color as a hexadecimal string.

greenComponent
get greenComponent(): string

Added in version 6.8.0

Green component of the color as a hexadecimal string.

blueComponent
get blueComponent(): string

Added in version 6.8.0

Blue component of the color as a hexadecimal string.

alphaComponent
get alphaComponent(): string

Added in version 6.8.0

Alpha component of the color as a hexadecimal string.

red
get red(): number

Added in version 6.8.0

Red component of the color as a decimal value.

green
get green(): number

Added in version 6.8.0

Green component of the color as a decimal value.

blue
get blue(): number

Added in version 6.8.0

Blue component of the color as a decimal value.

alpha
get alpha(): number

Added in version 6.8.0

Alpha component of the color as a decimal value.

Defined under the namespace Scandit.Datacapture.Core