return(MagickFalse);
/* check if pixel order is R */
- if ((GetPixelChannelOffset(image,RedPixelChannel) != 0) ||
- (GetPixelRedTraits(image) == UndefinedPixelTrait))
+ if (GetPixelChannelOffset(image,RedPixelChannel) != 0)
return(MagickFalse);
if (image->number_channels == 1)
/* check if pixel order is RA */
if ((image->number_channels == 2) &&
- (GetPixelChannelOffset(image,AlphaPixelChannel) == 1) &&
- (GetPixelAlphaTraits(image) != UndefinedPixelTrait))
+ (GetPixelChannelOffset(image,AlphaPixelChannel) == 1))
return(MagickTrue);
if (image->number_channels == 2)
/* check if pixel order is RGB */
if ((GetPixelChannelOffset(image,GreenPixelChannel) != 1) ||
- (GetPixelGreenTraits(image) == UndefinedPixelTrait) ||
- (GetPixelChannelOffset(image,BluePixelChannel) != 2) ||
- (GetPixelBlueTraits(image) == UndefinedPixelTrait))
+ (GetPixelChannelOffset(image,BluePixelChannel) != 2))
return(MagickFalse);
if (image->number_channels == 3)
return(MagickTrue);
/* check if pixel order is RGBA */
- if ((GetPixelChannelOffset(image,AlphaPixelChannel) != 3) ||
- (GetPixelAlphaTraits(image) == UndefinedPixelTrait))
+ if (GetPixelChannelOffset(image,AlphaPixelChannel) != 3)
return(MagickFalse);
return(MagickTrue);
return(MagickFalse);
/* the order will be RGBA if the image has 4 channels */
- if (image->number_channels == 4)
- return(MagickTrue);
+ if (image->number_channels != 4)
+ return(MagickFalse);
- return(MagickFalse);
+ if ((GetPixelRedTraits(image) == UndefinedPixelTrait) ||
+ (GetPixelGreenTraits(image) == UndefinedPixelTrait) ||
+ (GetPixelBlueTraits(image) == UndefinedPixelTrait) ||
+ (GetPixelAlphaTraits(image) == UndefinedPixelTrait))
+ return(MagickFalse);
+
+ return(MagickTrue);
}
static MagickBooleanType checkHistogramCondition(Image *image)
if ((checkAccelerateConditionRGBA(image) == MagickFalse) ||
(checkOpenCLEnvironment(exception) == MagickFalse))
- return NULL;
+ return((Image *) NULL);
filteredImage=ComputeAddNoiseImage(image,noise_type,exception);
return(filteredImage);
if (image->number_channels < 3)
return(MagickFalse);
+ if ((GetPixelRedTraits(image) == UndefinedPixelTrait) ||
+ (GetPixelGreenTraits(image) == UndefinedPixelTrait) ||
+ (GetPixelBlueTraits(image) == UndefinedPixelTrait))
+ return(MagickFalse);
+
status=ComputeGrayscaleImage(image,method,exception);
return(status);
}