# Common Data Structures

## Geometric Types

Defined in library scandit_datacapture_core

MeasureUnit

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

dip

Value is measured in device-independent pixels.

pixel

Value is measured in pixels.

fraction

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

An enumeration of possible ways to define a rectangular size.

widthAndHeight

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

widthAndAspectRatio

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

heightAndAspectRatio

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

shorterDimensionAndAspectRatio

This value will use a DoubleWithUnit 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`

Point(x, y)
``` Point(double x,
double y)```

Construct a new point at position x and y.

x
`double get x`

X coordinate of the point.

y
`double get y`

Y coordinate of the point.

PointWithUnit
`class PointWithUnit`

PointWithUnit(x, y)
``` PointWithUnit(DoubleWithUnit x,
DoubleWithUnit y)```

Construct a new point at position x and y.

x
`final DoubleWithUnit x`

X coordinate of the point.

y
`final DoubleWithUnit y`

Y coordinate of the point.

SizeWithUnit
`class SizeWithUnit`

SizeWithUnit(width, height)
``` SizeWithUnit(DoubleWithUnit width,
DoubleWithUnit height)```

Construct a new size with unit.

width
`DoubleWithUnit get width`

The width.

height
`DoubleWithUnit get height`

The height.

SizeWithAspect
`class SizeWithAspect`

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

SizeWithAspect(size, aspect)
``` SizeWithAspect(DoubleWithUnit size,
double aspect)```

Construct a new size with aspect.

size
`DoubleWithUnit get size`

The size of one dimension.

aspect
`double get aspect`

The aspect ratio for the other dimension.

DoubleWithUnit
`class DoubleWithUnit`

Holds a floating-point value plus a measure unit.

DoubleWithUnit(value, unit)
```DoubleWithUnit(double value,
MeasureUnit unit)```

Construct a new float with unit.

value
`final double value`

unit
`final MeasureUnit unit`

MarginsWithUnit
`class MarginsWithUnit`

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

MarginsWithUnit(left, top, right, bottom)
``` MarginsWithUnit(DoubleWithUnit left,
DoubleWithUnit top,
DoubleWithUnit right,
DoubleWithUnit bottom)```

Constructs a new MarginsWithUnit instance.

left
`final DoubleWithUnit left`

Left margin.

right
`final DoubleWithUnit right`

Right margin.

top
`final DoubleWithUnit top`

Top margin.

bottom
`final DoubleWithUnit bottom`

Bottom margin.

`class Quadrilateral`

Polygon represented by 4 corners.

``` Quadrilateral(Point topLeft,
Point topRight,
Point bottomRight,
Point bottomLeft)```

topLeft
`Point get topLeft`

topRight
`Point get topRight`

bottomRight
`Point get bottomRight`

bottomLeft
`Point get bottomLeft`

Size
`class Size`

Size(width, height)
``` Size(double width,
double height)```

width
`double get width`

The width.

height
`double get height`

The height.

SizeWithUnitAndAspect
`class SizeWithUnitAndAspect`

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

SizeWithUnitAndAspect.widthAndHeight(widthAndHeight)
`SizeWithUnitAndAspect.widthAndHeight(SizeWithUnit widthAndHeight)`

Creates a rectangular size based on the given size.

SizeWithUnitAndAspect.widthAndAspectRatio(width, aspectRatio)
```SizeWithUnitAndAspect.widthAndAspectRatio(
DoubleWithUnit width,
double aspectRatio)```

Creates a rectangular size based on the given width and aspect ratio.

SizeWithUnitAndAspect.heightAndAspectRatio(height, aspectRatio)
```SizeWithUnitAndAspect.heightAndAspectRatio(
DoubleWithUnit height,
double aspectRatio)```

Creates a rectangular size based on the given height and aspect ratio.

SizeWithUnitAndAspect.shorterDimensionAndAspectRatio(fraction, aspectRatio)
```SizeWithUnitAndAspect.shorterDimensionAndAspectRatio(
double fraction,
double aspectRatio)```

Creates a rectangular size based on the given shorter dimension and aspect ratio.

widthAndHeight
`SizeWithUnit? get widthAndHeight`

The values for width and height.

Note

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

widthAndAspectRatio
`SizeWithAspect? get widthAndAspectRatio`

The value for width and the aspect ratio for height.

Note

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

heightAndAspectRatio
`SizeWithAspect? get heightAndAspectRatio`

The value for height and the aspect ratio for width.

Note

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

shorterDimensionAndAspectRatio
`SizeWithAspect? get shorterDimensionAndAspectRatio`

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
`SizingMode get sizingMode`

The sizing mode.

## Misc Types

Defined in library scandit_datacapture_core

Defined in library scandit_datacapture_core

EncodingRange
`class EncodingRange`

Defines the encoding of a range of bytes.

EncodingRange(ianaName, startIndex, endIndex)
``` EncodingRange(String ianaName,
int startIndex,
int endIndex)```

Construct a new encoding range.

ianaName
`String get ianaName`

Charset encoding name as defined by IANA.

startIndex
`int get startIndex`

Start index of this encoding range.

endIndex
`int get endIndex`

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

Defined in library scandit_datacapture_core

Orientation

unknown

portrait

portraitUpsideDown