%
*/
+static size_t GetImageChannels(const Image *image)
+{
+ register ssize_t
+ i;
+
+ size_t
+ channels;
+
+ channels=0;
+ for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ {
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ if ((traits & UpdatePixelTrait) != 0)
+ channels++;
+ }
+ return(channels == 0 ? 1 : channels);
+}
+
static inline MagickBooleanType ValidateImageMorphology(
const Image *restrict image,const Image *restrict reconstruct_image)
{
/*
Does the image match the reconstructed image morphology?
- if (image->number_channels != reconstruct_image->number_channels)
- return(MagickFalse);
*/
+ if (GetImageChannels(image) != GetImageChannels(reconstruct_image))
+ return(MagickFalse);
return(MagickTrue);
}
return(status);
}
-static size_t GetImageChannels(const Image *image)
-{
- register ssize_t
- i;
-
- size_t
- channels;
-
- channels=0;
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- {
- PixelChannel channel=GetPixelChannelChannel(image,i);
- PixelTrait traits=GetPixelChannelTraits(image,channel);
- if ((traits & UpdatePixelTrait) != 0)
- channels++;
- }
- return(channels == 0 ? 1 : channels);
-}
-
static MagickBooleanType GetFuzzDistortion(const Image *image,
const Image *reconstruct_image,double *distortion,ExceptionInfo *exception)
{