@@ -411,6 +411,44 @@ export interface IMagickImage extends IDisposable {
411
411
*/
412
412
adaptiveSharpen ( radius : number , sigma : number , channels : Channels ) : void ;
413
413
414
+ /**
415
+ * Local adaptive threshold image.
416
+ * http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm.
417
+ * @param width The width of the pixel neighborhood.
418
+ * @param height The height of the pixel neighborhood.
419
+ */
420
+ adaptiveThreshold ( width : number , height : number ) : void ;
421
+
422
+ /**
423
+ * Local adaptive threshold image.
424
+ * http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm.
425
+ * @param width The width of the pixel neighborhood.
426
+ * @param height The height of the pixel neighborhood.
427
+ * @param channels The channel(s) to threshold.
428
+ */
429
+ adaptiveThreshold ( width : number , height : number , channels : Channels ) : void ;
430
+
431
+ /**
432
+ * Local adaptive threshold image.
433
+ * http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm.
434
+ * @param width The width of the pixel neighborhood.
435
+ * @param height The height of the pixel neighborhood.
436
+ * @param channels The channel(s) to threshold.
437
+ * @param bias Constant to subtract from pixel neighborhood mean (+/-)(0-QuantumRange).
438
+ */
439
+ adaptiveThreshold ( width : number , height : number , bias : Percentage , ) : void ;
440
+
441
+ /**
442
+ * Local adaptive threshold image.
443
+ * http://www.dai.ed.ac.uk/HIPR2/adpthrsh.htm.
444
+ * @param width The width of the pixel neighborhood.
445
+ * @param height The height of the pixel neighborhood.
446
+ * @param channels The channel(s) to threshold.
447
+ * @param bias Constant to subtract from pixel neighborhood mean (+/-)(0-QuantumRange).
448
+ * @param channels The channel(s) to threshold.
449
+ */
450
+ adaptiveThreshold ( width : number , height : number , bias : Percentage , channels : Channels ) : void ;
451
+
414
452
/**
415
453
* Add noise to image with the specified noise type.
416
454
* @param noiseType The type of noise that should be added to the image.
@@ -2409,6 +2447,22 @@ export class MagickImage extends NativeInstance implements IMagickImage {
2409
2447
} ) ;
2410
2448
}
2411
2449
2450
+ adaptiveThreshold ( width : number , height : number ) : void ;
2451
+ adaptiveThreshold ( width : number , height : number , channels : Channels ) : void ;
2452
+ adaptiveThreshold ( width : number , height : number , bias : Percentage , ) : void ;
2453
+ adaptiveThreshold ( width : number , height : number , bias : Percentage , channels : Channels ) : void ;
2454
+ adaptiveThreshold ( width : number , height : number , biasChannelsOrUndefined ?: Percentage | Channels , channelsOrUndefined ?: Channels ) : void {
2455
+ const bias = biasChannelsOrUndefined instanceof Percentage ? biasChannelsOrUndefined . _toQuantum ( ) : 0.0 ;
2456
+ let channels = channelsOrUndefined ?? Channels . Undefined ;
2457
+ if ( typeof biasChannelsOrUndefined === 'number' )
2458
+ channels = biasChannelsOrUndefined ;
2459
+
2460
+ this . useException ( exception => {
2461
+ const instance = ImageMagick . _api . _MagickImage_AdaptiveThreshold ( this . _instance , width , height , bias , channels , exception . ptr ) ;
2462
+ this . _setInstance ( instance , exception ) ;
2463
+ } ) ;
2464
+ }
2465
+
2412
2466
addNoise ( noiseType : NoiseType ) : void ;
2413
2467
addNoise ( noiseType : NoiseType , channels : Channels ) : void ;
2414
2468
addNoise ( noiseType : NoiseType , attenuate : number ) : void ;
0 commit comments