% July 1992 %
% %
% %
-% Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2017 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
% obtain a copy of the License at %
% %
-% http://www.imagemagick.org/script/license.php %
+% https://www.imagemagick.org/script/license.php %
% %
% Unless required by applicable law or agreed to in writing, software %
% distributed under the License is distributed on an "AS IS" BASIS, %
Include declarations.
*/
#include "MagickCore/studio.h"
+#include "MagickCore/accelerate-private.h"
#include "MagickCore/artifact.h"
#include "MagickCore/attribute.h"
#include "MagickCore/cache.h"
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(clut_image != (Image *) NULL);
assert(clut_image->signature == MagickCoreSignature);
- if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
+ if( SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
- if( IfMagickTrue(IsGrayColorspace(image->colorspace)) &&
- IfMagickFalse(IsGrayColorspace(clut_image->colorspace)))
+ if( (IsGrayColorspace(image->colorspace) != MagickFalse) &&
+ (IsGrayColorspace(clut_image->colorspace) == MagickFalse))
(void) SetImageColorspace(image,sRGBColorspace,exception);
clut_map=(PixelInfo *) AcquireQuantumMemory(MaxMap+1UL,sizeof(*clut_map));
if (clut_map == (PixelInfo *) NULL)
PixelTrait
traits;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
SetPixelViaPixelInfo(image,&pixel,q);
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_ClutImage)
#endif
proceed=SetImageProgress(image,ClutImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
p=(const char *) content;
for (i=0; (*p != '\0') && (i < 3); i++)
{
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
if (*token == ',')
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
switch (i)
{
case 0:
p=(const char *) content;
for (i=0; (*p != '\0') && (i < 3); i++)
{
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
if (*token == ',')
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
switch (i)
{
case 0:
p=(const char *) content;
for (i=0; (*p != '\0') && (i < 3); i++)
{
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
if (*token == ',')
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
switch (i)
{
case 0:
{
content=GetXMLTreeContent(saturation);
p=(const char *) content;
- GetMagickToken(p,&p,token);
+ GetNextToken(p,&p,MagickPathExtent,token);
color_correction.saturation=StringToDouble(token,(char **) NULL);
}
}
(cdl_map[ScaleQuantumToMap(GetPixelBlue(image,q))].blue-luma)),q);
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#endif
proceed=SetImageProgress(image,ColorDecisionListCorrectImageTag,
progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
+#if defined(MAGICKCORE_OPENCL_SUPPORT)
+ if (AccelerateContrastImage(image,sharpen,exception) != MagickFalse)
+ return(MagickTrue);
+#endif
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- sign=IfMagickTrue(sharpen) ? 1 : -1;
+ sign=sharpen != MagickFalse ? 1 : -1;
if (image->storage_class == PseudoClass)
{
/*
green,
red;
- red=0.0;
- green=0.0;
- blue=0.0;
+ red=(double) image->colormap[i].red;
+ green=(double) image->colormap[i].green;
+ blue=(double) image->colormap[i].blue;
Contrast(sign,&red,&green,&blue);
image->colormap[i].red=(MagickRealType) red;
image->colormap[i].green=(MagickRealType) green;
SetPixelBlue(image,ClampToQuantum(blue),q);
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_ContrastImage)
#endif
proceed=SetImageProgress(image,ContrastImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
register ssize_t
j;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
register const Quantum
*magick_restrict r;
- if (GetPixelReadMask(image,p) == 0)
+ if (GetPixelWriteMask(image,p) == 0)
{
SetPixelBackgoundColor(enhance_image,q);
p+=GetPixelChannels(image);
CacheView
*image_view;
- MagickBooleanType
- status;
-
- MagickOffsetType
- progress;
-
double
black[CompositePixelChannel+1],
*equalize_map,
*map,
white[CompositePixelChannel+1];
+ MagickBooleanType
+ status;
+
+ MagickOffsetType
+ progress;
+
register ssize_t
i;
*/
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
+#if defined(MAGICKCORE_OPENCL_SUPPORT)
+ if (AccelerateEqualizeImage(image,exception) != MagickFalse)
+ return(MagickTrue);
+#endif
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
equalize_map=(double *) AcquireQuantumMemory(MaxMap+1UL,
for (x=0; x < (ssize_t) image->columns; x++)
{
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- histogram[GetPixelChannels(image)*ScaleQuantumToMap(p[i])+i]++;
+ {
+ double
+ intensity;
+
+ intensity=p[i];
+ if ((image->channel_mask & SyncChannels) != 0)
+ intensity=GetPixelIntensity(image,p);
+ histogram[GetPixelChannels(image)*ScaleQuantumToMap(intensity)+i]++;
+ }
p+=GetPixelChannels(image);
}
}
PixelChannel channel=GetPixelChannelChannel(image,RedPixelChannel);
if (black[channel] != white[channel])
image->colormap[j].red=equalize_map[GetPixelChannels(image)*
- ScaleQuantumToMap(ClampToQuantum(image->colormap[j].red))]+
- channel;
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].red))+
+ channel];
}
if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
{
GreenPixelChannel);
if (black[channel] != white[channel])
image->colormap[j].green=equalize_map[GetPixelChannels(image)*
- ScaleQuantumToMap(ClampToQuantum(image->colormap[j].green))]+
- channel;
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].green))+
+ channel];
}
if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
{
PixelChannel channel=GetPixelChannelChannel(image,BluePixelChannel);
if (black[channel] != white[channel])
image->colormap[j].blue=equalize_map[GetPixelChannels(image)*
- ScaleQuantumToMap(ClampToQuantum(image->colormap[j].blue))]+
- channel;
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].blue))+
+ channel];
}
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
{
AlphaPixelChannel);
if (black[channel] != white[channel])
image->colormap[j].alpha=equalize_map[GetPixelChannels(image)*
- ScaleQuantumToMap(ClampToQuantum(image->colormap[j].alpha))]+
- channel;
+ ScaleQuantumToMap(ClampToQuantum(image->colormap[j].alpha))+
+ channel];
}
}
}
register ssize_t
j;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
}
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_EqualizeImage)
#endif
proceed=SetImageProgress(image,EqualizeImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
register ssize_t
j;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
}
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#endif
proceed=SetImageProgress(image,GammaCorrectImageTag,progress++,
image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (image->storage_class == PseudoClass)
{
- if( IfMagickFalse(SyncImage(image,exception)) )
+ if (SyncImage(image,exception) == MagickFalse)
return(MagickFalse);
- if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
}
+#if defined(MAGICKCORE_OPENCL_SUPPORT)
+ if (AccelerateGrayscaleImage(image,method,exception) != MagickFalse)
+ {
+ image->intensity=method;
+ image->type=GrayscaleType;
+ return(SetImageColorspace(image,GRAYColorspace,exception));
+ }
+#endif
/*
Grayscale image.
*/
red,
intensity;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
SetPixelGray(image,ClampToQuantum(intensity),q);
q+=GetPixelChannels(image);
}
- if (IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)))
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#endif
proceed=SetImageProgress(image,GrayscaleImageTag,progress++,
image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(hald_image != (Image *) NULL);
assert(hald_image->signature == MagickCoreSignature);
- if( IfMagickFalse(SetImageStorageClass(image,DirectClass,exception)) )
+ if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
return(MagickFalse);
if (image->alpha_trait == UndefinedPixelTrait)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
point.y-=floor(point.y);
point.z-=floor(point.z);
pixel1=zero;
- (void) InterpolatePixelInfo(image,hald_view,image->interpolate,
+ (void) InterpolatePixelInfo(hald_image,hald_view,hald_image->interpolate,
fmod(offset,width),floor(offset/width),&pixel1,exception);
pixel2=zero;
- (void) InterpolatePixelInfo(image,hald_view,image->interpolate,
+ (void) InterpolatePixelInfo(hald_image,hald_view,hald_image->interpolate,
fmod(offset+level,width),floor((offset+level)/width),&pixel2,exception);
pixel3=zero;
CompositePixelInfoAreaBlend(&pixel1,pixel1.alpha,&pixel2,pixel2.alpha,
point.y,&pixel3);
offset+=cube_size;
- (void) InterpolatePixelInfo(image,hald_view,image->interpolate,
+ (void) InterpolatePixelInfo(hald_image,hald_view,hald_image->interpolate,
fmod(offset,width),floor(offset/width),&pixel1,exception);
- (void) InterpolatePixelInfo(image,hald_view,image->interpolate,
+ (void) InterpolatePixelInfo(hald_image,hald_view,hald_image->interpolate,
fmod(offset+level,width),floor((offset+level)/width),&pixel2,exception);
pixel4=zero;
CompositePixelInfoAreaBlend(&pixel1,pixel1.alpha,&pixel2,pixel2.alpha,
SetPixelAlpha(image,ClampToQuantum(pixel.alpha),q);
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_HaldClutImage)
#endif
proceed=SetImageProgress(image,HaldClutImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
level_pixel,
scale;
- scale=(white_point != black_point) ? 1.0/(white_point-black_point) : 1.0;
+ if (fabs(white_point-black_point) < MagickEpsilon)
+ return(pixel);
+ scale=1.0/(white_point-black_point);
level_pixel=QuantumRange*gamma_pow(scale*((double) pixel-black_point),
1.0/gamma);
return(level_pixel);
if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
image->colormap[i].alpha=(double) ClampToQuantum(LevelPixel(black_point,
white_point,gamma,image->colormap[i].alpha));
- }
+ }
/*
Level image.
*/
register ssize_t
j;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
}
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_LevelImage)
#endif
proceed=SetImageProgress(image,LevelImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
register ssize_t
j;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
}
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_LevelizeImage)
#endif
proceed=SetImageProgress(image,LevelizeImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
assert(image->signature == MagickCoreSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- if( IfMagickTrue(IsGrayColorspace(image->colorspace)) &&
- (IfMagickFalse(IsGrayColorspace(black_color->colorspace)) ||
- IfMagickFalse(IsGrayColorspace(white_color->colorspace))))
+ if ((IsGrayColorspace(image->colorspace) != MagickFalse) &&
+ ((IsGrayColorspace(black_color->colorspace) == MagickFalse) ||
+ (IsGrayColorspace(white_color->colorspace) == MagickFalse)))
(void) SetImageColorspace(image,sRGBColorspace,exception);
status=MagickTrue;
- if( IfMagickFalse(invert) )
+ if (invert == MagickFalse)
{
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
{
Increase or decrease color luma, chroma, or hue.
*/
ConvertRGBToHCL(*red,*green,*blue,&hue,&chroma,&luma);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue > 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
chroma*=0.01*percent_chroma;
luma*=0.01*percent_luma;
ConvertHCLToRGB(hue,chroma,luma,red,green,blue);
Increase or decrease color luma, chroma, or hue.
*/
ConvertRGBToHCLp(*red,*green,*blue,&hue,&chroma,&luma);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue > 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
chroma*=0.01*percent_chroma;
luma*=0.01*percent_luma;
ConvertHCLpToRGB(hue,chroma,luma,red,green,blue);
Increase or decrease color brightness, saturation, or hue.
*/
ConvertRGBToHSB(*red,*green,*blue,&hue,&saturation,&brightness);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue > 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
saturation*=0.01*percent_saturation;
brightness*=0.01*percent_brightness;
ConvertHSBToRGB(hue,saturation,brightness,red,green,blue);
Increase or decrease color intensity, saturation, or hue.
*/
ConvertRGBToHSI(*red,*green,*blue,&hue,&saturation,&intensity);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue > 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
saturation*=0.01*percent_saturation;
intensity*=0.01*percent_intensity;
ConvertHSIToRGB(hue,saturation,intensity,red,green,blue);
Increase or decrease color lightness, saturation, or hue.
*/
ConvertRGBToHSL(*red,*green,*blue,&hue,&saturation,&lightness);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue >= 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
saturation*=0.01*percent_saturation;
lightness*=0.01*percent_lightness;
ConvertHSLToRGB(hue,saturation,lightness,red,green,blue);
Increase or decrease color value, saturation, or hue.
*/
ConvertRGBToHSV(*red,*green,*blue,&hue,&saturation,&value);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue >= 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
saturation*=0.01*percent_saturation;
value*=0.01*percent_value;
ConvertHSVToRGB(hue,saturation,value,red,green,blue);
Increase or decrease color blackness, whiteness, or hue.
*/
ConvertRGBToHWB(*red,*green,*blue,&hue,&whiteness,&blackness);
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue >= 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
blackness*=0.01*percent_blackness;
whiteness*=0.01*percent_whiteness;
ConvertHWBToRGB(hue,whiteness,blackness,red,green,blue);
ConvertRGBToLCHab(*red,*green,*blue,&luma,&chroma,&hue);
luma*=0.01*percent_luma;
chroma*=0.01*percent_chroma;
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue >= 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
ConvertLCHabToRGB(luma,chroma,hue,red,green,blue);
}
ConvertRGBToLCHuv(*red,*green,*blue,&luma,&chroma,&hue);
luma*=0.01*percent_luma;
chroma*=0.01*percent_chroma;
- hue+=0.5*(0.01*percent_hue-1.0);
- while (hue < 0.0)
- hue+=1.0;
- while (hue >= 1.0)
- hue-=1.0;
+ hue+=fmod((percent_hue-100.0),200.0)/200.0;
ConvertLCHuvToRGB(luma,chroma,hue,red,green,blue);
}
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if (modulate == (char *) NULL)
return(MagickFalse);
- if( IfMagickFalse(IssRGBCompatibleColorspace(image->colorspace)) )
+ if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
(void) SetImageColorspace(image,sRGBColorspace,exception);
flags=ParseGeometry(modulate,&geometry_info);
percent_brightness=geometry_info.rho;
/*
Modulate image.
*/
+#if defined(MAGICKCORE_OPENCL_SUPPORT)
+ if (AccelerateModulateImage(image,percent_brightness,percent_hue,
+ percent_saturation,colorspace,exception) != MagickFalse)
+ return(MagickTrue);
+#endif
status=MagickTrue;
progress=0;
image_view=AcquireAuthenticCacheView(image,exception);
green,
red;
+ if (GetPixelWriteMask(image,q) == 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
red=(double) GetPixelRed(image,q);
green=(double) GetPixelGreen(image,q);
blue=(double) GetPixelBlue(image,q);
SetPixelBlue(image,ClampToQuantum(blue),q);
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_ModulateImage)
#endif
proceed=SetImageProgress(image,ModulateImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
/*
Negate colormap.
*/
- if( IfMagickTrue(grayscale) )
+ if( grayscale != MagickFalse )
if ((image->colormap[i].red != image->colormap[i].green) ||
(image->colormap[i].green != image->colormap[i].blue))
continue;
status=MagickTrue;
progress=0;
image_view=AcquireAuthenticCacheView(image,exception);
- if( IfMagickTrue(grayscale) )
+ if( grayscale != MagickFalse )
{
for (y=0; y < (ssize_t) image->rows; y++)
{
register ssize_t
j;
- if ((GetPixelReadMask(image,q) == 0) ||
- IfMagickTrue(IsPixelGray(image,q)))
+ if ((GetPixelWriteMask(image,q) == 0) ||
+ IsPixelGray(image,q) != MagickFalse)
{
q+=GetPixelChannels(image);
continue;
q+=GetPixelChannels(image);
}
sync=SyncCacheViewAuthenticPixels(image_view,exception);
- if( IfMagickFalse(sync) )
+ if (sync == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#endif
proceed=SetImageProgress(image,NegateImageTag,progress++,
image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
register ssize_t
j;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
}
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#pragma omp critical (MagickCore_NegateImage)
#endif
proceed=SetImageProgress(image,NegateImageTag,progress++,image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}
register ssize_t
i;
- if( IfMagickTrue(sharpen) )
+ if( sharpen != MagickFalse )
for (i=0; i < (ssize_t) image->colors; i++)
{
if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
register ssize_t
i;
- if (GetPixelReadMask(image,q) == 0)
+ if (GetPixelWriteMask(image,q) == 0)
{
q+=GetPixelChannels(image);
continue;
PixelTrait traits=GetPixelChannelTraits(image,channel);
if ((traits & UpdatePixelTrait) == 0)
continue;
- if( IfMagickTrue(sharpen) )
+ if( sharpen != MagickFalse )
q[i]=ScaledSig(q[i]);
else
q[i]=InverseScaledSig(q[i]);
}
q+=GetPixelChannels(image);
}
- if( IfMagickFalse(SyncCacheViewAuthenticPixels(image_view,exception)) )
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
#endif
proceed=SetImageProgress(image,SigmoidalContrastImageTag,progress++,
image->rows);
- if( IfMagickFalse(proceed) )
+ if (proceed == MagickFalse)
status=MagickFalse;
}
}