@@ -1610,31 +1610,20 @@ MagickExport MagickBooleanType PerceptibleImage(Image *image,
1610
1610
%
1611
1611
% o image: the image.
1612
1612
%
1613
- % o thresholds: a geometry string containing low,high thresholds. If the
1614
- % string contains 2x2, 3x3, or 4x4, an ordered dither of order 2, 3, or 4
1615
- % is performed instead.
1613
+ % o low,high: Specify the high and low thresholds. These values range from
1614
+ % 0 to QuantumRange.
1616
1615
%
1617
1616
% o exception: return any errors or warnings in this structure.
1618
1617
%
1619
1618
*/
1620
1619
MagickExport MagickBooleanType RandomThresholdImage (Image * image ,
1621
- const char * thresholds ,ExceptionInfo * exception )
1620
+ const double min_threshold , const double max_threshold ,ExceptionInfo * exception )
1622
1621
{
1623
1622
#define ThresholdImageTag "Threshold/Image"
1624
1623
1625
1624
CacheView
1626
1625
* image_view ;
1627
1626
1628
- double
1629
- min_threshold ,
1630
- max_threshold ;
1631
-
1632
- GeometryInfo
1633
- geometry_info ;
1634
-
1635
- MagickStatusType
1636
- flags ;
1637
-
1638
1627
MagickBooleanType
1639
1628
status ;
1640
1629
@@ -1661,23 +1650,9 @@ MagickExport MagickBooleanType RandomThresholdImage(Image *image,
1661
1650
(void ) LogMagickEvent (TraceEvent ,GetMagickModule (),"%s" ,image -> filename );
1662
1651
assert (exception != (ExceptionInfo * ) NULL );
1663
1652
assert (exception -> signature == MagickCoreSignature );
1664
- if (thresholds == (const char * ) NULL )
1665
- return (MagickTrue );
1666
1653
if (SetImageStorageClass (image ,DirectClass ,exception ) == MagickFalse )
1667
1654
return (MagickFalse );
1668
1655
GetPixelInfo (image ,& threshold );
1669
- min_threshold = 0.0 ;
1670
- max_threshold = (double ) QuantumRange ;
1671
- flags = ParseGeometry (thresholds ,& geometry_info );
1672
- min_threshold = geometry_info .rho ;
1673
- max_threshold = geometry_info .sigma ;
1674
- if ((flags & SigmaValue ) == 0 )
1675
- max_threshold = min_threshold ;
1676
- if (strchr (thresholds ,'%' ) != (char * ) NULL )
1677
- {
1678
- max_threshold *=(double ) (0.01 * QuantumRange );
1679
- min_threshold *=(double ) (0.01 * QuantumRange );
1680
- }
1681
1656
/*
1682
1657
Random threshold image.
1683
1658
*/
0 commit comments