continue;
if ((convolve_traits & CopyPixelTrait) != 0)
{
- SetPixelChannel(convolve_image,channel,p[center+i],q);
+ q[channel]=p[center+i];
continue;
}
k=kernel_info->values;
}
pixels+=image->columns*channels;
}
- SetPixelChannel(convolve_image,channel,ClampToQuantum(pixel),q);
+ q[channel]=ClampToQuantum(pixel);
continue;
}
/*
ssize_t
y;
+ size_t
+ channels;
+
assert(image != (Image *) NULL);
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
/*
Negate image.
*/
+ channels=GetPixelChannels(image);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(dynamic,4) shared(progress,status)
#endif
}
for (x=0; x < (ssize_t) image->columns; x++)
{
- if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
- SetPixelRed(image,QuantumRange-GetPixelRed(image,q),q);
- if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
- SetPixelGreen(image,QuantumRange-GetPixelGreen(image,q),q);
- if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
- SetPixelBlue(image,QuantumRange-GetPixelBlue(image,q),q);
- if (((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0) &&
- (image->colorspace == CMYKColorspace))
- SetPixelBlack(image,QuantumRange-GetPixelBlack(image,q),q);
- if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
- SetPixelAlpha(image,QuantumRange-GetPixelAlpha(image,q),q);
- q+=GetPixelChannels(image);
+ register ssize_t
+ i;
+
+ for (i=0; i < (ssize_t) channels; i++)
+ {
+ PixelTrait
+ traits;
+
+ traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
+ if ((traits & UpdatePixelTrait) != 0)
+ q[i]=QuantumRange-q[i];
+ }
+ q+=channels;
}
if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
status=MagickFalse;
/* #undef AUTOTRACE_DELEGATE */
/* Define if coders and filters are to be built as modules. */
-/* #undef BUILD_MODULES */
+#ifndef MAGICKCORE_BUILD_MODULES
+#define MAGICKCORE_BUILD_MODULES 1
+#endif
/* Define if you have the bzip2 library */
#ifndef MAGICKCORE_BZLIB_DELEGATE
#endif
/* Define to 1 if you have a working `mmap' system call. */
-/* #undef HAVE_MMAP_FILEIO */
+#ifndef MAGICKCORE_HAVE_MMAP_FILEIO
+#define MAGICKCORE_HAVE_MMAP_FILEIO 1
+#endif
/* Define to 1 if you have the `munmap' function. */
#ifndef MAGICKCORE_HAVE_MUNMAP
#endif
/* Define to 1 if the system has the type `_Bool'. */
-/* #undef HAVE__BOOL */
+#ifndef MAGICKCORE_HAVE__BOOL
+#define MAGICKCORE_HAVE__BOOL 1
+#endif
/* Define to 1 if you have the `_exit' function. */
#ifndef MAGICKCORE_HAVE__EXIT
#endif
/* Define if using libltdl to support dynamically loadable modules */
-/* #undef LTDL_DELEGATE */
+#ifndef MAGICKCORE_LTDL_DELEGATE
+#define MAGICKCORE_LTDL_DELEGATE 1
+#endif
/* Define if the OS needs help to load dependent libraries for dlopen(). */
/* #undef LTDL_DLOPEN_DEPLIBS */
MagickExport void SetPixelChannelMap(Image *image,
const ChannelType channel_mask)
{
+#define IsChannelSet(mask,channel) \
+ ((((size_t) (channel) >> (size_t) (i)) & 0x01) != 0)
+
register ssize_t
i;
- for (i=0; i < MaxPixelChannels; i++)
- SetPixelChannelMapTraits(image,(PixelChannel) i,UndefinedPixelTrait);
+ for (i=0; i < (ssize_t) MaxPixelChannels; i++)
+ SetPixelChannelMapTraits(image,(PixelChannel) i,
+ IsChannelSet(channel_mask,i) ? UpdatePixelTrait : CopyPixelTrait);
image->sync=(channel_mask & SyncChannels) != 0 ? MagickTrue : MagickFalse;
- if ((channel_mask & RedChannel) != 0)
- SetPixelRedTraits(image,UpdatePixelTrait);
- if ((channel_mask & GreenChannel) != 0)
- SetPixelGreenTraits(image,UpdatePixelTrait);
- if ((channel_mask & BlueChannel) != 0)
- SetPixelBlueTraits(image,UpdatePixelTrait);
- if ((channel_mask & BlackChannel) != 0)
- SetPixelBlackTraits(image,UpdatePixelTrait);
- if ((channel_mask & AlphaChannel) != 0)
- SetPixelAlphaTraits(image,UpdatePixelTrait);
}
\f
/*
pixels+=image->columns*channels;
}
mean=pixel/number_pixels+bias;
- SetPixelChannel(threshold_image,channel,(Quantum) (((MagickRealType)
- p[center+i] <= mean) ? 0 : QuantumRange),q);
+ q[channel]=(Quantum) (((MagickRealType) p[center+i] <= mean) ? 0 :
+ QuantumRange);
}
p+=channels;
q+=threshold_channels;