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/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 devsejenak
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Pixbeam
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Send files from your screen to your phone through the camera. No internet, no cables, no app.
|
|
4
|
+
|
|
5
|
+
Open it on the browser, pick a file, and point your phone's camera at the screen. The file plays as animated color codes, and the phone rebuilds it from what it sees. Everything runs in the browser and nothing leaves your devices.
|
|
6
|
+
|
|
7
|
+
Try it: [tools.devsejenak.com/pixbeam](https://tools.devsejenak.com/pixbeam)
|
|
8
|
+
|
|
9
|
+
## How it works
|
|
10
|
+
|
|
11
|
+
1. The file is compressed, split into blocks, and encoded with a fountain code (LT), so the phone can rebuild it from any frames it catches.
|
|
12
|
+
2. Each packet gets a header and a CRC32, then is drawn as colored cells (1, 2, or 3 bits per cell).
|
|
13
|
+
3. Every frame has corner markers, alignment markers, and a color palette row for calibration.
|
|
14
|
+
4. The receiver tracks the markers, straightens the image on the GPU (WebGL2), reads the colors, checks the CRC, and assembles the file.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install pixbeam
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The React component needs `react` and `react-dom` 18 or newer.
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
```tsx
|
|
27
|
+
import { Pixbeam } from 'pixbeam/react'
|
|
28
|
+
import 'pixbeam/style.css'
|
|
29
|
+
|
|
30
|
+
export default function App() {
|
|
31
|
+
return <Pixbeam />
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This gives you the full send and receive UI. Use `#kirim` (send) or `#terima` (receive) in the URL to open a tab directly. The built-in UI text is currently in Indonesian.
|
|
36
|
+
|
|
37
|
+
### Props
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Description |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `config` | `Partial<PixbeamConfig>` | Override the defaults below |
|
|
42
|
+
| `heading` | `string` | Optional title above the UI |
|
|
43
|
+
| `intro` | `string` | Optional text under the title |
|
|
44
|
+
|
|
45
|
+
### Config
|
|
46
|
+
|
|
47
|
+
| Option | Default | Description |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `defaultPreset` | `'320x180'` | Starting grid size in cells, from `'128x72'` to `'320x180'` |
|
|
50
|
+
| `defaultBits` | `1` | Starting bits per cell (1, 2, or 3). Higher is faster but needs a better camera |
|
|
51
|
+
| `defaultFps` | `20` | Starting frames per second when sending |
|
|
52
|
+
| `maxFps` | `30` | Highest FPS the user can pick |
|
|
53
|
+
| `defaultOrientation` | `'portrait'` | `'portrait'` or `'landscape'` |
|
|
54
|
+
| `cameraFps` | `30` | Requested camera frame rate |
|
|
55
|
+
| `autoZoom` | `true` | Auto zoom starts on (when the camera supports it) |
|
|
56
|
+
| `lockExposure` | `true` | Exposure lock starts on, for steadier colors |
|
|
57
|
+
| `debug` | `false` | Show the debug panel on the receiver |
|
|
58
|
+
| `testPattern` | `false` | Add a test pattern option to the sender |
|
|
59
|
+
|
|
60
|
+
Settings marked "starting" can still be changed by the user in the UI.
|
|
61
|
+
|
|
62
|
+
The camera only works over HTTPS or on localhost.
|
|
63
|
+
|
|
64
|
+
## Development
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pnpm install
|
|
68
|
+
pnpm dev # demo at http://localhost:5173
|
|
69
|
+
pnpm test # camera simulation in Node
|
|
70
|
+
pnpm typecheck
|
|
71
|
+
pnpm build # library to dist/
|
|
72
|
+
pnpm build:standalone # single-file dist/pixbeam.html
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
src/
|
|
77
|
+
core/ codec with no DOM (layout, fountain, packets, render, detect, decode, receiver)
|
|
78
|
+
web/ WebGL2 source, sender, camera scanner, auto zoom, debug panel
|
|
79
|
+
react/ <Pixbeam /> component and pixbeam.css
|
|
80
|
+
config.ts defaults and options
|
|
81
|
+
demo/ dev page (Vite)
|
|
82
|
+
test/ camera simulation
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Issues and pull requests are welcome.
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|