@designcombo/video 0.0.1 → 0.0.3

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.
@@ -1,274 +0,0 @@
1
- import { S as M, G as x, a as F } from "./index-BuRTeJh6.js";
2
- const T = {
3
- normal: 0,
4
- add: 1,
5
- multiply: 2,
6
- screen: 3,
7
- overlay: 4,
8
- erase: 5,
9
- "normal-npm": 6,
10
- "add-npm": 7,
11
- "screen-npm": 8,
12
- min: 9,
13
- max: 10
14
- }, o = 0, a = 1, n = 2, l = 3, d = 4, u = 5, c = class b {
15
- constructor() {
16
- this.data = 0, this.blendMode = "normal", this.polygonOffset = 0, this.blend = !0, this.depthMask = !0;
17
- }
18
- /**
19
- * Activates blending of the computed fragment color values.
20
- * @default true
21
- */
22
- get blend() {
23
- return !!(this.data & 1 << o);
24
- }
25
- set blend(t) {
26
- !!(this.data & 1 << o) !== t && (this.data ^= 1 << o);
27
- }
28
- /**
29
- * Activates adding an offset to depth values of polygon's fragments
30
- * @default false
31
- */
32
- get offsets() {
33
- return !!(this.data & 1 << a);
34
- }
35
- set offsets(t) {
36
- !!(this.data & 1 << a) !== t && (this.data ^= 1 << a);
37
- }
38
- /** The culling settings for this state none - No culling back - Back face culling front - Front face culling */
39
- set cullMode(t) {
40
- if (t === "none") {
41
- this.culling = !1;
42
- return;
43
- }
44
- this.culling = !0, this.clockwiseFrontFace = t === "front";
45
- }
46
- get cullMode() {
47
- return this.culling ? this.clockwiseFrontFace ? "front" : "back" : "none";
48
- }
49
- /**
50
- * Activates culling of polygons.
51
- * @default false
52
- */
53
- get culling() {
54
- return !!(this.data & 1 << n);
55
- }
56
- set culling(t) {
57
- !!(this.data & 1 << n) !== t && (this.data ^= 1 << n);
58
- }
59
- /**
60
- * Activates depth comparisons and updates to the depth buffer.
61
- * @default false
62
- */
63
- get depthTest() {
64
- return !!(this.data & 1 << l);
65
- }
66
- set depthTest(t) {
67
- !!(this.data & 1 << l) !== t && (this.data ^= 1 << l);
68
- }
69
- /**
70
- * Enables or disables writing to the depth buffer.
71
- * @default true
72
- */
73
- get depthMask() {
74
- return !!(this.data & 1 << u);
75
- }
76
- set depthMask(t) {
77
- !!(this.data & 1 << u) !== t && (this.data ^= 1 << u);
78
- }
79
- /**
80
- * Specifies whether or not front or back-facing polygons can be culled.
81
- * @default false
82
- */
83
- get clockwiseFrontFace() {
84
- return !!(this.data & 1 << d);
85
- }
86
- set clockwiseFrontFace(t) {
87
- !!(this.data & 1 << d) !== t && (this.data ^= 1 << d);
88
- }
89
- /**
90
- * The blend mode to be applied when this state is set. Apply a value of `normal` to reset the blend mode.
91
- * Setting this mode to anything other than NO_BLEND will automatically switch blending on.
92
- * @default 'normal'
93
- */
94
- get blendMode() {
95
- return this._blendMode;
96
- }
97
- set blendMode(t) {
98
- this.blend = t !== "none", this._blendMode = t, this._blendModeId = T[t] || 0;
99
- }
100
- /**
101
- * The polygon offset. Setting this property to anything other than 0 will automatically enable polygon offset fill.
102
- * @default 0
103
- */
104
- get polygonOffset() {
105
- return this._polygonOffset;
106
- }
107
- set polygonOffset(t) {
108
- this.offsets = !!t, this._polygonOffset = t;
109
- }
110
- toString() {
111
- return `[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`;
112
- }
113
- /**
114
- * A quickly getting an instance of a State that is configured for 2d rendering.
115
- * @returns a new State with values set for 2d rendering
116
- */
117
- static for2d() {
118
- const t = new b();
119
- return t.depthTest = !1, t.blend = !0, t;
120
- }
121
- };
122
- c.default2d = c.for2d();
123
- let _ = c;
124
- const p = class f extends M {
125
- /**
126
- * @param options - The optional parameters of this filter.
127
- */
128
- constructor(t) {
129
- t = { ...f.defaultOptions, ...t }, super(t), this.enabled = !0, this._state = _.for2d(), this.blendMode = t.blendMode, this.padding = t.padding, typeof t.antialias == "boolean" ? this.antialias = t.antialias ? "on" : "off" : this.antialias = t.antialias, this.resolution = t.resolution, this.blendRequired = t.blendRequired, this.clipToViewport = t.clipToViewport, this.addResource("uTexture", 0, 1), t.blendRequired && this.addResource("uBackTexture", 0, 3);
130
- }
131
- /**
132
- * Applies the filter
133
- * @param filterManager - The renderer to retrieve the filter from
134
- * @param input - The input render target.
135
- * @param output - The target to output to.
136
- * @param clearMode - Should the output be cleared before rendering to it
137
- */
138
- apply(t, e, i, r) {
139
- t.applyFilter(this, e, i, r);
140
- }
141
- /**
142
- * Get the blend mode of the filter.
143
- * @default "normal"
144
- */
145
- get blendMode() {
146
- return this._state.blendMode;
147
- }
148
- /** Sets the blend mode of the filter. */
149
- set blendMode(t) {
150
- this._state.blendMode = t;
151
- }
152
- /**
153
- * A short hand function to create a filter based of a vertex and fragment shader src.
154
- * @param options
155
- * @returns A shiny new PixiJS filter!
156
- */
157
- static from(t) {
158
- const { gpu: e, gl: i, ...r } = t;
159
- let m, g;
160
- return e && (m = x.from(e)), i && (g = F.from(i)), new f({
161
- gpuProgram: m,
162
- glProgram: g,
163
- ...r
164
- });
165
- }
166
- };
167
- p.defaultOptions = {
168
- blendMode: "normal",
169
- resolution: 1,
170
- padding: 0,
171
- antialias: "off",
172
- blendRequired: !1,
173
- clipToViewport: !0
174
- };
175
- let S = p;
176
- const h = {
177
- name: "local-uniform-bit",
178
- vertex: {
179
- header: (
180
- /* wgsl */
181
- `
182
-
183
- struct LocalUniforms {
184
- uTransformMatrix:mat3x3<f32>,
185
- uColor:vec4<f32>,
186
- uRound:f32,
187
- }
188
-
189
- @group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
190
- `
191
- ),
192
- main: (
193
- /* wgsl */
194
- `
195
- vColor *= localUniforms.uColor;
196
- modelMatrix *= localUniforms.uTransformMatrix;
197
- `
198
- ),
199
- end: (
200
- /* wgsl */
201
- `
202
- if(localUniforms.uRound == 1)
203
- {
204
- vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
205
- }
206
- `
207
- )
208
- }
209
- }, k = {
210
- ...h,
211
- vertex: {
212
- ...h.vertex,
213
- // replace the group!
214
- header: h.vertex.header.replace("group(1)", "group(2)")
215
- }
216
- }, P = {
217
- name: "local-uniform-bit",
218
- vertex: {
219
- header: (
220
- /* glsl */
221
- `
222
-
223
- uniform mat3 uTransformMatrix;
224
- uniform vec4 uColor;
225
- uniform float uRound;
226
- `
227
- ),
228
- main: (
229
- /* glsl */
230
- `
231
- vColor *= uColor;
232
- modelMatrix = uTransformMatrix;
233
- `
234
- ),
235
- end: (
236
- /* glsl */
237
- `
238
- if(uRound == 1.)
239
- {
240
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
241
- }
242
- `
243
- )
244
- }
245
- };
246
- class w {
247
- constructor() {
248
- this.batcherName = "default", this.topology = "triangle-list", this.attributeSize = 4, this.indexSize = 6, this.packAsQuad = !0, this.roundPixels = 0, this._attributeStart = 0, this._batcher = null, this._batch = null;
249
- }
250
- get blendMode() {
251
- return this.renderable.groupBlendMode;
252
- }
253
- get color() {
254
- return this.renderable.groupColorAlpha;
255
- }
256
- reset() {
257
- this.renderable = null, this.texture = null, this._batcher = null, this._batch = null, this.bounds = null;
258
- }
259
- destroy() {
260
- }
261
- }
262
- function R(s, t, e) {
263
- const i = (s >> 24 & 255) / 255;
264
- t[e++] = (s & 255) / 255 * i, t[e++] = (s >> 8 & 255) / 255 * i, t[e++] = (s >> 16 & 255) / 255 * i, t[e++] = i;
265
- }
266
- export {
267
- w as B,
268
- S as F,
269
- _ as S,
270
- h as a,
271
- P as b,
272
- R as c,
273
- k as l
274
- };