#include "magick/string_.h"
#include "magick/string-private.h"
#include "magick/token.h"
+#include "magick/utility.h"
\f
/*
if ( iterations < 0 ) /* negative interations = infinite (well alomst) */
kernel_limit = image->columns > image->rows ? image->columns : image->rows;
- verbose = ( GetImageArtifact(image,"verbose") != (const char *) NULL ) ?
- MagickTrue : MagickFalse;
+
+ verbose = IsMagickTrue(GetImageArtifact(image,"verbose"));
/* initialise for cleanup */
curr_image = (Image *) image;
const ChannelType channel,const MorphologyMethod method,
const ssize_t iterations,const KernelInfo *kernel,ExceptionInfo *exception)
{
- const char
- *artifact;
-
KernelInfo
*curr_kernel;
curr_kernel = (KernelInfo *) kernel;
if ( method == ConvolveMorphology || method == CorrelateMorphology )
{
+ const char
+ *artifact;
artifact = GetImageArtifact(image,"convolve:scale");
if ( artifact != (const char *)NULL ) {
if ( curr_kernel == kernel )
}
/* display the (normalized) kernel via stderr */
- artifact = GetImageArtifact(image,"showkernel");
- if ( artifact == (const char *) NULL)
- artifact = GetImageArtifact(image,"convolve:showkernel");
- if ( artifact == (const char *) NULL)
- artifact = GetImageArtifact(image,"morphology:showkernel");
- if ( artifact != (const char *) NULL)
+ if ( IsMagickTrue(GetImageArtifact(image,"showkernel"))
+ || IsMagickTrue(GetImageArtifact(image,"convolve:showkernel"))
+ || IsMagickTrue(GetImageArtifact(image,"morphology:showkernel")) )
ShowKernelInfo(curr_kernel);
/* Override the default handling of multi-kernel morphology results
* Otherwise merge resulting images using compose method given.
* Default for 'HitAndMiss' is 'Lighten'.
*/
- compose = UndefinedCompositeOp; /* use default for method */
- artifact = GetImageArtifact(image,"morphology:compose");
- if ( artifact != (const char *) NULL)
- compose = (CompositeOperator) ParseMagickOption(
+ { const char
+ *artifact;
+ artifact = GetImageArtifact(image,"morphology:compose");
+ compose = UndefinedCompositeOp; /* use default for method */
+ if ( artifact != (const char *) NULL)
+ compose = (CompositeOperator) ParseMagickOption(
MagickComposeOptions,MagickFalse,artifact);
-
+ }
/* Apply the Morphology */
morphology_image = MorphologyApply(image, channel, method, iterations,
curr_kernel, compose, image->bias, exception);
#include "magick/resize-private.h"
#include "magick/transform.h"
#include "magick/signature-private.h"
+#include "magick/utility.h"
/*
EWA Resampling Options
*/
Q;
double
r_scale;
+
/* Scale radius so the filter LUT covers the full support range */
r_scale = resample_filter->support*sqrt(1.0/(double)WLUT_WIDTH);
- if (GetImageArtifact(resample_filter->image,"resample:verbose")
- != (const char *) NULL)
+ if (IsMagickTrue(GetImageArtifact(resample_filter->image,"resample:verbose")) )
{
/* Debug output of the filter weighting LUT
Gnuplot the LUT with hoizontal adjusted to 'r' using...
% you make good use of "filter:verbose" to make sure that the overall
% effect of your selection (before and after) is as expected.
%
-% "filter:verbose" Output the exact results of the filter
-% selections made, as well as plotting data for graphing the
-% resulting filter over support range (blur adjusted).
+% "filter:verbose" controls whether to output the exact results of
+% the filter selections made, as well as plotting data for
+% graphing the resulting filter over the filters support range.
%
% "filter:filter" Select the main function associated with
% this filter name, as the weighting function of the filter.
{
#endif
artifact=GetImageArtifact(image,"filter:verbose");
- if (artifact != (const char *) NULL)
+ if (IsMagickTrue(artifact))
{
double
support,