pixbeam 0.0.0-stage → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +88 -2
- package/dist/chunks/chunk-EYV5XLLF.js +1801 -0
- package/dist/config.d.ts +16 -0
- package/dist/core/constants.d.ts +13 -0
- package/dist/core/cpu-source.d.ts +17 -0
- package/dist/core/crc32.d.ts +2 -0
- package/dist/core/decode.d.ts +8 -0
- package/dist/core/detect.d.ts +11 -0
- package/dist/core/diagnostics.d.ts +49 -0
- package/dist/core/fountain.d.ts +30 -0
- package/dist/core/homography.d.ts +4 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/layout.d.ts +41 -0
- package/dist/core/packets.d.ts +16 -0
- package/dist/core/prng.d.ts +1 -0
- package/dist/core/receiver.d.ts +68 -0
- package/dist/core/render.d.ts +2 -0
- package/dist/core/source.d.ts +9 -0
- package/dist/core/symbols.d.ts +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +171 -0
- package/dist/react/Pixbeam.d.ts +7 -0
- package/dist/react/ReceiveView.d.ts +7 -0
- package/dist/react/SendView.d.ts +7 -0
- package/dist/react/Stats.d.ts +3 -0
- package/dist/react/format.d.ts +3 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.js +503 -0
- package/dist/style.css +67 -0
- package/dist/web/auto-zoom.d.ts +28 -0
- package/dist/web/camera-control.d.ts +25 -0
- package/dist/web/compress.d.ts +2 -0
- package/dist/web/debug-panel.d.ts +17 -0
- package/dist/web/gl-source.d.ts +27 -0
- package/dist/web/index.d.ts +7 -0
- package/dist/web/scanner.d.ts +68 -0
- package/dist/web/sender.d.ts +35 -0
- package/dist/web/wake-lock.d.ts +2 -0
- package/package.json +74 -3
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Bits } from './core/index.js';
|
|
2
|
+
import { Orientation } from './web/sender.js';
|
|
3
|
+
export interface PixbeamConfig {
|
|
4
|
+
debug: boolean;
|
|
5
|
+
testPattern: boolean;
|
|
6
|
+
defaultPreset: string;
|
|
7
|
+
defaultBits: Bits;
|
|
8
|
+
defaultFps: number;
|
|
9
|
+
defaultOrientation: Orientation;
|
|
10
|
+
maxFps: number;
|
|
11
|
+
cameraFps: number;
|
|
12
|
+
autoZoom: boolean;
|
|
13
|
+
lockExposure: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare const defaultConfig: PixbeamConfig;
|
|
16
|
+
export declare function resolveConfig(overrides?: Partial<PixbeamConfig>): PixbeamConfig;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type RGB = [number, number, number];
|
|
2
|
+
export declare const HEADER_SIZE = 18;
|
|
3
|
+
export declare const TARGET_PACKET = 240;
|
|
4
|
+
export declare const BIT_MODES: readonly [3, 2, 1];
|
|
5
|
+
export type Bits = (typeof BIT_MODES)[number];
|
|
6
|
+
export interface Preset {
|
|
7
|
+
id: string;
|
|
8
|
+
w: number;
|
|
9
|
+
h: number;
|
|
10
|
+
u: number;
|
|
11
|
+
}
|
|
12
|
+
export declare const PRESETS: Preset[];
|
|
13
|
+
export declare const PALETTES: Record<Bits, RGB[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FrameSource, Patch } from './receiver.js';
|
|
2
|
+
export declare class CpuSource implements FrameSource {
|
|
3
|
+
readonly rgba: Uint8Array | Uint8ClampedArray;
|
|
4
|
+
readonly width: number;
|
|
5
|
+
readonly height: number;
|
|
6
|
+
constructor(rgba: Uint8Array | Uint8ClampedArray, width: number, height: number);
|
|
7
|
+
small(maxWidth: number): {
|
|
8
|
+
data: Uint8Array<ArrayBuffer>;
|
|
9
|
+
w: number;
|
|
10
|
+
h: number;
|
|
11
|
+
scale: number;
|
|
12
|
+
};
|
|
13
|
+
region(x: number, y: number, w: number, h: number): Uint8Array<ArrayBuffer>;
|
|
14
|
+
rectify(patches: Patch[], w: number, h: number): Uint8Array<ArrayBuffer>;
|
|
15
|
+
private rectifyPatch;
|
|
16
|
+
private bilinear;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Layout } from './layout.js';
|
|
2
|
+
import { Packet } from './packets.js';
|
|
3
|
+
export interface DecodeResult {
|
|
4
|
+
packets: Packet[];
|
|
5
|
+
expected: number;
|
|
6
|
+
symbols: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export declare function decodeCells(layout: Layout, cells: Uint8Array, maxPackets?: number): DecodeResult;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Point } from './homography.js';
|
|
2
|
+
export interface Marker {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
size: number;
|
|
6
|
+
hits: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function binarize(rgba: Uint8Array | Uint8ClampedArray, w: number, h: number): Uint8Array;
|
|
9
|
+
export declare function findMarkers(bin: Uint8Array, w: number, h: number): Marker[];
|
|
10
|
+
export declare function pickCorners(markers: Marker[]): Marker[] | null;
|
|
11
|
+
export declare function refineMarker(rgba: Uint8Array, w: number, h: number, guess: Point, size: number, mid?: number, reachFactor?: number): Marker | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DecodeResult } from './decode.js';
|
|
2
|
+
import { Layout } from './layout.js';
|
|
3
|
+
import { PacketSource } from './packets.js';
|
|
4
|
+
export declare const TEST_FILE_ID = 3736100864;
|
|
5
|
+
export declare class TestPattern implements PacketSource {
|
|
6
|
+
private seed;
|
|
7
|
+
readonly fileId = 3736100864;
|
|
8
|
+
readonly totalSize = 0;
|
|
9
|
+
constructor(seed?: number);
|
|
10
|
+
next(out: Uint8Array): number;
|
|
11
|
+
}
|
|
12
|
+
export type ErrorMode = 'exact' | 'packet';
|
|
13
|
+
export interface ErrorSummary {
|
|
14
|
+
mode: ErrorMode;
|
|
15
|
+
frames: number;
|
|
16
|
+
measuredFrames: number;
|
|
17
|
+
cellErrorRate: number;
|
|
18
|
+
shiftShare: number;
|
|
19
|
+
directionBias: number;
|
|
20
|
+
concentration: number;
|
|
21
|
+
centerRate: number;
|
|
22
|
+
edgeRate: number;
|
|
23
|
+
worstRegion: string;
|
|
24
|
+
confusions: {
|
|
25
|
+
from: number;
|
|
26
|
+
to: number;
|
|
27
|
+
rate: number;
|
|
28
|
+
}[];
|
|
29
|
+
hint: string;
|
|
30
|
+
}
|
|
31
|
+
export declare class ErrorMap {
|
|
32
|
+
readonly layout: Layout;
|
|
33
|
+
readonly errors: Uint32Array;
|
|
34
|
+
readonly samples: Uint32Array;
|
|
35
|
+
readonly confusion: Uint32Array;
|
|
36
|
+
private shiftErrors;
|
|
37
|
+
private totalErrors;
|
|
38
|
+
private directions;
|
|
39
|
+
private expectedGrid;
|
|
40
|
+
frames: number;
|
|
41
|
+
measuredFrames: number;
|
|
42
|
+
mode: ErrorMode;
|
|
43
|
+
constructor(layout: Layout);
|
|
44
|
+
add(result: DecodeResult): void;
|
|
45
|
+
rate(idx: number): number;
|
|
46
|
+
summary(names: string[]): ErrorSummary;
|
|
47
|
+
private addExact;
|
|
48
|
+
private addPacketLevel;
|
|
49
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare function neighbors(seed: number, k: number): number[];
|
|
2
|
+
export declare class FountainEncoder {
|
|
3
|
+
readonly source: Uint8Array;
|
|
4
|
+
readonly blockSize: number;
|
|
5
|
+
readonly blockCount: number;
|
|
6
|
+
readonly fileId: number;
|
|
7
|
+
private data;
|
|
8
|
+
private seed;
|
|
9
|
+
get totalSize(): number;
|
|
10
|
+
constructor(source: Uint8Array, blockSize: number);
|
|
11
|
+
next(out: Uint8Array): number;
|
|
12
|
+
}
|
|
13
|
+
export declare class FountainDecoder {
|
|
14
|
+
readonly fileId: number;
|
|
15
|
+
readonly totalSize: number;
|
|
16
|
+
readonly blockSize: number;
|
|
17
|
+
readonly blockCount: number;
|
|
18
|
+
known: number;
|
|
19
|
+
received: number;
|
|
20
|
+
private blocks;
|
|
21
|
+
private seen;
|
|
22
|
+
private pending;
|
|
23
|
+
private index;
|
|
24
|
+
constructor(fileId: number, totalSize: number, blockSize: number);
|
|
25
|
+
get done(): boolean;
|
|
26
|
+
add(seed: number, payload: Uint8Array): void;
|
|
27
|
+
result(): Uint8Array;
|
|
28
|
+
private resolve;
|
|
29
|
+
}
|
|
30
|
+
export declare function estimatePackets(blockCount: number): number;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './constants.js';
|
|
2
|
+
export * from './crc32.js';
|
|
3
|
+
export * from './layout.js';
|
|
4
|
+
export * from './source.js';
|
|
5
|
+
export * from './fountain.js';
|
|
6
|
+
export * from './packets.js';
|
|
7
|
+
export * from './render.js';
|
|
8
|
+
export * from './homography.js';
|
|
9
|
+
export * from './detect.js';
|
|
10
|
+
export * from './decode.js';
|
|
11
|
+
export * from './receiver.js';
|
|
12
|
+
export * from './cpu-source.js';
|
|
13
|
+
export * from './diagnostics.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Bits, Preset, RGB } from './constants.js';
|
|
2
|
+
export type CellOrder = 'rows' | 'cols';
|
|
3
|
+
export interface Alignment {
|
|
4
|
+
row: number;
|
|
5
|
+
col: number;
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
}
|
|
11
|
+
export interface Mesh {
|
|
12
|
+
xs: number[];
|
|
13
|
+
ys: number[];
|
|
14
|
+
alignments: Alignment[];
|
|
15
|
+
unit: number;
|
|
16
|
+
size: number;
|
|
17
|
+
}
|
|
18
|
+
export interface Layout {
|
|
19
|
+
preset: Preset;
|
|
20
|
+
bits: Bits;
|
|
21
|
+
order: CellOrder;
|
|
22
|
+
w: number;
|
|
23
|
+
h: number;
|
|
24
|
+
u: number;
|
|
25
|
+
zone: number;
|
|
26
|
+
quiet: number;
|
|
27
|
+
totalW: number;
|
|
28
|
+
totalH: number;
|
|
29
|
+
palette: RGB[];
|
|
30
|
+
dataCells: Int32Array;
|
|
31
|
+
topPalette: Int32Array;
|
|
32
|
+
bottomPalette: Int32Array;
|
|
33
|
+
cellCount: number;
|
|
34
|
+
capacity: number;
|
|
35
|
+
packetSize: number;
|
|
36
|
+
packetsPerFrame: number;
|
|
37
|
+
whitening: Uint8Array;
|
|
38
|
+
markerCenters: [number, number][];
|
|
39
|
+
mesh: Mesh;
|
|
40
|
+
}
|
|
41
|
+
export declare function getLayout(preset: Preset, bits: Bits, order?: CellOrder): Layout;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Layout } from './layout.js';
|
|
2
|
+
export interface PacketSource {
|
|
3
|
+
readonly fileId: number;
|
|
4
|
+
readonly totalSize: number;
|
|
5
|
+
next(out: Uint8Array): number;
|
|
6
|
+
}
|
|
7
|
+
export interface Packet {
|
|
8
|
+
index: number;
|
|
9
|
+
fileId: number;
|
|
10
|
+
totalSize: number;
|
|
11
|
+
blockSize: number;
|
|
12
|
+
seed: number;
|
|
13
|
+
data: Uint8Array;
|
|
14
|
+
}
|
|
15
|
+
export declare function encodeFrame(layout: Layout, enc: PacketSource): Uint8Array;
|
|
16
|
+
export declare function parsePackets(layout: Layout, bytes: Uint8Array, count: number): Packet[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mulberry32(seed: number): () => number;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Bits, Preset } from './constants.js';
|
|
2
|
+
import { DecodeResult } from './decode.js';
|
|
3
|
+
import { FountainDecoder } from './fountain.js';
|
|
4
|
+
import { Matrix3, Point } from './homography.js';
|
|
5
|
+
import { CellOrder, Layout } from './layout.js';
|
|
6
|
+
export interface FrameSource {
|
|
7
|
+
readonly width: number;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
small(maxWidth: number): {
|
|
10
|
+
data: Uint8Array;
|
|
11
|
+
w: number;
|
|
12
|
+
h: number;
|
|
13
|
+
scale: number;
|
|
14
|
+
};
|
|
15
|
+
region(x: number, y: number, w: number, h: number): Uint8Array;
|
|
16
|
+
rectify(patches: Patch[], w: number, h: number): Uint8Array;
|
|
17
|
+
}
|
|
18
|
+
export interface Patch {
|
|
19
|
+
h: Matrix3;
|
|
20
|
+
x0: number;
|
|
21
|
+
y0: number;
|
|
22
|
+
x1: number;
|
|
23
|
+
y1: number;
|
|
24
|
+
}
|
|
25
|
+
export interface MeshResult {
|
|
26
|
+
patches: Patch[];
|
|
27
|
+
nodes: Point[];
|
|
28
|
+
found: number;
|
|
29
|
+
total: number;
|
|
30
|
+
}
|
|
31
|
+
export interface Lock {
|
|
32
|
+
preset: Preset;
|
|
33
|
+
bits: Bits;
|
|
34
|
+
order: CellOrder;
|
|
35
|
+
rotation: number;
|
|
36
|
+
}
|
|
37
|
+
export interface FrameReport {
|
|
38
|
+
corners: Point[] | null;
|
|
39
|
+
tracked: boolean;
|
|
40
|
+
lock: Lock | null;
|
|
41
|
+
packets: number;
|
|
42
|
+
expected: number;
|
|
43
|
+
finished: boolean;
|
|
44
|
+
decoded?: DecodeResult;
|
|
45
|
+
layout?: Layout;
|
|
46
|
+
alignment?: {
|
|
47
|
+
nodes: Point[];
|
|
48
|
+
found: number;
|
|
49
|
+
total: number;
|
|
50
|
+
};
|
|
51
|
+
cellPx?: number;
|
|
52
|
+
}
|
|
53
|
+
export declare class Receiver {
|
|
54
|
+
decoder: FountainDecoder | null;
|
|
55
|
+
lock: Lock | null;
|
|
56
|
+
validPackets: number;
|
|
57
|
+
expectedPackets: number;
|
|
58
|
+
useAlignment: boolean;
|
|
59
|
+
private ring;
|
|
60
|
+
private misses;
|
|
61
|
+
private offsets;
|
|
62
|
+
reset(): void;
|
|
63
|
+
process(src: FrameSource): FrameReport;
|
|
64
|
+
private detect;
|
|
65
|
+
private refineAll;
|
|
66
|
+
private search;
|
|
67
|
+
private mesh;
|
|
68
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SourceInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
compressed: boolean;
|
|
4
|
+
originalSize: number;
|
|
5
|
+
originalCrc: number;
|
|
6
|
+
payload: Uint8Array;
|
|
7
|
+
}
|
|
8
|
+
export declare function packSource(name: string, payload: Uint8Array, compressed: boolean, original: Uint8Array): Uint8Array;
|
|
9
|
+
export declare function unpackSource(src: Uint8Array): SourceInfo;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutoZoom,
|
|
3
|
+
BIT_MODES,
|
|
4
|
+
CameraControl,
|
|
5
|
+
DebugPanel,
|
|
6
|
+
ErrorMap,
|
|
7
|
+
FountainDecoder,
|
|
8
|
+
FountainEncoder,
|
|
9
|
+
GlSource,
|
|
10
|
+
HEADER_SIZE,
|
|
11
|
+
PALETTES,
|
|
12
|
+
PRESETS,
|
|
13
|
+
Receiver,
|
|
14
|
+
Scanner,
|
|
15
|
+
Sender,
|
|
16
|
+
TARGET_PACKET,
|
|
17
|
+
TEST_FILE_ID,
|
|
18
|
+
TestPattern,
|
|
19
|
+
__publicField,
|
|
20
|
+
binarize,
|
|
21
|
+
crc32,
|
|
22
|
+
crc32Parts,
|
|
23
|
+
decodeCells,
|
|
24
|
+
defaultConfig,
|
|
25
|
+
deflate,
|
|
26
|
+
encodeFrame,
|
|
27
|
+
estimatePackets,
|
|
28
|
+
findMarkers,
|
|
29
|
+
getLayout,
|
|
30
|
+
homography,
|
|
31
|
+
inflate,
|
|
32
|
+
neighbors,
|
|
33
|
+
packSource,
|
|
34
|
+
parsePackets,
|
|
35
|
+
pickCorners,
|
|
36
|
+
project,
|
|
37
|
+
refineMarker,
|
|
38
|
+
renderFrame,
|
|
39
|
+
resolveConfig,
|
|
40
|
+
unpackSource
|
|
41
|
+
} from "./chunks/chunk-EYV5XLLF.js";
|
|
42
|
+
|
|
43
|
+
// src/core/cpu-source.ts
|
|
44
|
+
var TAP = 0.22;
|
|
45
|
+
var TAPS = [[0, 0], [TAP, 0], [-TAP, 0], [0, TAP], [0, -TAP]];
|
|
46
|
+
var CpuSource = class {
|
|
47
|
+
constructor(rgba, width, height) {
|
|
48
|
+
__publicField(this, "rgba", rgba);
|
|
49
|
+
__publicField(this, "width", width);
|
|
50
|
+
__publicField(this, "height", height);
|
|
51
|
+
}
|
|
52
|
+
small(maxWidth) {
|
|
53
|
+
const scale = Math.max(1, Math.ceil(this.width / maxWidth));
|
|
54
|
+
const w = Math.floor(this.width / scale);
|
|
55
|
+
const h = Math.floor(this.height / scale);
|
|
56
|
+
const out = new Uint8Array(w * h * 4);
|
|
57
|
+
const n = scale * scale;
|
|
58
|
+
for (let y = 0; y < h; y++) {
|
|
59
|
+
for (let x = 0; x < w; x++) {
|
|
60
|
+
let r = 0;
|
|
61
|
+
let g = 0;
|
|
62
|
+
let b = 0;
|
|
63
|
+
for (let dy = 0; dy < scale; dy++) {
|
|
64
|
+
for (let dx = 0; dx < scale; dx++) {
|
|
65
|
+
const i = ((y * scale + dy) * this.width + x * scale + dx) * 4;
|
|
66
|
+
r += this.rgba[i];
|
|
67
|
+
g += this.rgba[i + 1];
|
|
68
|
+
b += this.rgba[i + 2];
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const o = (y * w + x) * 4;
|
|
72
|
+
out[o] = r / n;
|
|
73
|
+
out[o + 1] = g / n;
|
|
74
|
+
out[o + 2] = b / n;
|
|
75
|
+
out[o + 3] = 255;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return { data: out, w, h, scale };
|
|
79
|
+
}
|
|
80
|
+
region(x, y, w, h) {
|
|
81
|
+
const out = new Uint8Array(w * h * 4);
|
|
82
|
+
for (let r = 0; r < h; r++) out.set(this.rgba.subarray(((y + r) * this.width + x) * 4, ((y + r) * this.width + x + w) * 4), r * w * 4);
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
rectify(patches, w, h) {
|
|
86
|
+
const out = new Uint8Array(w * h * 4);
|
|
87
|
+
for (const p of patches) this.rectifyPatch(out, p.h, w, p.x0, p.y0, p.x1, p.y1);
|
|
88
|
+
return out;
|
|
89
|
+
}
|
|
90
|
+
rectifyPatch(out, m, w, x0, y0, x1, y1) {
|
|
91
|
+
for (let r = y0; r < y1; r++) {
|
|
92
|
+
for (let c = x0; c < x1; c++) {
|
|
93
|
+
let sr = 0;
|
|
94
|
+
let sg = 0;
|
|
95
|
+
let sb = 0;
|
|
96
|
+
for (const [du, dv] of TAPS) {
|
|
97
|
+
const u = c + 0.5 + du;
|
|
98
|
+
const v = r + 0.5 + dv;
|
|
99
|
+
const d = m[6] * u + m[7] * v + m[8];
|
|
100
|
+
const [pr, pg, pb] = this.bilinear((m[0] * u + m[1] * v + m[2]) / d, (m[3] * u + m[4] * v + m[5]) / d);
|
|
101
|
+
sr += pr;
|
|
102
|
+
sg += pg;
|
|
103
|
+
sb += pb;
|
|
104
|
+
}
|
|
105
|
+
const o = (r * w + c) * 4;
|
|
106
|
+
out[o] = sr / TAPS.length;
|
|
107
|
+
out[o + 1] = sg / TAPS.length;
|
|
108
|
+
out[o + 2] = sb / TAPS.length;
|
|
109
|
+
out[o + 3] = 255;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
bilinear(x, y) {
|
|
114
|
+
const x0 = Math.max(0, Math.min(this.width - 1, Math.floor(x)));
|
|
115
|
+
const y0 = Math.max(0, Math.min(this.height - 1, Math.floor(y)));
|
|
116
|
+
const x1 = Math.min(this.width - 1, x0 + 1);
|
|
117
|
+
const y1 = Math.min(this.height - 1, y0 + 1);
|
|
118
|
+
const fx = Math.max(0, Math.min(1, x - x0));
|
|
119
|
+
const fy = Math.max(0, Math.min(1, y - y0));
|
|
120
|
+
const out = [0, 0, 0];
|
|
121
|
+
for (let ch = 0; ch < 3; ch++) {
|
|
122
|
+
const a = this.rgba[(y0 * this.width + x0) * 4 + ch];
|
|
123
|
+
const b = this.rgba[(y0 * this.width + x1) * 4 + ch];
|
|
124
|
+
const c = this.rgba[(y1 * this.width + x0) * 4 + ch];
|
|
125
|
+
const d = this.rgba[(y1 * this.width + x1) * 4 + ch];
|
|
126
|
+
out[ch] = (a * (1 - fx) + b * fx) * (1 - fy) + (c * (1 - fx) + d * fx) * fy;
|
|
127
|
+
}
|
|
128
|
+
return out;
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
export {
|
|
132
|
+
AutoZoom,
|
|
133
|
+
BIT_MODES,
|
|
134
|
+
CameraControl,
|
|
135
|
+
CpuSource,
|
|
136
|
+
DebugPanel,
|
|
137
|
+
ErrorMap,
|
|
138
|
+
FountainDecoder,
|
|
139
|
+
FountainEncoder,
|
|
140
|
+
GlSource,
|
|
141
|
+
HEADER_SIZE,
|
|
142
|
+
PALETTES,
|
|
143
|
+
PRESETS,
|
|
144
|
+
Receiver,
|
|
145
|
+
Scanner,
|
|
146
|
+
Sender,
|
|
147
|
+
TARGET_PACKET,
|
|
148
|
+
TEST_FILE_ID,
|
|
149
|
+
TestPattern,
|
|
150
|
+
binarize,
|
|
151
|
+
crc32,
|
|
152
|
+
crc32Parts,
|
|
153
|
+
decodeCells,
|
|
154
|
+
defaultConfig,
|
|
155
|
+
deflate,
|
|
156
|
+
encodeFrame,
|
|
157
|
+
estimatePackets,
|
|
158
|
+
findMarkers,
|
|
159
|
+
getLayout,
|
|
160
|
+
homography,
|
|
161
|
+
inflate,
|
|
162
|
+
neighbors,
|
|
163
|
+
packSource,
|
|
164
|
+
parsePackets,
|
|
165
|
+
pickCorners,
|
|
166
|
+
project,
|
|
167
|
+
refineMarker,
|
|
168
|
+
renderFrame,
|
|
169
|
+
resolveConfig,
|
|
170
|
+
unpackSource
|
|
171
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PixbeamConfig } from '../config.js';
|
|
2
|
+
export interface PixbeamProps {
|
|
3
|
+
config?: Partial<PixbeamConfig>;
|
|
4
|
+
heading?: string;
|
|
5
|
+
intro?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function Pixbeam({ config: overrides, heading, intro }: PixbeamProps): import("react").JSX.Element;
|