% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2012 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 %
result=(MagickRealType) (pixel-value);
break;
}
+ case SumEvaluateOperator:
+ {
+ result=(MagickRealType) (pixel+value);
+ break;
+ }
case ThresholdEvaluateOperator:
{
result=(MagickRealType) (((MagickRealType) pixel <= value) ? 0 :
*evaluate_image;
MagickBooleanType
+ concurrent,
status;
MagickOffsetType
if ((next->columns != images->columns) || (next->rows != images->rows))
{
(void) ThrowMagickException(exception,GetMagickModule(),OptionError,
- "ImageWidthsOrHeightsDiffer","`%s'",images->filename);
+ "ImageWidthsOrHeightsDiffer","'%s'",images->filename);
return((Image *) NULL);
}
/*
{
evaluate_image=DestroyImage(evaluate_image);
(void) ThrowMagickException(exception,GetMagickModule(),
- ResourceLimitError,"MemoryAllocationFailed","`%s'",images->filename);
+ ResourceLimitError,"MemoryAllocationFailed","'%s'",images->filename);
return((Image *) NULL);
}
/*
status=MagickTrue;
progress=0;
random_info=AcquireRandomInfoThreadSet();
- evaluate_view=AcquireCacheView(evaluate_image);
+ concurrent=GetRandomSecretKey(random_info[0]) == ~0UL ? MagickTrue :
+ MagickFalse;
+ evaluate_view=AcquireAuthenticCacheView(evaluate_image,exception);
if (op == MedianEvaluateOperator)
{
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic) shared(progress,status)
+ #pragma omp parallel for schedule(static) shared(progress,status) omp_concurrent(concurrent)
#endif
for (y=0; y < (ssize_t) evaluate_image->rows; y++)
{
register ssize_t
i;
- image_view=AcquireCacheView(next);
+ image_view=AcquireVirtualCacheView(next,exception);
p=GetCacheViewVirtualPixels(image_view,x,y,1,1,exception);
if (p == (const Quantum *) NULL)
{
else
{
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic) shared(progress,status)
+ #pragma omp parallel for schedule(static) shared(progress,status) omp_concurrent(concurrent)
#endif
for (y=0; y < (ssize_t) evaluate_image->rows; y++)
{
register const Quantum
*p;
- image_view=AcquireCacheView(next);
+ image_view=AcquireVirtualCacheView(next,exception);
p=GetCacheViewVirtualPixels(image_view,0,y,next->columns,1,exception);
if (p == (const Quantum *) NULL)
{
register ssize_t
i;
- for (i=0; i < (ssize_t) GetPixelChannels(evaluate_image); i++)
+ if (GetPixelMask(next,p) != 0)
+ {
+ p+=GetPixelChannels(next);
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(next); i++)
{
PixelChannel
channel;
register ssize_t
i;
+ if (GetPixelMask(evaluate_image,q) != 0)
+ {
+ q+=GetPixelChannels(evaluate_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(evaluate_image); i++)
{
PixelChannel
*image_view;
MagickBooleanType
+ concurrent,
status;
MagickOffsetType
status=MagickTrue;
progress=0;
random_info=AcquireRandomInfoThreadSet();
- image_view=AcquireCacheView(image);
+ concurrent=GetRandomSecretKey(random_info[0]) == ~0UL ? MagickTrue :
+ MagickFalse;
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status) omp_concurrent(concurrent)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
traits=GetPixelChannelMapTraits(image,channel);
if (traits == UndefinedPixelTrait)
continue;
+ if ((traits & CopyPixelTrait) != 0)
+ continue;
q[i]=ClampToQuantum(ApplyEvaluateOperator(random_info[id],q[i],op,
value));
}
return(MagickFalse);
status=MagickTrue;
progress=0;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(image,q) != 0)
+ {
+ q+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
sum_squares=0.0;
sum_cubes=0.0;
sum_fourth_power=0.0;
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic) shared(status) omp_throttle(1)
+ #pragma omp parallel for schedule(static) shared(status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
status=MagickTrue;
*maxima=(-MagickHuge);
*minima=MagickHuge;
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic) shared(status) omp_throttle(1)
+ #pragma omp parallel for schedule(static) shared(status)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
#pragma omp critical (MagickCore_GetImageRange)
#endif
{
- if (p[i] < *minima)
+ if ((double) p[i] < *minima)
*minima=(double) p[i];
- if (p[i] > *maxima)
+ if ((double) p[i] > *maxima)
*maxima=(double) p[i];
}
}
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel
traits=GetPixelChannelMapTraits(image,channel);
if (traits == UndefinedPixelTrait)
continue;
- if (channel_statistics[i].depth != MAGICKCORE_QUANTUM_DEPTH)
+ if (channel_statistics[channel].depth != MAGICKCORE_QUANTUM_DEPTH)
{
- depth=channel_statistics[i].depth;
+ depth=channel_statistics[channel].depth;
range=GetQuantumRange(depth);
status=p[i] != ScaleAnyToQuantum(ScaleQuantumToAny(p[i],range),
range) ? MagickTrue : MagickFalse;
(MagickMax(height,1)/2L)+GetPixelChannels(image)*(MagickMax(width,1)/2L);
status=MagickTrue;
progress=0;
- image_view=AcquireCacheView(image);
- statistic_view=AcquireCacheView(statistic_image);
+ image_view=AcquireVirtualCacheView(image,exception);
+ statistic_view=AcquireAuthenticCacheView(statistic_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
+ #pragma omp parallel for schedule(static,4) shared(progress,status)
#endif
for (y=0; y < (ssize_t) statistic_image->rows; y++)
{
register ssize_t
i;
+ if (GetPixelMask(image,p) != 0)
+ {
+ p+=GetPixelChannels(image);
+ q+=GetPixelChannels(statistic_image);
+ continue;
+ }
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
PixelChannel