@next2d/filters 1.18.12 → 2.0.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.
Files changed (118) hide show
  1. package/package.json +8 -20
  2. package/src/BevelFilter/service/BevelFilterCanApplyFilterService.d.ts +11 -0
  3. package/src/BevelFilter/service/BevelFilterCanApplyFilterService.js +16 -0
  4. package/src/BevelFilter/service/BevelFilterToArrayService.d.ts +11 -0
  5. package/src/BevelFilter/service/BevelFilterToArrayService.js +26 -0
  6. package/src/BevelFilter/service/BevelFilterToNumberArrayService.d.ts +11 -0
  7. package/src/BevelFilter/service/BevelFilterToNumberArrayService.js +27 -0
  8. package/src/BevelFilter/usecase/BevelFilterGetBoundsUseCase.d.ts +10 -0
  9. package/src/BevelFilter/usecase/BevelFilterGetBoundsUseCase.js +29 -0
  10. package/{dist → src}/BevelFilter.d.ts +117 -84
  11. package/src/BevelFilter.js +513 -0
  12. package/src/BitmapFilter.d.ts +50 -0
  13. package/src/BitmapFilter.js +61 -0
  14. package/src/BlurFilter/service/BlurFilterCanApplyFilterService.d.ts +16 -0
  15. package/src/BlurFilter/service/BlurFilterCanApplyFilterService.js +12 -0
  16. package/src/BlurFilter/service/BlurFilterToArrayService.d.ts +11 -0
  17. package/src/BlurFilter/service/BlurFilterToArrayService.js +17 -0
  18. package/src/BlurFilter/service/BlurFilterToNumberArrayService.d.ts +11 -0
  19. package/src/BlurFilter/service/BlurFilterToNumberArrayService.js +17 -0
  20. package/src/BlurFilter/usecase/BlurFilterGetBoundsUseCase.d.ts +17 -0
  21. package/src/BlurFilter/usecase/BlurFilterGetBoundsUseCase.js +29 -0
  22. package/src/BlurFilter.d.ts +142 -0
  23. package/src/BlurFilter.js +213 -0
  24. package/src/ColorMatrixFilter/service/ColorMatrixFilterToArrayService.d.ts +11 -0
  25. package/src/ColorMatrixFilter/service/ColorMatrixFilterToArrayService.js +15 -0
  26. package/src/ColorMatrixFilter/service/ColorMatrixFilterToNumberArrayService.d.ts +11 -0
  27. package/src/ColorMatrixFilter/service/ColorMatrixFilterToNumberArrayService.js +15 -0
  28. package/src/ColorMatrixFilter.d.ts +78 -0
  29. package/src/ColorMatrixFilter.js +129 -0
  30. package/src/ConvolutionFilter/service/ConvolutionFilterCanApplyFilterService.d.ts +11 -0
  31. package/src/ConvolutionFilter/service/ConvolutionFilterCanApplyFilterService.js +13 -0
  32. package/src/ConvolutionFilter/service/ConvolutionFilterToArrayService.d.ts +11 -0
  33. package/src/ConvolutionFilter/service/ConvolutionFilterToArrayService.js +23 -0
  34. package/src/ConvolutionFilter/service/ConvolutionFilterToNumberArrayService.d.ts +11 -0
  35. package/src/ConvolutionFilter/service/ConvolutionFilterToNumberArrayService.js +24 -0
  36. package/{dist → src}/ConvolutionFilter.d.ts +75 -63
  37. package/{dist → src}/ConvolutionFilter.js +148 -126
  38. package/src/DisplacementMapFilter/service/DisplacementMapFilterCanApplyFilterService.d.ts +11 -0
  39. package/src/DisplacementMapFilter/service/DisplacementMapFilterCanApplyFilterService.js +16 -0
  40. package/src/DisplacementMapFilter/service/DisplacementMapFilterToArrayService.d.ts +11 -0
  41. package/src/DisplacementMapFilter/service/DisplacementMapFilterToArrayService.js +28 -0
  42. package/src/DisplacementMapFilter/service/DisplacementMapFilterToNumberArrayService.d.ts +11 -0
  43. package/src/DisplacementMapFilter/service/DisplacementMapFilterToNumberArrayService.js +36 -0
  44. package/src/DisplacementMapFilter.d.ts +274 -0
  45. package/src/DisplacementMapFilter.js +481 -0
  46. package/src/DropShadowFilter/service/DropShadowFilterCanApplyFilterService.d.ts +11 -0
  47. package/src/DropShadowFilter/service/DropShadowFilterCanApplyFilterService.js +16 -0
  48. package/src/DropShadowFilter/service/DropShadowFilterToArrayService.d.ts +11 -0
  49. package/src/DropShadowFilter/service/DropShadowFilterToArrayService.js +25 -0
  50. package/src/DropShadowFilter/service/DropShadowFilterToNumberArrayService.d.ts +11 -0
  51. package/src/DropShadowFilter/service/DropShadowFilterToNumberArrayService.js +25 -0
  52. package/src/DropShadowFilter/usecase/DropShadowFilterGetBoundsUseCase.d.ts +10 -0
  53. package/src/DropShadowFilter/usecase/DropShadowFilterGetBoundsUseCase.js +33 -0
  54. package/{dist → src}/DropShadowFilter.d.ts +98 -73
  55. package/src/DropShadowFilter.js +466 -0
  56. package/src/FilterUtil.d.ts +36 -0
  57. package/src/FilterUtil.js +60 -0
  58. package/src/GlowFilter/service/GlowFilterCanApplyFilterService.d.ts +11 -0
  59. package/src/GlowFilter/service/GlowFilterCanApplyFilterService.js +16 -0
  60. package/src/GlowFilter/service/GlowFilterToArrayService.d.ts +11 -0
  61. package/src/GlowFilter/service/GlowFilterToArrayService.js +22 -0
  62. package/src/GlowFilter/service/GlowFilterToNumberArrayService.d.ts +11 -0
  63. package/src/GlowFilter/service/GlowFilterToNumberArrayService.js +22 -0
  64. package/src/GlowFilter/usecase/GlowFilterGetBoundsUseCase.d.ts +10 -0
  65. package/src/GlowFilter/usecase/GlowFilterGetBoundsUseCase.js +19 -0
  66. package/{dist → src}/GlowFilter.d.ts +84 -74
  67. package/src/GlowFilter.js +367 -0
  68. package/src/GradientBevelFilter/service/GradientBevelFilterCanApplyFilterService.d.ts +11 -0
  69. package/src/GradientBevelFilter/service/GradientBevelFilterCanApplyFilterService.js +19 -0
  70. package/src/GradientBevelFilter/service/GradientBevelFilterToArrayService.d.ts +11 -0
  71. package/src/GradientBevelFilter/service/GradientBevelFilterToArrayService.js +25 -0
  72. package/src/GradientBevelFilter/service/GradientBevelFilterToNumberArrayService.d.ts +11 -0
  73. package/src/GradientBevelFilter/service/GradientBevelFilterToNumberArrayService.js +29 -0
  74. package/src/GradientBevelFilter/usecase/GradientBevelFilterGetBoundsUseCase.d.ts +10 -0
  75. package/src/GradientBevelFilter/usecase/GradientBevelFilterGetBoundsUseCase.js +29 -0
  76. package/{dist → src}/GradientBevelFilter.d.ts +102 -77
  77. package/src/GradientBevelFilter.js +482 -0
  78. package/src/GradientGlowFilter/service/GradientGlowFilterCanApplyFilterService.d.ts +11 -0
  79. package/src/GradientGlowFilter/service/GradientGlowFilterCanApplyFilterService.js +19 -0
  80. package/src/GradientGlowFilter/service/GradientGlowFilterToArrayService.d.ts +11 -0
  81. package/src/GradientGlowFilter/service/GradientGlowFilterToArrayService.js +25 -0
  82. package/src/GradientGlowFilter/service/GradientGlowFilterToNumberArrayService.d.ts +11 -0
  83. package/src/GradientGlowFilter/service/GradientGlowFilterToNumberArrayService.js +29 -0
  84. package/src/GradientGlowFilter/usecase/GradientGlowFilterGetBoundsUseCase.d.ts +10 -0
  85. package/src/GradientGlowFilter/usecase/GradientGlowFilterGetBoundsUseCase.js +19 -0
  86. package/{dist → src}/GradientGlowFilter.d.ts +102 -78
  87. package/src/GradientGlowFilter.js +480 -0
  88. package/src/interface/IBitmapDataChannel.d.ts +1 -0
  89. package/src/interface/IBitmapFilterType.d.ts +1 -0
  90. package/{dist/interface/BoundsImpl.d.ts → src/interface/IBounds.d.ts} +1 -1
  91. package/src/interface/IDisplacementMapFilterMode.d.ts +1 -0
  92. package/src/interface/IFilterQuality.d.ts +1 -0
  93. package/dist/BevelFilter.js +0 -504
  94. package/dist/BitmapFilter.d.ts +0 -75
  95. package/dist/BitmapFilter.js +0 -95
  96. package/dist/BlurFilter.d.ts +0 -150
  97. package/dist/BlurFilter.js +0 -375
  98. package/dist/ColorMatrixFilter.d.ts +0 -116
  99. package/dist/ColorMatrixFilter.js +0 -179
  100. package/dist/DisplacementMapFilter.d.ts +0 -211
  101. package/dist/DisplacementMapFilter.js +0 -368
  102. package/dist/DropShadowFilter.js +0 -475
  103. package/dist/GlowFilter.js +0 -356
  104. package/dist/GradientBevelFilter.js +0 -490
  105. package/dist/GradientGlowFilter.js +0 -480
  106. package/dist/interface/AttachmentImpl.d.ts +0 -11
  107. package/dist/interface/BitmapDataChannelImpl.d.ts +0 -1
  108. package/dist/interface/BitmapFilterTypeImpl.d.ts +0 -1
  109. package/dist/interface/DisplacementMapFilterModeImpl.d.ts +0 -1
  110. package/dist/interface/FilterQualityImpl.d.ts +0 -1
  111. package/dist/interface/FilterQualityImpl.js +0 -1
  112. /package/{dist → src}/index.d.ts +0 -0
  113. /package/{dist → src}/index.js +0 -0
  114. /package/{dist/interface/AttachmentImpl.js → src/interface/IBitmapDataChannel.js} +0 -0
  115. /package/{dist/interface/BitmapDataChannelImpl.js → src/interface/IBitmapFilterType.js} +0 -0
  116. /package/{dist/interface/BitmapFilterTypeImpl.js → src/interface/IBounds.js} +0 -0
  117. /package/{dist/interface/BoundsImpl.js → src/interface/IDisplacementMapFilterMode.js} +0 -0
  118. /package/{dist/interface/DisplacementMapFilterModeImpl.js → src/interface/IFilterQuality.js} +0 -0
@@ -1,480 +0,0 @@
1
- import { BitmapFilter } from "./BitmapFilter";
2
- import { BlurFilter } from "./BlurFilter";
3
- import { $Array, $clamp, $Deg2Rad, $getArray, $getBoundsObject, $Math, $toColorInt, $devicePixelRatio } from "@next2d/share";
4
- /**
5
- * GradientGlowFilter クラスを使用すると、表示オブジェクトにグラデーショングロー効果を適用できます。
6
- * グラデーショングローとは、制御可能なカラーグラデーションによるリアルな輝きです。
7
- * グラデーショングローは、オブジェクトの内側エッジや外側エッジの周囲、またはオブジェクトの上に適用できます。
8
- *
9
- * The GradientGlowFilter class lets you apply a gradient glow effect to display objects.
10
- * A gradient glow is a realistic-looking glow with a color gradient that you can control.
11
- * You can apply a gradient glow around the inner or outer edge of an object or on top of an object.
12
- *
13
- * @class
14
- * @memberOf next2d.filters
15
- * @extends BitmapFilter
16
- */
17
- export class GradientGlowFilter extends BitmapFilter {
18
- /**
19
- * @param {number} [distance=4.0]
20
- * @param {number} [angle=45]
21
- * @param {array} [colors=null]
22
- * @param {array} [alphas=null]
23
- * @param {array} [ratios=null]
24
- * @param {number} [blur_x=4.0]
25
- * @param {number} [blur_y=4.0]
26
- * @param {number} [strength=1]
27
- * @param {number} [quality=1]
28
- * @param {string} [type=BitmapFilterType.INNER]
29
- * @param {boolean} [knockout=false]
30
- *
31
- * @constructor
32
- * @public
33
- */
34
- constructor(distance = 4, angle = 45, colors = null, alphas = null, ratios = null, blur_x = 4, blur_y = 4, strength = 1, quality = 1, type = "inner", knockout = false) {
35
- super();
36
- /**
37
- * @type {BlurFilter}
38
- * @default BlurFilter
39
- * @private
40
- */
41
- this._$blurFilter = new BlurFilter(blur_x, blur_y, quality);
42
- /**
43
- * @type {number}
44
- * @default 4
45
- * @private
46
- */
47
- this._$distance = 4;
48
- /**
49
- * @type {number}
50
- * @default 45
51
- * @private
52
- */
53
- this._$angle = 45;
54
- /**
55
- * @type {array}
56
- * @default null
57
- * @private
58
- */
59
- this._$colors = null;
60
- /**
61
- * @type {array}
62
- * @default null
63
- * @private
64
- */
65
- this._$alphas = null;
66
- /**
67
- * @type {array}
68
- * @default null
69
- * @private
70
- */
71
- this._$ratios = null;
72
- /**
73
- * @type {number}
74
- * @default 1
75
- * @private
76
- */
77
- this._$strength = 1;
78
- /**
79
- * @type {string}
80
- * @default BitmapFilterType.INNER
81
- * @private
82
- */
83
- this._$type = "inner";
84
- /**
85
- * @type {boolean}
86
- * @default false
87
- * @private
88
- */
89
- this._$knockout = false;
90
- // setup
91
- this.distance = distance;
92
- this.angle = angle;
93
- this.colors = colors;
94
- this.alphas = alphas;
95
- this.ratios = ratios;
96
- this.strength = strength;
97
- this.type = type;
98
- this.knockout = knockout;
99
- }
100
- /**
101
- * @description 指定されたクラスのストリングを返します。
102
- * Returns the string representation of the specified class.
103
- *
104
- * @return {string}
105
- * @default [class GradientGlowFilter]
106
- * @method
107
- * @static
108
- */
109
- static toString() {
110
- return "[class GradientGlowFilter]";
111
- }
112
- /**
113
- * @description 指定されたクラスの空間名を返します。
114
- * Returns the space name of the specified class.
115
- *
116
- * @return {string}
117
- * @default next2d.filters.GradientGlowFilter
118
- * @const
119
- * @static
120
- */
121
- static get namespace() {
122
- return "next2d.filters.GradientGlowFilter";
123
- }
124
- /**
125
- * @description 指定されたオブジェクトのストリングを返します。
126
- * Returns the string representation of the specified object.
127
- *
128
- * @return {string}
129
- * @default [object GradientGlowFilter]
130
- * @method
131
- * @public
132
- */
133
- toString() {
134
- return "[object GradientGlowFilter]";
135
- }
136
- /**
137
- * @description 指定されたオブジェクトの空間名を返します。
138
- * Returns the space name of the specified object.
139
- *
140
- * @return {string}
141
- * @default next2d.filters.GradientGlowFilter
142
- * @const
143
- * @public
144
- */
145
- get namespace() {
146
- return "next2d.filters.GradientGlowFilter";
147
- }
148
- /**
149
- * @description カラー配列内の各色に対応するアルファ透明度の値の配列です。
150
- * An array of alpha transparency values
151
- * for the corresponding colors in the colors array.
152
- *
153
- * @member {array}
154
- * @default null
155
- * @public
156
- */
157
- get alphas() {
158
- return this._$alphas;
159
- }
160
- set alphas(alphas) {
161
- if (alphas !== this._$alphas) {
162
- this._$alphas = alphas;
163
- if ($Array.isArray(alphas)) {
164
- for (let idx = 0; idx < alphas.length; ++idx) {
165
- alphas[idx] = $clamp(+alphas[idx], 0, 1, 0);
166
- }
167
- this._$alphas = alphas;
168
- }
169
- this._$doChanged();
170
- }
171
- }
172
- /**
173
- * @description シャドウの角度
174
- * The angle of the shadow.
175
- *
176
- * @member {number}
177
- * @default 45
178
- * @public
179
- */
180
- get angle() {
181
- return this._$angle;
182
- }
183
- set angle(angle) {
184
- angle = $clamp(angle % 360, -360, 360, 45);
185
- if (angle !== this._$angle) {
186
- this._$angle = angle;
187
- this._$doChanged();
188
- }
189
- }
190
- /**
191
- * @description 水平方向のぼかし量。
192
- * The amount of horizontal blur.
193
- *
194
- * @member {number}
195
- * @default 4
196
- * @public
197
- */
198
- get blurX() {
199
- return this._$blurFilter.blurX;
200
- }
201
- set blurX(blur_x) {
202
- this._$blurFilter.blurX = blur_x;
203
- }
204
- /**
205
- * @description 垂直方向のぼかし量。
206
- * The amount of vertical blur.
207
- *
208
- * @member {number}
209
- * @default 4
210
- * @public
211
- */
212
- get blurY() {
213
- return this._$blurFilter.blurY;
214
- }
215
- set blurY(blur_y) {
216
- this._$blurFilter.blurY = blur_y;
217
- }
218
- /**
219
- * @description グラデーションで使用する RGB 16 進数カラー値の配列です。
220
- * An array of RGB hexadecimal color values to use in the gradient.
221
- *
222
- * @member {array}
223
- * @default null
224
- * @public
225
- */
226
- get colors() {
227
- return this._$colors;
228
- }
229
- set colors(colors) {
230
- if (this._$colors !== colors) {
231
- this._$colors = colors;
232
- if ($Array.isArray(colors)) {
233
- for (let idx = 0; idx < colors.length; ++idx) {
234
- colors[idx] = $clamp($toColorInt(colors[idx]), 0, 0xffffff, 0);
235
- }
236
- this._$colors = colors;
237
- }
238
- this._$doChanged();
239
- }
240
- }
241
- /**
242
- * @description シャドウのオフセット距離です。
243
- * The offset distance for the shadow, in pixels.
244
- *
245
- * @member {number}
246
- * @default 4
247
- * @public
248
- */
249
- get distance() {
250
- return this._$distance;
251
- }
252
- set distance(distance) {
253
- distance = $clamp(+distance, -255, 255, 4);
254
- if (distance !== this._$distance) {
255
- this._$distance = distance;
256
- this._$doChanged();
257
- }
258
- }
259
- /**
260
- * @description オブジェクトにノックアウト効果を適用するかどうか
261
- * Specifies whether the object has a knockout effect.
262
- *
263
- * @member {boolean}
264
- * @default false
265
- * @public
266
- */
267
- get knockout() {
268
- return this._$knockout;
269
- }
270
- set knockout(knockout) {
271
- if (knockout !== this._$knockout) {
272
- this._$knockout = !!knockout;
273
- this._$doChanged();
274
- }
275
- }
276
- /**
277
- * @description ぼかしの実行回数です。
278
- * The number of times to perform the blur.
279
- *
280
- * @member {number}
281
- * @default 1
282
- * @public
283
- */
284
- get quality() {
285
- return this._$blurFilter.quality;
286
- }
287
- set quality(quality) {
288
- this._$blurFilter.quality = quality;
289
- }
290
- /**
291
- * @description カラー配列内の対応するカラーの色分布比率の配列です。
292
- * An array of color distribution ratios
293
- * for the corresponding colors in the colors array.
294
- *
295
- * @member {array}
296
- * @default null
297
- * @public
298
- */
299
- get ratios() {
300
- return this._$ratios;
301
- }
302
- set ratios(ratios) {
303
- if (this._$ratios !== ratios) {
304
- this._$ratios = ratios;
305
- if ($Array.isArray(ratios)) {
306
- for (let idx = 0; idx < ratios.length; ++idx) {
307
- ratios[idx] = $clamp(+ratios[idx], 0, 255, 0);
308
- }
309
- this._$ratios = ratios;
310
- }
311
- this._$doChanged();
312
- }
313
- }
314
- /**
315
- * @description インプリントの強さまたは広がりです。
316
- * The strength of the imprint or spread.
317
- *
318
- * @member {number}
319
- * @default 1
320
- * @public
321
- */
322
- get strength() {
323
- return this._$strength;
324
- }
325
- set strength(strength) {
326
- strength = $clamp(strength | 0, 0, 255, 0);
327
- if (strength !== this._$strength) {
328
- this._$strength = strength;
329
- this._$doChanged();
330
- }
331
- }
332
- /**
333
- * @description オブジェクトでのベベルの配置
334
- * The placement of the bevel on the object.
335
- *
336
- * @member {string}
337
- * @default BitmapFilterType.INNER
338
- * @public
339
- */
340
- get type() {
341
- return this._$type;
342
- }
343
- set type(type) {
344
- if (type !== this._$type) {
345
- this._$type = type;
346
- this._$doChanged();
347
- }
348
- }
349
- /**
350
- * @description オブジェクトのコピーを返します。
351
- * Returns a copy of this filter object.
352
- *
353
- * @return {GradientGlowFilter}
354
- * @method
355
- * @public
356
- */
357
- clone() {
358
- return new GradientGlowFilter(this._$distance, this._$angle, this._$colors, this._$alphas, this._$ratios, this._$blurFilter.blurX, this._$blurFilter.blurY, this._$strength, this._$blurFilter.quality, this._$type, this._$knockout);
359
- }
360
- /**
361
- * @return {array}
362
- * @method
363
- * @public
364
- */
365
- _$toArray() {
366
- return $getArray(8, this._$distance, this._$angle, this._$colors, this._$alphas, this._$ratios, this._$blurFilter.blurX, this._$blurFilter.blurY, this._$strength, this._$blurFilter.quality, this._$type, this._$knockout);
367
- }
368
- /**
369
- * @return {boolean}
370
- * @method
371
- * @private
372
- */
373
- _$isUpdated() {
374
- return this._$updated || this._$blurFilter._$isUpdated();
375
- }
376
- /**
377
- * @param {object} bounds
378
- * @param {number} [x_scale=0]
379
- * @param {number} [y_scale=0]
380
- * @return {object}
381
- * @method
382
- * @private
383
- */
384
- _$generateFilterRect(bounds, x_scale = 0, y_scale = 0) {
385
- let clone = $getBoundsObject(bounds.xMin, bounds.xMax, bounds.yMin, bounds.yMax);
386
- if (!this._$canApply()) {
387
- return clone;
388
- }
389
- clone = this
390
- ._$blurFilter
391
- ._$generateFilterRect(clone, x_scale, y_scale);
392
- const radian = this._$angle * $Deg2Rad;
393
- let x = $Math.abs($Math.cos(radian) * this._$distance);
394
- let y = $Math.abs($Math.sin(radian) * this._$distance);
395
- if (x_scale) {
396
- x *= x_scale;
397
- }
398
- if (y_scale) {
399
- y *= y_scale;
400
- }
401
- clone.xMin = $Math.min(clone.xMin, x);
402
- if (x > 0) {
403
- clone.xMax += x;
404
- }
405
- clone.yMin = $Math.min(clone.yMin, y);
406
- if (y > 0) {
407
- clone.yMax += y;
408
- }
409
- return clone;
410
- }
411
- /**
412
- /**
413
- * @return {boolean}
414
- * @method
415
- * @private
416
- */
417
- _$canApply() {
418
- return this._$strength > 0 && this._$distance > 0
419
- && this._$alphas !== null && this._$ratios !== null && this._$colors !== null
420
- && this._$blurFilter._$canApply();
421
- }
422
- /**
423
- * @param {CanvasToWebGLContext} context
424
- * @param {array} matrix
425
- * @return {WebGLTexture}
426
- * @method
427
- * @private
428
- */
429
- _$applyFilter(context, matrix) {
430
- this._$updated = false;
431
- const manager = context.frameBuffer;
432
- const currentAttachment = manager.currentAttachment;
433
- // reset
434
- context.setTransform(1, 0, 0, 1, 0, 0);
435
- if (!this._$canApply() || !currentAttachment) {
436
- return manager.getTextureFromCurrentAttachment();
437
- }
438
- const baseWidth = currentAttachment.width;
439
- const baseHeight = currentAttachment.height;
440
- const baseOffsetX = context._$offsetX;
441
- const baseOffsetY = context._$offsetY;
442
- const blurTexture = this
443
- ._$blurFilter
444
- ._$applyFilter(context, matrix, false);
445
- const blurWidth = blurTexture.width;
446
- const blurHeight = blurTexture.height;
447
- const blurOffsetX = context._$offsetX;
448
- const blurOffsetY = context._$offsetY;
449
- const offsetDiffX = blurOffsetX - baseOffsetX;
450
- const offsetDiffY = blurOffsetY - baseOffsetY;
451
- // matrix to scale
452
- let xScale = $Math.sqrt(matrix[0] * matrix[0] + matrix[1] * matrix[1]);
453
- let yScale = $Math.sqrt(matrix[2] * matrix[2] + matrix[3] * matrix[3]);
454
- xScale /= $devicePixelRatio;
455
- yScale /= $devicePixelRatio;
456
- xScale *= 2;
457
- yScale *= 2;
458
- // shadow point
459
- const radian = +(this._$angle * $Deg2Rad);
460
- const x = +($Math.cos(radian) * this._$distance * xScale);
461
- const y = +($Math.sin(radian) * this._$distance * yScale);
462
- const isInner = this.type === "inner";
463
- const w = isInner ? baseWidth : blurWidth + $Math.max(0, $Math.abs(x) - offsetDiffX);
464
- const h = isInner ? baseHeight : blurHeight + $Math.max(0, $Math.abs(y) - offsetDiffY);
465
- const width = $Math.ceil(w);
466
- const height = $Math.ceil(h);
467
- const fractionX = (width - w) / 2;
468
- const fractionY = (height - h) / 2;
469
- const baseTextureX = isInner ? 0 : $Math.max(0, offsetDiffX - x) + fractionX;
470
- const baseTextureY = isInner ? 0 : $Math.max(0, offsetDiffY - y) + fractionY;
471
- const blurTextureX = isInner ? x - blurOffsetX : (x > 0 ? $Math.max(0, x - offsetDiffX) : 0) + fractionX;
472
- const blurTextureY = isInner ? y - blurOffsetY : (y > 0 ? $Math.max(0, y - offsetDiffY) : 0) + fractionY;
473
- context._$bind(currentAttachment);
474
- context._$applyBitmapFilter(blurTexture, width, height, baseWidth, baseHeight, baseTextureX, baseTextureY, blurWidth, blurHeight, blurTextureX, blurTextureY, true, this._$type, this._$knockout, this._$strength, this._$ratios, this._$colors, this._$alphas, 0, 0, 0, 0, 0, 0, 0, 0);
475
- context._$offsetX = baseOffsetX + baseTextureX;
476
- context._$offsetY = baseOffsetY + baseTextureY;
477
- manager.releaseTexture(blurTexture);
478
- return manager.getTextureFromCurrentAttachment();
479
- }
480
- }
@@ -1,11 +0,0 @@
1
- export interface AttachmentImpl {
2
- width: number;
3
- height: number;
4
- color: WebGLTexture | WebGLRenderbuffer | null;
5
- texture: WebGLTexture | null;
6
- msaa: boolean;
7
- stencil: WebGLRenderbuffer | null;
8
- mask: boolean;
9
- clipLevel: number;
10
- isActive: boolean;
11
- }
@@ -1 +0,0 @@
1
- export type BitmapDataChannelImpl = 8 | 4 | 2 | 1 | 0;
@@ -1 +0,0 @@
1
- export type BitmapFilterTypeImpl = "full" | "inner" | "outer";
@@ -1 +0,0 @@
1
- export type DisplacementMapFilterModeImpl = "clamp" | "color" | "ignore" | "wrap";
@@ -1 +0,0 @@
1
- export type FilterQualityImpl = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15;
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes