@zappar/zappar-cv 3.0.1-alpha.16 → 3.0.1-alpha.19
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/README.md +2 -2
- package/lib/additional.d.ts +1 -0
- package/lib/deserializer.d.ts +4 -1
- package/lib/deserializer.js +3 -0
- package/lib/drawaxis.js +4 -39
- package/lib/gen/zappar-bridge.d.ts +34 -10
- package/lib/gen/zappar-bridge.js +3 -0
- package/lib/gen/zappar-client.d.ts +1 -0
- package/lib/gen/zappar-client.js +238 -48
- package/lib/gen/zappar-cwrap.js +164 -38
- package/lib/gen/zappar-native.d.ts +46 -12
- package/lib/gen/zappar-native.js +23 -1
- package/lib/gen/zappar-server.d.ts +3 -0
- package/lib/gen/zappar-server.js +128 -28
- package/lib/gen/zappar.d.ts +41 -12
- package/lib/gen/zappar.js +3 -0
- package/lib/html-element-source.d.ts +1 -0
- package/lib/html-element-source.js +5 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/mstp-camera-source.js +2 -1
- package/lib/native.js +48 -4
- package/lib/permission.js +35 -9
- package/lib/pipeline.d.ts +1 -1
- package/lib/pipeline.js +3 -2
- package/lib/sequencesource.js +1 -1
- package/lib/serializer.d.ts +4 -1
- package/lib/serializer.js +3 -0
- package/lib/tr.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/worker-imagebitmap.js +1 -1
- package/lib/worker-server.js +2 -2
- package/lib/workerinterface.d.ts +1 -0
- package/lib/zappar-cv.js +1 -1
- package/lib/zappar-cv.wasm +0 -0
- package/package.json +1 -1
- package/umd/{6cf17bab4f58a189fc94.wasm → 3c548945c91fd14a0d90.wasm} +0 -0
- package/umd/751.zappar-cv.js +1 -1
- package/umd/867.zappar-cv.js +1 -1
- package/umd/zappar-cv.js +1 -1
- package/umd/zappar-cv.worker.js +1 -1
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ npm i @zappar/zappar-cv
|
|
|
18
18
|
|
|
19
19
|
You can use our CDN from within your HTML:
|
|
20
20
|
```
|
|
21
|
-
<script src="https://libs.zappar.com/zappar-cv/3.0.1-alpha.
|
|
21
|
+
<script src="https://libs.zappar.com/zappar-cv/3.0.1-alpha.19/zappar-cv.js"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Or you can download and host our standalone JavaScript bundle:
|
|
25
|
-
[https://libs.zappar.com/zappar-cv/3.0.1-alpha.
|
|
25
|
+
[https://libs.zappar.com/zappar-cv/3.0.1-alpha.19/zappar-cv.zip](https://libs.zappar.com/zappar-cv/3.0.1-alpha.19/zappar-cv.zip)
|
package/lib/additional.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export interface Additional {
|
|
|
15
15
|
pipeline_camera_frame_data_height(pipeline: zappar_pipeline_t): number;
|
|
16
16
|
draw_plane(gl: WebGLRenderingContext, projectionMatrix: Float32Array, cameraMatrix: Float32Array, targetMatrix: Float32Array, texture: string): void;
|
|
17
17
|
draw_grid(gl: WebGLRenderingContext, projectionMatrix: Float32Array, cameraMatrix: Float32Array, targetMatrix: Float32Array): void;
|
|
18
|
+
draw_axis(gl: WebGLRenderingContext, projectionMatrix: Float32Array, cameraMatrix: Float32Array, targetMatrix: Float32Array): void;
|
|
18
19
|
image_tracker_target_image(o: zappar_image_tracker_t, indx: number): HTMLImageElement | undefined;
|
|
19
20
|
face_mesh_load_default(o: zappar_face_mesh_t): Promise<void>;
|
|
20
21
|
face_mesh_load_default_face(o: zappar_face_mesh_t, fillMouth: boolean, fillEyeL: boolean, fillEyeR: boolean): Promise<void>;
|
package/lib/deserializer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { barcode_format_t, face_landmark_name_t, instant_world_tracker_transform_orientation_t, log_level_t } from "./gen/zappar-native";
|
|
1
|
+
import { barcode_format_t, face_landmark_name_t, instant_world_tracker_transform_orientation_t, transform_orientation_t, log_level_t, plane_orientation_t, anchor_status_t } from "./gen/zappar-native";
|
|
2
2
|
interface Message {
|
|
3
3
|
int: () => number;
|
|
4
4
|
float: () => number;
|
|
@@ -17,6 +17,9 @@ interface Message {
|
|
|
17
17
|
barcodeFormat: () => barcode_format_t;
|
|
18
18
|
faceLandmarkName: () => face_landmark_name_t;
|
|
19
19
|
instantTrackerTransformOrientation: () => instant_world_tracker_transform_orientation_t;
|
|
20
|
+
transformOrientation: () => transform_orientation_t;
|
|
21
|
+
planeOrientation: () => plane_orientation_t;
|
|
22
|
+
anchorStatus: () => anchor_status_t;
|
|
20
23
|
logLevel: () => log_level_t;
|
|
21
24
|
}
|
|
22
25
|
export declare class MessageDeserializer {
|
package/lib/deserializer.js
CHANGED
|
@@ -94,6 +94,9 @@ export class MessageDeserializer {
|
|
|
94
94
|
barcodeFormat: () => this._i32View[this._startOffset++],
|
|
95
95
|
faceLandmarkName: () => this._i32View[this._startOffset++],
|
|
96
96
|
instantTrackerTransformOrientation: () => this._i32View[this._startOffset++],
|
|
97
|
+
transformOrientation: () => this._i32View[this._startOffset++],
|
|
98
|
+
planeOrientation: () => this._i32View[this._startOffset++],
|
|
99
|
+
anchorStatus: () => this._i32View[this._startOffset++],
|
|
97
100
|
logLevel: () => this._i32View[this._startOffset++],
|
|
98
101
|
};
|
|
99
102
|
}
|
package/lib/drawaxis.js
CHANGED
|
@@ -16,9 +16,9 @@ function generate(gl) {
|
|
|
16
16
|
if (!vbo)
|
|
17
17
|
throw new Error("Unable to create buffer object");
|
|
18
18
|
let coords = [
|
|
19
|
-
0, 0, 0, 1, 0, 0,
|
|
20
|
-
0, 0, 0, 0, 1, 0,
|
|
21
|
-
0, 0, 0, 0, 0, 1
|
|
19
|
+
0, 0, 0, 0.1, 0, 0,
|
|
20
|
+
0, 0, 0, 0, 0.1, 0,
|
|
21
|
+
0, 0, 0, 0, 0, 0.1
|
|
22
22
|
];
|
|
23
23
|
gl.bindBuffer(gl.ARRAY_BUFFER, vbo);
|
|
24
24
|
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(coords), gl.STATIC_DRAW);
|
|
@@ -58,7 +58,7 @@ export function drawAxis(gl, projectionMatrix, cameraMatrix, targetMatrix) {
|
|
|
58
58
|
gl.bindBuffer(gl.ARRAY_BUFFER, uvbo);
|
|
59
59
|
gl.vertexAttribPointer(shader.attr_color, 4, gl.FLOAT, false, 4 * 4, 0);
|
|
60
60
|
gl.enableVertexAttribArray(shader.attr_color);
|
|
61
|
-
gl.lineWidth(
|
|
61
|
+
gl.lineWidth(2);
|
|
62
62
|
gl.drawArrays(gl.LINES, 0, 6);
|
|
63
63
|
gl.disableVertexAttribArray(shader.attr_position);
|
|
64
64
|
gl.disableVertexAttribArray(shader.attr_color);
|
|
@@ -135,38 +135,3 @@ function getShader(gl) {
|
|
|
135
135
|
};
|
|
136
136
|
return shader;
|
|
137
137
|
}
|
|
138
|
-
function loadTexture(gl, url) {
|
|
139
|
-
if (texturesByUrl[url])
|
|
140
|
-
return texturesByUrl[url];
|
|
141
|
-
let texture = gl.createTexture();
|
|
142
|
-
if (!texture)
|
|
143
|
-
throw new Error("Unable to create texture");
|
|
144
|
-
texturesByUrl[url] = texture;
|
|
145
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
146
|
-
// Because images have to be download over the internet
|
|
147
|
-
// they might take a moment until they are ready.
|
|
148
|
-
// Until then put a single pixel in the texture so we can
|
|
149
|
-
// use it immediately. When the image has finished downloading
|
|
150
|
-
// we'll update the texture with the contents of the image.
|
|
151
|
-
const level = 0;
|
|
152
|
-
const internalFormat = gl.RGBA;
|
|
153
|
-
const width = 1;
|
|
154
|
-
const height = 1;
|
|
155
|
-
const border = 0;
|
|
156
|
-
const srcFormat = gl.RGBA;
|
|
157
|
-
const srcType = gl.UNSIGNED_BYTE;
|
|
158
|
-
const pixel = new Uint8Array([0, 0, 255, 255]); // opaque blue
|
|
159
|
-
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
|
160
|
-
gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, width, height, border, srcFormat, srcType, pixel);
|
|
161
|
-
const image = new Image();
|
|
162
|
-
image.onload = function () {
|
|
163
|
-
gl.bindTexture(gl.TEXTURE_2D, texture);
|
|
164
|
-
gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);
|
|
165
|
-
gl.texImage2D(gl.TEXTURE_2D, level, internalFormat, srcFormat, srcType, image);
|
|
166
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
|
|
167
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
|
|
168
|
-
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
|
|
169
|
-
};
|
|
170
|
-
image.src = url;
|
|
171
|
-
return texture;
|
|
172
|
-
}
|
|
@@ -5,10 +5,16 @@ export { face_landmark_name_t } from "./zappar-native";
|
|
|
5
5
|
export { frame_pixel_format_t } from "./zappar-native";
|
|
6
6
|
import { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
7
7
|
export { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
8
|
+
import { transform_orientation_t } from "./zappar-native";
|
|
9
|
+
export { transform_orientation_t } from "./zappar-native";
|
|
10
|
+
import { plane_orientation_t } from "./zappar-native";
|
|
11
|
+
export { plane_orientation_t } from "./zappar-native";
|
|
8
12
|
import { log_level_t } from "./zappar-native";
|
|
9
13
|
export { log_level_t } from "./zappar-native";
|
|
10
14
|
export { image_target_type_t } from "./zappar-native";
|
|
11
15
|
export { world_tracker_quality_t } from "./zappar-native";
|
|
16
|
+
import { anchor_status_t } from "./zappar-native";
|
|
17
|
+
export { anchor_status_t } from "./zappar-native";
|
|
12
18
|
export { camera_profile_t } from "./zappar-native";
|
|
13
19
|
export declare type zappar_pipeline_t = number & {
|
|
14
20
|
_: 'zappar_pipeline_t';
|
|
@@ -43,6 +49,9 @@ export declare type zappar_zapcode_tracker_t = number & {
|
|
|
43
49
|
export declare type zappar_world_tracker_t = number & {
|
|
44
50
|
_: 'zappar_world_tracker_t';
|
|
45
51
|
};
|
|
52
|
+
export declare type zappar_custom_anchor_t = number & {
|
|
53
|
+
_: 'zappar_custom_anchor_t';
|
|
54
|
+
};
|
|
46
55
|
export interface zappar {
|
|
47
56
|
log_level(): log_level_t;
|
|
48
57
|
log_level_set(level: log_level_t): void;
|
|
@@ -53,7 +62,7 @@ export interface zappar {
|
|
|
53
62
|
pipeline_frame_number(o: zappar_pipeline_t): number;
|
|
54
63
|
pipeline_camera_model(o: zappar_pipeline_t): Float32Array;
|
|
55
64
|
pipeline_camera_frame_user_data(o: zappar_pipeline_t): number;
|
|
56
|
-
pipeline_camera_frame_submit(o: zappar_pipeline_t, data: ArrayBuffer, width: number, height: number, user_data: number, camera_to_device_transform: Float32Array, camera_model: Float32Array, user_facing: boolean): void;
|
|
65
|
+
pipeline_camera_frame_submit(o: zappar_pipeline_t, data: ArrayBuffer, width: number, height: number, user_data: number, camera_to_device_transform: Float32Array, camera_model: Float32Array, user_facing: boolean, timestampSeconds: number): void;
|
|
57
66
|
pipeline_camera_frame_camera_attitude(o: zappar_pipeline_t): Float32Array;
|
|
58
67
|
pipeline_camera_frame_device_attitude(o: zappar_pipeline_t): Float32Array;
|
|
59
68
|
pipeline_motion_accelerometer_submit(o: zappar_pipeline_t, time: number, x: number, y: number, z: number): void;
|
|
@@ -123,16 +132,23 @@ export interface zappar {
|
|
|
123
132
|
world_tracker_enabled(o: zappar_world_tracker_t): boolean;
|
|
124
133
|
world_tracker_enabled_set(o: zappar_world_tracker_t, enabled: boolean): void;
|
|
125
134
|
world_tracker_quality(o: zappar_world_tracker_t): number;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
135
|
+
world_tracker_horizontal_plane_detection_enabled(o: zappar_world_tracker_t): boolean;
|
|
136
|
+
world_tracker_horizontal_plane_detection_enabled_set(o: zappar_world_tracker_t, horizontal_plane_detection_enabled: boolean): void;
|
|
137
|
+
world_tracker_vertical_plane_detection_enabled(o: zappar_world_tracker_t): boolean;
|
|
138
|
+
world_tracker_vertical_plane_detection_enabled_set(o: zappar_world_tracker_t, vertical_plane_detection_enabled: boolean): void;
|
|
139
|
+
world_tracker_plane_anchor_count(o: zappar_world_tracker_t): number;
|
|
140
|
+
world_tracker_plane_anchor_id(o: zappar_world_tracker_t, indx: number): string;
|
|
141
|
+
world_tracker_plane_anchor_pose_raw(o: zappar_world_tracker_t, indx: number): Float32Array;
|
|
142
|
+
world_tracker_plane_anchor_status(o: zappar_world_tracker_t, indx: number): anchor_status_t;
|
|
143
|
+
world_tracker_plane_anchor_polygon_data_size(o: zappar_world_tracker_t, indx: number): number;
|
|
144
|
+
world_tracker_plane_anchor_polygon_data(o: zappar_world_tracker_t, indx: number): Float32Array;
|
|
145
|
+
world_tracker_plane_anchor_polygon_version(o: zappar_world_tracker_t, indx: number): number;
|
|
146
|
+
world_tracker_plane_anchor_orientation(o: zappar_world_tracker_t, indx: number): plane_orientation_t;
|
|
147
|
+
world_tracker_world_anchor_status(o: zappar_world_tracker_t): anchor_status_t;
|
|
148
|
+
world_tracker_world_anchor_id(o: zappar_world_tracker_t): string;
|
|
134
149
|
world_tracker_world_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
135
|
-
|
|
150
|
+
world_tracker_ground_anchor_id(o: zappar_world_tracker_t): string;
|
|
151
|
+
world_tracker_ground_anchor_status(o: zappar_world_tracker_t): anchor_status_t;
|
|
136
152
|
world_tracker_ground_anchor_pose_raw(o: zappar_world_tracker_t): Float32Array;
|
|
137
153
|
world_tracker_reset(o: zappar_world_tracker_t): void;
|
|
138
154
|
world_tracker_tracks_data_enabled(o: zappar_world_tracker_t): boolean;
|
|
@@ -145,4 +161,12 @@ export interface zappar {
|
|
|
145
161
|
world_tracker_projections_data_enabled_set(o: zappar_world_tracker_t, projections_data_enabled: boolean): void;
|
|
146
162
|
world_tracker_projections_data_size(o: zappar_world_tracker_t): number;
|
|
147
163
|
world_tracker_projections_data(o: zappar_world_tracker_t): Float32Array;
|
|
164
|
+
custom_anchor_create(pipeline: zappar_pipeline_t, worldtracker: zappar_world_tracker_t, id: string): zappar_custom_anchor_t;
|
|
165
|
+
custom_anchor_destroy(o: zappar_custom_anchor_t): void;
|
|
166
|
+
custom_anchor_status(o: zappar_custom_anchor_t): anchor_status_t;
|
|
167
|
+
custom_anchor_enabled_set(o: zappar_custom_anchor_t, enabled: boolean): void;
|
|
168
|
+
custom_anchor_enabled(o: zappar_custom_anchor_t): boolean;
|
|
169
|
+
custom_anchor_pose_raw(o: zappar_custom_anchor_t): Float32Array;
|
|
170
|
+
custom_anchor_pose_set_from_camera_offset_raw(o: zappar_custom_anchor_t, x: number, y: number, z: number, orientation: transform_orientation_t): void;
|
|
171
|
+
custom_anchor_pose_set_from_anchor_offset(o: zappar_custom_anchor_t, anchor_id: string, x: number, y: number, z: number, orientation: transform_orientation_t): void;
|
|
148
172
|
}
|
package/lib/gen/zappar-bridge.js
CHANGED
|
@@ -2,7 +2,10 @@ export { barcode_format_t } from "./zappar-native";
|
|
|
2
2
|
export { face_landmark_name_t } from "./zappar-native";
|
|
3
3
|
export { frame_pixel_format_t } from "./zappar-native";
|
|
4
4
|
export { instant_world_tracker_transform_orientation_t } from "./zappar-native";
|
|
5
|
+
export { transform_orientation_t } from "./zappar-native";
|
|
6
|
+
export { plane_orientation_t } from "./zappar-native";
|
|
5
7
|
export { log_level_t } from "./zappar-native";
|
|
6
8
|
export { image_target_type_t } from "./zappar-native";
|
|
7
9
|
export { world_tracker_quality_t } from "./zappar-native";
|
|
10
|
+
export { anchor_status_t } from "./zappar-native";
|
|
8
11
|
export { camera_profile_t } from "./zappar-native";
|
|
@@ -19,6 +19,7 @@ export declare class zappar_client {
|
|
|
19
19
|
private _instant_world_tracker_state_by_instance;
|
|
20
20
|
private _zapcode_tracker_state_by_instance;
|
|
21
21
|
private _world_tracker_state_by_instance;
|
|
22
|
+
private _custom_anchor_state_by_instance;
|
|
22
23
|
impl: zappar;
|
|
23
24
|
processMessages(a: ArrayBuffer): void;
|
|
24
25
|
}
|