File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -687,10 +687,9 @@ export class RawImage {
687
687
* Performs a Gaussian blur on the image.
688
688
* @param {number } kernelSize - Kernel size (must be odd).
689
689
* @param {number } sigma - Standard deviation of the Gaussian.
690
- * @param {number } numChunks - Number of chunks to divide the image into for parallel processing.
691
690
* @returns {Promise<RawImage> } - The blurred image.
692
691
*/
693
- async gaussianBlur ( kernelSize = 3 , sigma = 1 , numChunks = 4 ) {
692
+ async gaussianBlur ( kernelSize = 3 , sigma = 1 ) {
694
693
const kernel = this . generateGaussianKernel ( kernelSize , sigma ) ;
695
694
const halfSize = Math . floor ( kernelSize / 2 ) ;
696
695
@@ -705,6 +704,7 @@ export class RawImage {
705
704
const horizontalPass = new Float32Array ( this . data . length ) ;
706
705
const verticalPass = new Uint8ClampedArray ( this . data . length ) ;
707
706
707
+ const numChunks = navigator . hardwareConcurrency || 4 ;
708
708
const chunkHeight = Math . ceil ( height / numChunks ) ;
709
709
710
710
// Process horizontal pass in chunks.
You can’t perform that action at this time.
0 commit comments