UNPKG

893 BPlain TextView Raw
1/**
2 * A configuration object to define the properties of an image to be scanned.
3 */
4export interface ImageSettings {
5 /**
6 * The width of the image (columns of pixels).
7 */
8 readonly width: number;
9 /**
10 * The height of the image (rows of pixels).
11 */
12 readonly height: number;
13 /**
14 * The format of the pixel data, meaning the mapping of array bytes to image pixels.
15 */
16 readonly format: ImageSettings.Format;
17}
18
19export namespace ImageSettings {
20 // Warning: the values of Format are important as the engine web worker relies on them without type checking.
21 /**
22 * Image bytes format/layout.
23 */
24 export enum Format {
25 /**
26 * Single-channel 8-bit gray scale image.
27 */
28 GRAY_8U = 0,
29 /**
30 * RGB image with 8 bits per color channel.
31 */
32 RGB_8U = 1,
33 /**
34 * RGBA image with 8 bits per color channel.
35 */
36 RGBA_8U = 2
37 }
38}