# Common Data Structures#

## Geometric Types#

Defined in namespace Scandit.DataCapture.Core.Geometry

`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 FloatWithUnit to determine the width and a float multiplier to determine the height.

`HeightAndAspectRatio`#

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

`ShorterDimensionAndAspectRatio`#

This value will use a FloatWithUnit 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()`#
``Point`(`float` x, `float` y)`

Construct a new point at position x and y.

`X`#
``float` `X` { get; }`

X coordinate of the point.

`Y`#
``float` `Y` { get; }`

Y coordinate of the point.

`PointWithUnit`#
``class PointWithUnit``

`PointWithUnit()`#
``PointWithUnit`(FloatWithUnit x, FloatWithUnit y)`

Construct a new point at position x and y.

`X`#
`FloatWithUnit `X` { get; }`

X coordinate of the point.

`Y`#
`FloatWithUnit `Y` { get; }`

Y coordinate of the point.

`Rect`#
``class Rect``

`Rect()`#
``Rect`(Point origin, Size2 size)`

Construct a new rectangle.

`Origin`#
`Point `Origin` { get; }`

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

`Size`#
`Size2 `Size` { get; }`

The size of the rectangle.

`RectWithUnit`#
``class RectWithUnit``

`RectWithUnit()`#
``RectWithUnit`(PointWithUnit origin, SizeWithUnit size)`

Construct a new rectangle with unit.

`Origin`#
`PointWithUnit `Origin` { get; }`

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

`Size`#
`SizeWithUnit `Size` { get; }`

The size of the rectangle.

`Size2`#
``class Size2``

`Size2()`#
``Size2`(`float` width, `float` height)`

Construct a new Size2 instance.

`Width`#
``float` `Width` { get; }`

The width.

`Height`#
``float` `Height` { get; }`

The height.

`SizeWithUnit`#
``class SizeWithUnit``

`SizeWithUnit()`#
``SizeWithUnit`(FloatWithUnit width, FloatWithUnit height)`

Construct a new size with unit.

`Width`#
`FloatWithUnit `Width` { get; }`

The width.

`Height`#
`FloatWithUnit `Height` { get; }`

The height.

`SizeWithAspect`#
``class SizeWithAspect``

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

`SizeWithAspect()`#
``SizeWithAspect`(FloatWithUnit size, `float` aspect)`

Construct a new size with aspect.

`Size`#
`FloatWithUnit `Size` { get; }`

The size of one dimension.

`Aspect`#
``float` `Aspect` { get; }`

The aspect ratio for the other dimension.

`FloatWithUnit`#
``class FloatWithUnit``

Holds a floating-point value plus a measure unit.

`FloatWithUnit()`#
``FloatWithUnit`(`float` value, MeasureUnit unit)`

Construct a new float with unit.

`Value`#
``float` `Value` { get; }`

`Unit`#
`MeasureUnit `Unit` { get; }`

`MarginsWithUnit`#
``class MarginsWithUnit``

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

`MarginsWithUnit()`#
``MarginsWithUnit`(FloatWithUnit left, FloatWithUnit top, FloatWithUnit right, FloatWithUnit bottom)`

Constructs a new MarginsWithUnit instance.

`Left`#
`FloatWithUnit `Left` { get; }`

Left margin.

`Right`#
`FloatWithUnit `Right` { get; }`

Right margin.

`Top`#
`FloatWithUnit `Top` { get; }`

Top margin.

`Bottom`#
`FloatWithUnit `Bottom` { get; }`

Bottom margin.

`Quadrilateral`#
``class Quadrilateral``

Polygon represented by 4 corners.

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

`TopLeft`#
`Point `TopLeft` { get; }`

`TopRight`#
`Point `TopRight` { get; }`

`BottomRight`#
`Point `BottomRight` { get; }`

`BottomLeft`#
`Point `BottomLeft` { get; }`

`SizeWithUnitAndAspect`#
``class SizeWithUnitAndAspect``

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

`WidthAndHeight`#
`SizeWithUnit `WidthAndHeight` { get; }`

The values for width and height.

Note

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

`WidthAndAspectRatio`#
`SizeWithAspect `WidthAndAspectRatio` { get; }`

The value for width and the aspect ratio for height.

Note

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

`HeightAndAspectRatio`#
`SizeWithAspect `HeightAndAspectRatio` { get; }`

The value for height and the aspect ratio for width.

Note

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

`ShorterDimensionAndAspectRatio`#
`SizeWithAspect `ShorterDimensionAndAspectRatio` { get; }`

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 `SizingMode` { get; }`

The sizing mode.

`ToJson()`#
``string` `ToJson`()`

## Misc Types#

Defined in namespace Scandit.DataCapture.Core.Common.Async

`ICallback`#
``interface ICallback``

Interface for a callback/callable accepting a generic parameter of type T.

`Run()`#
``void` `Run`(Object value)`

Called when the callback is invoked.

Defined in namespace Scandit.DataCapture.Core.Common.Buffer

`EncodingRange`#
``class EncodingRange``

Defines the encoding of a range of bytes.

`EncodingRange()`#
``EncodingRange`(`string` ianaName, `int` startIndex, `int` endIndex)`

Construct a new encoding range.

`IanaName`#
``string` `IanaName` { get; }`

Charset encoding name as defined by IANA.

`StartIndex`#
``int` `StartIndex` { get; }`

`EndIndex`#
``int` `EndIndex` { get; }`