@next2d/filters 1.18.12 → 2.0.1

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
@@ -0,0 +1,11 @@
1
+ import type { ConvolutionFilter } from "../../ConvolutionFilter";
2
+ /**
3
+ * @description フィルターを適用できるかどうかを返します。
4
+ * Returns whether the filter can be applied.
5
+ *
6
+ * @param {ConvolutionFilter} convolution_filter
7
+ * @return {boolean}
8
+ * @method
9
+ * @private
10
+ */
11
+ export declare const execute: (convolution_filter: ConvolutionFilter) => boolean;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @description フィルターを適用できるかどうかを返します。
3
+ * Returns whether the filter can be applied.
4
+ *
5
+ * @param {ConvolutionFilter} convolution_filter
6
+ * @return {boolean}
7
+ * @method
8
+ * @private
9
+ */
10
+ export const execute = (convolution_filter) => {
11
+ return convolution_filter.matrix !== null
12
+ && convolution_filter.matrixX * convolution_filter.matrixY === convolution_filter.matrix.length;
13
+ };
@@ -0,0 +1,11 @@
1
+ import type { ConvolutionFilter } from "../../ConvolutionFilter";
2
+ /**
3
+ * @description フィルターの設定値を配列で返却します。
4
+ * Returns an array of filter settings.
5
+ *
6
+ * @param {ConvolutionFilter} convolution_filter
7
+ * @return {Array<number | number[] | boolean | null>}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export declare const execute: (convolution_filter: ConvolutionFilter) => Array<number | number[] | boolean | null>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @description フィルターの設定値を配列で返却します。
3
+ * Returns an array of filter settings.
4
+ *
5
+ * @param {ConvolutionFilter} convolution_filter
6
+ * @return {Array<number | number[] | boolean | null>}
7
+ * @method
8
+ * @protected
9
+ */
10
+ export const execute = (convolution_filter) => {
11
+ return [
12
+ convolution_filter.$filterType,
13
+ convolution_filter.matrixX,
14
+ convolution_filter.matrixY,
15
+ convolution_filter.matrix,
16
+ convolution_filter.divisor,
17
+ convolution_filter.bias,
18
+ convolution_filter.preserveAlpha,
19
+ convolution_filter.clamp,
20
+ convolution_filter.color,
21
+ convolution_filter.alpha
22
+ ];
23
+ };
@@ -0,0 +1,11 @@
1
+ import type { ConvolutionFilter } from "../../ConvolutionFilter";
2
+ /**
3
+ * @description フィルターの設定値を数値配列で返却します。
4
+ * Returns a numeric array of filter settings.
5
+ *
6
+ * @param {ConvolutionFilter} convolution_filter
7
+ * @return {Float32Array}
8
+ * @method
9
+ * @protected
10
+ */
11
+ export declare const execute: (convolution_filter: ConvolutionFilter) => Float32Array;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @description フィルターの設定値を数値配列で返却します。
3
+ * Returns a numeric array of filter settings.
4
+ *
5
+ * @param {ConvolutionFilter} convolution_filter
6
+ * @return {Float32Array}
7
+ * @method
8
+ * @protected
9
+ */
10
+ export const execute = (convolution_filter) => {
11
+ const matrix = convolution_filter.matrix || [];
12
+ return new Float32Array([
13
+ convolution_filter.$filterType,
14
+ convolution_filter.matrixX,
15
+ convolution_filter.matrixY,
16
+ ...matrix,
17
+ convolution_filter.divisor,
18
+ convolution_filter.bias,
19
+ +convolution_filter.preserveAlpha,
20
+ +convolution_filter.clamp,
21
+ convolution_filter.color,
22
+ convolution_filter.alpha
23
+ ]);
24
+ };
@@ -1,29 +1,80 @@
1
1
  import { BitmapFilter } from "./BitmapFilter";
2
- import type { BoundsImpl } from "./interface/BoundsImpl";
3
- import type { CanvasToWebGLContext } from "@next2d/webgl";
4
2
  /**
5
- * ConvolutionFilter クラスを使用すると、マトリックス畳み込みフィルター効果を適用できます。
6
- * 畳み込みでは、入力イメージ内のピクセルを、隣接するピクセルと組み合わせて、イメージを作成します。
7
- * 畳み込みを使用すると、ぼかし、エッジ検出、シャープ、エンボス、ベベルなど、幅広いイメージ効果を実現できます。
3
+ * @description ConvolutionFilter クラスを使用すると、マトリックス畳み込みフィルター効果を適用できます。
4
+ * 畳み込みでは、入力イメージ内のピクセルを、隣接するピクセルと組み合わせて、イメージを作成します。
5
+ * 畳み込みを使用すると、ぼかし、エッジ検出、シャープ、エンボス、ベベルなど、幅広いイメージ効果を実現できます。
8
6
  *
9
- * The ConvolutionFilter class applies a matrix convolution filter effect.
10
- * A convolution combines pixels in the input image with neighboring pixels to produce an image.
11
- * A wide variety of image effects can be achieved through convolutions, including blurring,
12
- * edge detection, sharpening, embossing, and beveling.
7
+ * The ConvolutionFilter class applies a matrix convolution filter effect.
8
+ * A convolution combines pixels in the input image with neighboring pixels to produce an image.
9
+ * A wide variety of image effects can be achieved through convolutions, including blurring,
10
+ * edge detection, sharpening, embossing, and beveling.
13
11
  *
14
12
  * @class
15
13
  * @memberOf next2d.filters
16
14
  * @extends BitmapFilter
17
15
  */
18
16
  export declare class ConvolutionFilter extends BitmapFilter {
17
+ /**
18
+ * @description フィルター認識番号
19
+ * Filter Recognition Number
20
+ *
21
+ * @member {number}
22
+ * @public
23
+ */
24
+ $filterType: number;
25
+ /**
26
+ * @type {number}
27
+ * @default 0
28
+ * @private
29
+ */
19
30
  private _$matrixX;
31
+ /**
32
+ * @type {number}
33
+ * @default 0
34
+ * @private
35
+ */
20
36
  private _$matrixY;
37
+ /**
38
+ * @type {array}
39
+ * @default null
40
+ * @private
41
+ */
21
42
  private _$matrix;
43
+ /**
44
+ * @type {number}
45
+ * @default 1
46
+ * @private
47
+ */
22
48
  private _$divisor;
49
+ /**
50
+ * @type {number}
51
+ * @default 0
52
+ * @private
53
+ */
23
54
  private _$bias;
55
+ /**
56
+ * @type {boolean}
57
+ * @default true
58
+ * @private
59
+ */
24
60
  private _$preserveAlpha;
61
+ /**
62
+ * @type {boolean}
63
+ * @default true
64
+ * @private
65
+ */
25
66
  private _$clamp;
67
+ /**
68
+ * @type {number}
69
+ * @default 0
70
+ * @private
71
+ */
26
72
  private _$color;
73
+ /**
74
+ * @type {number}
75
+ * @default 0
76
+ * @private
77
+ */
27
78
  private _$alpha;
28
79
  /**
29
80
  * @param {number} [matrix_x=0]
@@ -40,46 +91,6 @@ export declare class ConvolutionFilter extends BitmapFilter {
40
91
  * @public
41
92
  */
42
93
  constructor(matrix_x?: number, matrix_y?: number, matrix?: number[] | null, divisor?: number, bias?: number, preserve_alpha?: boolean, clamp?: boolean, color?: number, alpha?: number);
43
- /**
44
- * @description 指定されたクラスのストリングを返します。
45
- * Returns the string representation of the specified class.
46
- *
47
- * @return {string}
48
- * @default [class ConvolutionFilter]
49
- * @method
50
- * @static
51
- */
52
- static toString(): string;
53
- /**
54
- * @description 指定されたクラスの空間名を返します。
55
- * Returns the space name of the specified class.
56
- *
57
- * @return {string}
58
- * @default next2d.filters.ConvolutionFilter
59
- * @const
60
- * @static
61
- */
62
- static get namespace(): string;
63
- /**
64
- * @description 指定されたオブジェクトのストリングを返します。
65
- * Returns the string representation of the specified object.
66
- *
67
- * @return {string}
68
- * @default [object ConvolutionFilter]
69
- * @method
70
- * @public
71
- */
72
- toString(): string;
73
- /**
74
- * @description 指定されたオブジェクトの空間名を返します。
75
- * Returns the space name of the specified object.
76
- *
77
- * @return {string}
78
- * @default next2d.filters.ConvolutionFilter
79
- * @const
80
- * @public
81
- */
82
- get namespace(): string;
83
94
  /**
84
95
  * @description アルファ透明度の値です。
85
96
  * The alpha transparency value for the color.
@@ -182,29 +193,30 @@ export declare class ConvolutionFilter extends BitmapFilter {
182
193
  */
183
194
  clone(): ConvolutionFilter;
184
195
  /**
196
+ * @description 設定されたフィルターの値を配列で返します。
197
+ * Returns the value of the specified filter as an array.
198
+ *
185
199
  * @return {array}
186
200
  * @method
187
201
  * @public
188
202
  */
189
- _$toArray(): any[];
203
+ toArray(): Array<number | number[] | boolean | null>;
190
204
  /**
191
- * @param {object} rect
192
- * @return {object}
205
+ * @description 設定されたフィルターの値を数値配列で返します。
206
+ * Returns the value of the specified filter as a number array.
207
+ *
208
+ * @return {Float32Array}
193
209
  * @method
194
- * @private
210
+ * @public
195
211
  */
196
- _$generateFilterRect(rect: BoundsImpl): BoundsImpl;
212
+ toNumberArray(): Float32Array;
197
213
  /**
214
+ * @description フィルターを適用できるかどうかを返します。
215
+ * Returns whether the filter can be applied.
216
+ *
198
217
  * @return {boolean}
199
218
  * @method
200
- * @private
201
- */
202
- _$canApply(): boolean;
203
- /**
204
- * @param {CanvasToWebGLContext} context
205
- * @return {WebGLTexture}
206
- * @method
207
- * @private
219
+ * @public
208
220
  */
209
- _$applyFilter(context: CanvasToWebGLContext): WebGLTexture;
221
+ canApplyFilter(): boolean;
210
222
  }