@flighthq/texture 0.5.1-next.704.19c91ec → 0.5.1-next.730.f29a5aa
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/dist/videoTexture.d.ts.map +1 -1
- package/dist/videoTexture.js +4 -4
- package/dist/videoTexture.js.map +1 -1
- package/package.json +5 -4
- package/src/cubeTexture.test.ts +4 -4
- package/src/texture.test.ts +4 -4
- package/src/videoTexture.test.ts +8 -14
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/texture`. The `@flig
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/texture@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/texture@0.5.1-next.730.f29a5aa](https://github.com/flighthq/flight/tree/f29a5aab5db192284ce5cadf08ffae2649a598ea/packages/texture)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/f29a5aab5db192284ce5cadf08ffae2649a598ea/LICENSE.md)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoTexture.d.ts","sourceRoot":"","sources":["../src/videoTexture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"videoTexture.d.ts","sourceRoot":"","sources":["../src/videoTexture.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,WAAW,EACX,OAAO,EACP,SAAS,EACT,WAAW,EACX,aAAa,EACd,MAAM,0BAA0B,CAAC;AAOlC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAOhE;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,OAAO,CAExE;AAGD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAEtF;AAKD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,SAAS,CAQ1G;AAID,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAG5D;AAGD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,MAAM,CAG5E;AAGD,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAGrG;AAGD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,IAAI,CAE9F;AAGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,MAAM,CAG3E;AAGD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,OAAO,CAKhF;AAGD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CAIjE;AAID,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAIvF"}
|
package/dist/videoTexture.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createEntity } from '@flighthq/entity/contract';
|
|
|
2
2
|
import { inverseMatrix3 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { ImageTextureSourceKind } from '@flighthq/types/contract';
|
|
4
4
|
import { cloneTexture, copyTexture, createTexture, getTextureUvMatrix } from './texture';
|
|
5
|
-
// Marks a fresh decoded frame on a video-backed Texture. The
|
|
5
|
+
// Marks a fresh decoded frame on a video-backed Texture. The ImageResource is the shared CPU-origin source
|
|
6
6
|
// and owns the upload revision; Texture.version mirrors it as the sampled object's dirty-bit.
|
|
7
7
|
export function advanceVideoTexture(texture) {
|
|
8
8
|
const image = getVideoImage(texture);
|
|
@@ -13,7 +13,7 @@ export function advanceVideoTexture(texture) {
|
|
|
13
13
|
texture.version = image.version;
|
|
14
14
|
return texture.version;
|
|
15
15
|
}
|
|
16
|
-
// Clones sampling/UV state while sharing the borrowed video
|
|
16
|
+
// Clones sampling/UV state while sharing the borrowed video ImageResource and its upload cache key.
|
|
17
17
|
export function cloneVideoTexture(source) {
|
|
18
18
|
return cloneTexture(source);
|
|
19
19
|
}
|
|
@@ -21,7 +21,7 @@ export function cloneVideoTexture(source) {
|
|
|
21
21
|
export function copyVideoTexture(out, source) {
|
|
22
22
|
copyTexture(out, source);
|
|
23
23
|
}
|
|
24
|
-
// Wraps a VideoResource's borrowed host element in an
|
|
24
|
+
// Wraps a VideoResource's borrowed host element in an ImageResource source and returns the same
|
|
25
25
|
// universal Texture type used by still images and render targets. The all-ones initial revision
|
|
26
26
|
// preserves the former first advanceVideoTexture result of 0 after u32 wrap.
|
|
27
27
|
export function createVideoTexture(source, opts) {
|
|
@@ -33,7 +33,7 @@ export function createVideoTexture(source, opts) {
|
|
|
33
33
|
version: image?.version ?? INITIAL_VIDEO_VERSION,
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
-
// Detaches the borrowed video
|
|
36
|
+
// Detaches the borrowed video ImageResource source without destroying the underlying VideoResource. Leaves
|
|
37
37
|
// the Texture entity invalid — subsequent advance/ready calls return sentinel values.
|
|
38
38
|
export function destroyVideoTexture(texture) {
|
|
39
39
|
texture.source = null;
|
package/dist/videoTexture.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"videoTexture.js","sourceRoot":"","sources":["../src/videoTexture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B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,CAAC;AAED,SAAS,aAAa,CAAC,OAA8B;IACnD,OAAO,OAAO,CAAC,SAAS,KAAK,IAAI,CAAC,CAAC,CAAE,OAAO,CAAC,MAA+B,CAAC,CAAC,CAAC,IAAI,CAAC;AACtF,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAoB;IAChD,MAAM,OAAO,GAAG,KAAK,CAAC,MAA0B,CAAC;IACjD,KAAK,CAAC,KAAK,GAAG,OAAO,CAAC,UAAU,IAAI,CAAC,CAAC;IACtC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,WAAW,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,iGAAiG;AACjG,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAC5B,MAAM,qBAAqB,GAAG,UAAU,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/texture",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.730.f29a5aa",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,11 +38,12 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/geometry": "0.5.1-next.
|
|
43
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.730.f29a5aa",
|
|
42
|
+
"@flighthq/geometry": "0.5.1-next.730.f29a5aa",
|
|
43
|
+
"@flighthq/types": "0.5.1-next.730.f29a5aa"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
+
"@flighthq/video": "*",
|
|
46
47
|
"typescript": "^5.3.0"
|
|
47
48
|
},
|
|
48
49
|
"description": "Textures and samplers: image-backed material texture bindings and cubemaps",
|
package/src/cubeTexture.test.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CubeTexture,
|
|
1
|
+
import type { CubeTexture, ImageResource, TextureSourceCubeFaces } from '@flighthq/types/contract';
|
|
2
2
|
import { CubeFaceNegativeX, CubeFacePositiveX, CubeFacePositiveY } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
4
|
import {
|
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
} from './cubeTexture';
|
|
13
13
|
import { createSampler, equalsSampler } from './sampler';
|
|
14
14
|
|
|
15
|
-
const fakeFace = { width: 64, height: 64 } as
|
|
16
|
-
const fakeFace2 = { width: 128, height: 128 } as
|
|
15
|
+
const fakeFace = { width: 64, height: 64 } as ImageResource;
|
|
16
|
+
const fakeFace2 = { width: 128, height: 128 } as ImageResource;
|
|
17
17
|
|
|
18
18
|
const allFaces: TextureSourceCubeFaces = [fakeFace, fakeFace, fakeFace, fakeFace, fakeFace, fakeFace];
|
|
19
19
|
|
|
@@ -108,7 +108,7 @@ describe('equalsCubeTexture', () => {
|
|
|
108
108
|
it('is false when a face reference differs', () => {
|
|
109
109
|
const a = createCubeTexture({ sources: allFaces });
|
|
110
110
|
const b = createCubeTexture({ sources: allFaces });
|
|
111
|
-
(b.sources as unknown as (
|
|
111
|
+
(b.sources as unknown as (ImageResource | null)[])[0] = fakeFace2;
|
|
112
112
|
|
|
113
113
|
expect(equalsCubeTexture(a, b)).toBe(false);
|
|
114
114
|
});
|
package/src/texture.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createEntity } from '@flighthq/entity/contract';
|
|
2
2
|
import { createMatrix3, createVector2, inverseMatrix3 } from '@flighthq/geometry/contract';
|
|
3
|
-
import type {
|
|
3
|
+
import type { ImageResource, RenderTarget, Texture2D } from '@flighthq/types/contract';
|
|
4
4
|
import { ImageTextureSourceKind, RenderTargetTextureSourceKind } from '@flighthq/types/contract';
|
|
5
5
|
|
|
6
6
|
import { createSampler, equalsSampler } from './sampler';
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
transformTextureUv,
|
|
30
30
|
} from './texture';
|
|
31
31
|
|
|
32
|
-
const fakeImage = { height: 64, kind: ImageTextureSourceKind, width: 32 } as
|
|
32
|
+
const fakeImage = { height: 64, kind: ImageTextureSourceKind, width: 32 } as ImageResource;
|
|
33
33
|
|
|
34
34
|
function makeRenderTarget(width: number, height: number): RenderTarget {
|
|
35
35
|
return createEntity({
|
|
@@ -227,7 +227,7 @@ describe('equalsTexture', () => {
|
|
|
227
227
|
});
|
|
228
228
|
|
|
229
229
|
it('is false when the image reference differs', () => {
|
|
230
|
-
const other = { width: 4, height: 4 } as
|
|
230
|
+
const other = { width: 4, height: 4 } as ImageResource;
|
|
231
231
|
const a = createTexture({ dimension: '2d', source: fakeImage });
|
|
232
232
|
const b = createTexture({ dimension: '2d', source: other });
|
|
233
233
|
|
|
@@ -606,7 +606,7 @@ describe('setTextureUvFromPixelRect', () => {
|
|
|
606
606
|
it('normalizes a pixel rectangle against the texture dimensions', () => {
|
|
607
607
|
const texture = createTexture({
|
|
608
608
|
dimension: '2d',
|
|
609
|
-
source: { height: 100, width: 200 } as
|
|
609
|
+
source: { height: 100, width: 200 } as ImageResource,
|
|
610
610
|
});
|
|
611
611
|
setTextureUvFromPixelRect(texture, 20, 10, 50, 25);
|
|
612
612
|
expect(texture.uvOffset.x).toBeCloseTo(0.1);
|
package/src/videoTexture.test.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createMatrix3, createVector2 } from '@flighthq/geometry/contract';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ImageResource, VideoResource } from '@flighthq/types/contract';
|
|
3
|
+
import { createVideoResource } from '@flighthq/video/contract';
|
|
3
4
|
|
|
4
5
|
import { getTextureSource } from './texture';
|
|
5
6
|
import {
|
|
@@ -17,13 +18,8 @@ import {
|
|
|
17
18
|
setVideoTextureSource,
|
|
18
19
|
} from './videoTexture';
|
|
19
20
|
|
|
20
|
-
// A minimal borrowed host element: only the fields the video-backed Texture accessors read.
|
|
21
21
|
function makeVideoResource(readyState = 4, videoWidth = 320, videoHeight = 240): VideoResource {
|
|
22
|
-
return {
|
|
23
|
-
element: { readyState, videoWidth, videoHeight } as unknown as HTMLVideoElement,
|
|
24
|
-
objectUrl: null,
|
|
25
|
-
ownsElement: false,
|
|
26
|
-
};
|
|
22
|
+
return createVideoResource({ readyState, videoWidth, videoHeight } as unknown as HTMLVideoElement);
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
describe('advanceVideoTexture', () => {
|
|
@@ -71,7 +67,7 @@ describe('createVideoTexture', () => {
|
|
|
71
67
|
const source = makeVideoResource();
|
|
72
68
|
const vt = createVideoTexture(source);
|
|
73
69
|
expect(vt.colorSpace).toBe('srgb');
|
|
74
|
-
expect((getTextureSource(vt) as
|
|
70
|
+
expect((getTextureSource(vt) as ImageResource).source).toBe(source.element);
|
|
75
71
|
expect(vt.version).toBe(0xffffffff);
|
|
76
72
|
expect(vt.uvOffset.x).toBe(0);
|
|
77
73
|
expect(vt.uvScale.x).toBe(1);
|
|
@@ -118,7 +114,7 @@ describe('getVideoTextureHeight', () => {
|
|
|
118
114
|
it('returns the element videoHeight when a frame is decoded, else -1', () => {
|
|
119
115
|
expect(getVideoTextureHeight(createVideoTexture(makeVideoResource(4, 320, 240)))).toBe(240);
|
|
120
116
|
expect(getVideoTextureHeight(createVideoTexture(makeVideoResource(0, 0, 0)))).toBe(-1);
|
|
121
|
-
expect(getVideoTextureHeight(createVideoTexture(
|
|
117
|
+
expect(getVideoTextureHeight(createVideoTexture(createVideoResource()))).toBe(-1);
|
|
122
118
|
});
|
|
123
119
|
});
|
|
124
120
|
|
|
@@ -161,7 +157,7 @@ describe('getVideoTextureWidth', () => {
|
|
|
161
157
|
it('returns the element videoWidth when a frame is decoded, else -1', () => {
|
|
162
158
|
expect(getVideoTextureWidth(createVideoTexture(makeVideoResource(4, 320, 240)))).toBe(320);
|
|
163
159
|
expect(getVideoTextureWidth(createVideoTexture(makeVideoResource(0, 0, 0)))).toBe(-1);
|
|
164
|
-
expect(getVideoTextureWidth(createVideoTexture(
|
|
160
|
+
expect(getVideoTextureWidth(createVideoTexture(createVideoResource()))).toBe(-1);
|
|
165
161
|
});
|
|
166
162
|
});
|
|
167
163
|
|
|
@@ -170,9 +166,7 @@ describe('isVideoTextureFrameReady', () => {
|
|
|
170
166
|
expect(isVideoTextureFrameReady(createVideoTexture(makeVideoResource(4, 320, 240)))).toBe(true);
|
|
171
167
|
expect(isVideoTextureFrameReady(createVideoTexture(makeVideoResource(1, 320, 240)))).toBe(false);
|
|
172
168
|
expect(isVideoTextureFrameReady(createVideoTexture(makeVideoResource(4, 0, 0)))).toBe(false);
|
|
173
|
-
expect(isVideoTextureFrameReady(createVideoTexture(
|
|
174
|
-
false,
|
|
175
|
-
);
|
|
169
|
+
expect(isVideoTextureFrameReady(createVideoTexture(createVideoResource()))).toBe(false);
|
|
176
170
|
});
|
|
177
171
|
});
|
|
178
172
|
|
|
@@ -193,7 +187,7 @@ describe('setVideoTextureSource', () => {
|
|
|
193
187
|
advanceVideoTexture(vt);
|
|
194
188
|
const next = makeVideoResource(4, 640, 480);
|
|
195
189
|
setVideoTextureSource(vt, next);
|
|
196
|
-
expect((getTextureSource(vt) as
|
|
190
|
+
expect((getTextureSource(vt) as ImageResource).source).toBe(next.element);
|
|
197
191
|
expect(vt.version).toBe(0xffffffff);
|
|
198
192
|
expect(getVideoTextureWidth(vt)).toBe(640);
|
|
199
193
|
});
|