blur_view=AcquireAuthenticCacheView(blur_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,blur_image,blur_image->rows,1)
#endif
for (y=0; y < (ssize_t) blur_image->rows; y++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- blur_traits,
- traits;
-
register const MagickRealType
*restrict k;
ssize_t
v;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- blur_traits=GetPixelChannelTraits(blur_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait blur_traits=GetPixelChannelTraits(blur_image,channel);
if ((traits == UndefinedPixelTrait) ||
(blur_traits == UndefinedPixelTrait))
continue;
pixels=p;
pixel=0.0;
gamma=0.0;
- if ((blur_traits & BlendPixelTrait) == 0)
+ if ((GetPixelAlphaTraits(blur_image) & BlendPixelTrait) == 0)
{
/*
No alpha blending.
sharp_view=AcquireAuthenticCacheView(sharp_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,sharp_image,sharp_image->rows,1)
#endif
for (y=0; y < (ssize_t) sharp_image->rows; y++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- sharp_traits,
- traits;
-
register const MagickRealType
*restrict k;
ssize_t
v;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- sharp_traits=GetPixelChannelTraits(sharp_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait sharp_traits=GetPixelChannelTraits(sharp_image,channel);
if ((traits == UndefinedPixelTrait) ||
(sharp_traits == UndefinedPixelTrait))
continue;
pixels=p;
pixel=0.0;
gamma=0.0;
- if ((sharp_traits & BlendPixelTrait) == 0)
+ if ((GetPixelAlphaTraits(sharp_image) & BlendPixelTrait) == 0)
{
/*
No alpha blending.
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- blur_image=CloneImage(image,0,0,MagickTrue,exception);
+ blur_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
if (blur_image == (Image *) NULL)
return((Image *) NULL);
if (fabs(sigma) < MagickEpsilon)
blur_view=AcquireAuthenticCacheView(blur_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,blur_image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- blur_traits,
- traits;
-
register const MagickRealType
*restrict k;
register ssize_t
u;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- blur_traits=GetPixelChannelTraits(blur_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait blur_traits=GetPixelChannelTraits(blur_image,channel);
if ((traits == UndefinedPixelTrait) ||
(blur_traits == UndefinedPixelTrait))
continue;
k=kernel;
pixels=p;
pixel=0.0;
- if ((blur_traits & BlendPixelTrait) == 0)
+ if ((GetPixelAlphaTraits(blur_image) & BlendPixelTrait) == 0)
{
/*
No alpha blending.
blur_view=AcquireAuthenticCacheView(blur_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(blur_image,blur_image,blur_image->columns,1)
#endif
for (x=0; x < (ssize_t) blur_image->columns; x++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- blur_traits,
- traits;
-
register const MagickRealType
*restrict k;
register ssize_t
u;
- channel=GetPixelChannelChannel(blur_image,i);
- traits=GetPixelChannelTraits(blur_image,channel);
- blur_traits=GetPixelChannelTraits(blur_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(blur_image,i);
+ PixelTrait traits=GetPixelChannelTraits(blur_image,channel);
+ PixelTrait blur_traits=GetPixelChannelTraits(blur_image,channel);
if ((traits == UndefinedPixelTrait) ||
(blur_traits == UndefinedPixelTrait))
continue;
if (((blur_traits & CopyPixelTrait) != 0) ||
- (GetPixelMask(image,p) != 0))
+ (GetPixelMask(blur_image,p) != 0))
{
SetPixelChannel(blur_image,channel,p[center+i],q);
continue;
k=kernel;
pixels=p;
pixel=0.0;
- if ((blur_traits & BlendPixelTrait) == 0)
+ if ((GetPixelAlphaTraits(blur_image) & BlendPixelTrait) == 0)
{
/*
No alpha blending.
gamma=0.0;
for (u=0; u < (ssize_t) width; u++)
{
- alpha=(double) (QuantumScale*GetPixelAlpha(blur_image,
- pixels));
+ alpha=(double) (QuantumScale*GetPixelAlpha(blur_image,pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
k++;
q=g+(columns+2);
r=p+(y_offset*(columns+2)+x_offset);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static) \
- dynamic_number_threads(image,columns,rows,1)
+ #pragma omp parallel for schedule(static,4) \
+ magick_threads(image,image,1,1)
#endif
for (y=0; y < (ssize_t) rows; y++)
{
r=q+(y_offset*(columns+2)+x_offset);
s=q-(y_offset*(columns+2)+x_offset);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static) \
- dynamic_number_threads(image,columns,rows,1)
+ #pragma omp parallel for schedule(static,4) \
+ magick_threads(image,image,1,1)
#endif
for (y=0; y < (ssize_t) rows; y++)
{
despeckle_view=AcquireAuthenticCacheView(despeckle_image,exception);
for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
{
- PixelChannel
- channel;
-
- PixelTrait
- despeckle_traits,
- traits;
-
register ssize_t
k,
x;
j,
y;
- if (status == MagickFalse)
- continue;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- despeckle_traits=GetPixelChannelTraits(despeckle_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait despeckle_traits=GetPixelChannelTraits(despeckle_image,channel);
if ((traits == UndefinedPixelTrait) ||
(despeckle_traits == UndefinedPixelTrait))
continue;
if ((despeckle_traits & CopyPixelTrait) != 0)
continue;
+ if (status == MagickFalse)
+ continue;
(void) ResetMagickMemory(pixels,0,length*sizeof(*pixels));
j=(ssize_t) image->columns+2;
for (y=0; y < (ssize_t) image->rows; y++)
register Quantum
*restrict q;
- q=QueueCacheViewAuthenticPixels(despeckle_view,0,y,
- despeckle_image->columns,1,exception);
+ q=GetCacheViewAuthenticPixels(despeckle_view,0,y,despeckle_image->columns,
+ 1,exception);
if (q == (Quantum *) NULL)
{
status=MagickFalse;
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
sizeof(*kernel_info->values)));
ThrowImageException(ResourceLimitError,"MemoryAllocationFailed");
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
sizeof(*kernel_info->values)));
(void) ResetMagickMemory(kernel_info,0,sizeof(*kernel_info));
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->signature=MagickSignature;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
blur_view=AcquireAuthenticCacheView(blur_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,blur_image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- blur_traits,
- traits;
-
register const Quantum
*restrict r;
register ssize_t
j;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- blur_traits=GetPixelChannelTraits(blur_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait blur_traits=GetPixelChannelTraits(blur_image,channel);
if ((traits == UndefinedPixelTrait) ||
(blur_traits == UndefinedPixelTrait))
continue;
{
degrees+=5.0;
preview_image=ShearImage(thumbnail,degrees,degrees,exception);
- (void) FormatLocaleString(label,MaxTextExtent,"shear %gx%g",
- degrees,2.0*degrees);
+ (void) FormatLocaleString(label,MaxTextExtent,"shear %gx%g",degrees,
+ 2.0*degrees);
break;
}
case RollPreview:
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) FormatLocaleString(factor,MaxTextExtent,"100,100,%g",
- 2.0*percentage);
+ (void) FormatLocaleString(factor,MaxTextExtent,"100,100,%g",2.0*
+ percentage);
(void) ModulateImage(preview_image,factor,exception);
(void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) FormatLocaleString(factor,MaxTextExtent,"100,%g",
- 2.0*percentage);
+ (void) FormatLocaleString(factor,MaxTextExtent,"100,%g",2.0*percentage);
(void) ModulateImage(preview_image,factor,exception);
(void) FormatLocaleString(label,MaxTextExtent,"modulate %s",factor);
break;
case SharpenPreview:
{
preview_image=SharpenImage(thumbnail,radius,sigma,exception);
- (void) FormatLocaleString(label,MaxTextExtent,"sharpen %gx%g",
- radius,sigma);
+ (void) FormatLocaleString(label,MaxTextExtent,"sharpen %gx%g",radius,
+ sigma);
break;
}
case BlurPreview:
break;
(void) BilevelImage(thumbnail,(double) (percentage*((double)
QuantumRange+1.0))/100.0,exception);
- (void) FormatLocaleString(label,MaxTextExtent,"threshold %g",
- (double) (percentage*((double) QuantumRange+1.0))/100.0);
+ (void) FormatLocaleString(label,MaxTextExtent,"threshold %g",(double)
+ (percentage*((double) QuantumRange+1.0))/100.0);
break;
}
case EdgeDetectPreview:
{
preview_image=SpreadImage(thumbnail,radius,thumbnail->interpolate,
exception);
- (void) FormatLocaleString(label,MaxTextExtent,"spread %g",
- radius+0.5);
+ (void) FormatLocaleString(label,MaxTextExtent,"spread %g",radius+0.5);
break;
}
case SolarizePreview:
preview_image=CloneImage(thumbnail,0,0,MagickTrue,exception);
if (preview_image == (Image *) NULL)
break;
- (void) SolarizeImage(preview_image,(double) QuantumRange*
- percentage/100.0,exception);
+ (void) SolarizeImage(preview_image,(double) QuantumRange*percentage/
+ 100.0,exception);
(void) FormatLocaleString(label,MaxTextExtent,"solarize %g",
(QuantumRange*percentage)/100.0);
break;
degrees+=10.0;
preview_image=ShadeImage(thumbnail,MagickTrue,degrees,degrees,
exception);
- (void) FormatLocaleString(label,MaxTextExtent,"shade %gx%g",
- degrees,degrees);
+ (void) FormatLocaleString(label,MaxTextExtent,"shade %gx%g",degrees,
+ degrees);
break;
}
case RaisePreview:
degrees+=5.0f;
preview_image=WaveImage(thumbnail,0.5*degrees,2.0*degrees,
image->interpolate,exception);
- (void) FormatLocaleString(label,MaxTextExtent,"wave %gx%g",
- 0.5*degrees,2.0*degrees);
+ (void) FormatLocaleString(label,MaxTextExtent,"wave %gx%g",0.5*degrees,
+ 2.0*degrees);
break;
}
case OilPaintPreview:
{
preview_image=OilPaintImage(thumbnail,(double) radius,(double) sigma,
exception);
- (void) FormatLocaleString(label,MaxTextExtent,"charcoal %gx%g",
- radius,sigma);
+ (void) FormatLocaleString(label,MaxTextExtent,"charcoal %gx%g",radius,
+ sigma);
break;
}
case CharcoalDrawingPreview:
{
preview_image=CharcoalImage(thumbnail,(double) radius,(double) sigma,
exception);
- (void) FormatLocaleString(label,MaxTextExtent,"charcoal %gx%g",
- radius,sigma);
+ (void) FormatLocaleString(label,MaxTextExtent,"charcoal %gx%g",radius,
+ sigma);
break;
}
case JPEGPreview:
blur_view=AcquireAuthenticCacheView(blur_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,blur_image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- blur_traits,
- traits;
-
register const Quantum
*restrict r;
register ssize_t
j;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- blur_traits=GetPixelChannelTraits(blur_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait blur_traits=GetPixelChannelTraits(blur_image,channel);
if ((traits == UndefinedPixelTrait) ||
(blur_traits == UndefinedPixelTrait))
continue;
blur_view=AcquireAuthenticCacheView(blur_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,blur_image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
gamma,
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- blur_traits,
- traits;
-
register const MagickRealType
*restrict k;
ssize_t
v;
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- blur_traits=GetPixelChannelTraits(blur_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait blur_traits=GetPixelChannelTraits(blur_image,channel);
if ((traits == UndefinedPixelTrait) ||
(blur_traits == UndefinedPixelTrait))
continue;
contrast=GetPixelIntensity(image,pixels)-intensity;
if (fabs(contrast) < threshold)
{
- alpha=(double) (QuantumScale*
- GetPixelAlpha(image,pixels));
+ alpha=(double) (QuantumScale*GetPixelAlpha(image,pixels));
pixel+=(*k)*alpha*pixels[i];
gamma+=(*k)*alpha;
}
*shade_view;
Image
+ *linear_image,
*shade_image;
MagickBooleanType
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
+ linear_image=CloneImage(image,0,0,MagickTrue,exception);
shade_image=CloneImage(image,image->columns,image->rows,MagickTrue,exception);
- if (shade_image == (Image *) NULL)
- return((Image *) NULL);
+ if ((linear_image == (Image *) NULL) || (shade_image == (Image *) NULL))
+ {
+ if (linear_image != (Image *) NULL)
+ linear_image=DestroyImage(linear_image);
+ if (shade_image != (Image *) NULL)
+ shade_image=DestroyImage(shade_image);
+ return((Image *) NULL);
+ }
+ if (image->colorspace == sRGBColorspace)
+ (void) TransformImageColorspace(linear_image,RGBColorspace,exception);
if (SetImageStorageClass(shade_image,DirectClass,exception) == MagickFalse)
{
+ linear_image=DestroyImage(linear_image);
shade_image=DestroyImage(shade_image);
return((Image *) NULL);
}
*/
status=MagickTrue;
progress=0;
- image_view=AcquireVirtualCacheView(image,exception);
+ image_view=AcquireVirtualCacheView(linear_image,exception);
shade_view=AcquireAuthenticCacheView(shade_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(linear_image,shade_image,linear_image->rows,1)
#endif
- for (y=0; y < (ssize_t) image->rows; y++)
+ for (y=0; y < (ssize_t) linear_image->rows; y++)
{
double
distance,
if (status == MagickFalse)
continue;
- p=GetCacheViewVirtualPixels(image_view,-1,y-1,image->columns+2,3,exception);
+ p=GetCacheViewVirtualPixels(image_view,-1,y-1,linear_image->columns+2,3,
+ exception);
q=QueueCacheViewAuthenticPixels(shade_view,0,y,shade_image->columns,1,
exception);
if ((p == (const Quantum *) NULL) || (q == (Quantum *) NULL))
Shade this row of pixels.
*/
normal.z=2.0*(double) QuantumRange; /* constant Z of surface normal */
- pre=p+GetPixelChannels(image);
- center=pre+(image->columns+2)*GetPixelChannels(image);
- post=center+(image->columns+2)*GetPixelChannels(image);
- for (x=0; x < (ssize_t) image->columns; x++)
+ pre=p+GetPixelChannels(linear_image);
+ center=pre+(linear_image->columns+2)*GetPixelChannels(linear_image);
+ post=center+(linear_image->columns+2)*GetPixelChannels(linear_image);
+ for (x=0; x < (ssize_t) linear_image->columns; x++)
{
register ssize_t
i;
/*
Determine the surface normal and compute shading.
*/
- normal.x=(double) (GetPixelIntensity(image,pre-GetPixelChannels(image))+
- GetPixelIntensity(image,center-GetPixelChannels(image))+
- GetPixelIntensity(image,post-GetPixelChannels(image))-
- GetPixelIntensity(image,pre+GetPixelChannels(image))-
- GetPixelIntensity(image,center+GetPixelChannels(image))-
- GetPixelIntensity(image,post+GetPixelChannels(image)));
- normal.y=(double) (GetPixelIntensity(image,post-GetPixelChannels(image))+
- GetPixelIntensity(image,post)+GetPixelIntensity(image,post+
- GetPixelChannels(image))-GetPixelIntensity(image,pre-
- GetPixelChannels(image))-GetPixelIntensity(image,pre)-
- GetPixelIntensity(image,pre+GetPixelChannels(image)));
+ normal.x=(double) (
+ GetPixelIntensity(linear_image,pre-GetPixelChannels(linear_image))+
+ GetPixelIntensity(linear_image,center-GetPixelChannels(linear_image))+
+ GetPixelIntensity(linear_image,post-GetPixelChannels(linear_image))-
+ GetPixelIntensity(linear_image,pre+GetPixelChannels(linear_image))-
+ GetPixelIntensity(linear_image,center+GetPixelChannels(linear_image))-
+ GetPixelIntensity(linear_image,post+GetPixelChannels(linear_image)));
+ normal.y=(double) (
+ GetPixelIntensity(linear_image,post-GetPixelChannels(linear_image))+
+ GetPixelIntensity(linear_image,post)+
+ GetPixelIntensity(linear_image,post+GetPixelChannels(linear_image))-
+ GetPixelIntensity(linear_image,pre-GetPixelChannels(linear_image))-
+ GetPixelIntensity(linear_image,pre)-
+ GetPixelIntensity(linear_image,pre+GetPixelChannels(linear_image)));
if ((normal.x == 0.0) && (normal.y == 0.0))
shade=light.z;
else
distance=normal.x*light.x+normal.y*light.y+normal.z*light.z;
if (distance > MagickEpsilon)
{
- normal_distance=
- normal.x*normal.x+normal.y*normal.y+normal.z*normal.z;
+ normal_distance=normal.x*normal.x+normal.y*normal.y+
+ normal.z*normal.z;
if (normal_distance > (MagickEpsilon*MagickEpsilon))
shade=distance/sqrt((double) normal_distance);
}
}
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
+ for (i=0; i < (ssize_t) GetPixelChannels(linear_image); i++)
{
- PixelChannel
- channel;
-
- PixelTrait
- shade_traits,
- traits;
-
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- shade_traits=GetPixelChannelTraits(shade_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(linear_image,i);
+ PixelTrait traits=GetPixelChannelTraits(linear_image,channel);
+ PixelTrait shade_traits=GetPixelChannelTraits(shade_image,channel);
if ((traits == UndefinedPixelTrait) ||
(shade_traits == UndefinedPixelTrait))
continue;
if (((shade_traits & CopyPixelTrait) != 0) ||
- (GetPixelMask(image,p) != 0))
+ (GetPixelMask(linear_image,p) != 0))
{
SetPixelChannel(shade_image,channel,center[i],q);
continue;
SetPixelChannel(shade_image,channel,ClampToQuantum(QuantumScale*shade*
center[i]),q);
}
- pre+=GetPixelChannels(image);
- center+=GetPixelChannels(image);
- post+=GetPixelChannels(image);
+ pre+=GetPixelChannels(linear_image);
+ center+=GetPixelChannels(linear_image);
+ post+=GetPixelChannels(linear_image);
q+=GetPixelChannels(shade_image);
}
if (SyncCacheViewAuthenticPixels(shade_view,exception) == MagickFalse)
}
shade_view=DestroyCacheView(shade_view);
image_view=DestroyCacheView(image_view);
+ linear_image=DestroyImage(linear_image);
+ if (image->colorspace == sRGBColorspace)
+ (void) TransformImageColorspace(shade_image,sRGBColorspace,exception);
if (status == MagickFalse)
shade_image=DestroyImage(shade_image);
return(shade_image);
(void) ResetMagickMemory(kernel_info,0,sizeof(*kernel_info));
kernel_info->width=width;
kernel_info->height=width;
+ kernel_info->x=(ssize_t) width/2;
+ kernel_info->y=(ssize_t) width/2;
kernel_info->signature=MagickSignature;
kernel_info->values=(MagickRealType *) MagickAssumeAligned(
AcquireAlignedMemory(kernel_info->width,kernel_info->width*
progress=0;
width=GetOptimalKernelWidth1D(radius,0.5);
random_info=AcquireRandomInfoThreadSet();
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
- key=GetRandomSecretKey(random_info[0]);
-#endif
image_view=AcquireVirtualCacheView(image,exception);
spread_view=AcquireAuthenticCacheView(spread_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
+ key=GetRandomSecretKey(random_info[0]);
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,key == ~0UL)
+ magick_threads(image,spread_image,image->rows,key == ~0UL)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
unsharp_view=AcquireAuthenticCacheView(unsharp_image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
#pragma omp parallel for schedule(static,4) shared(progress,status) \
- dynamic_number_threads(image,image->columns,image->rows,1)
+ magick_threads(image,unsharp_image,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
double
pixel;
- PixelChannel
- channel;
-
- PixelTrait
- traits,
- unsharp_traits;
-
- channel=GetPixelChannelChannel(image,i);
- traits=GetPixelChannelTraits(image,channel);
- unsharp_traits=GetPixelChannelTraits(unsharp_image,channel);
+ PixelChannel channel=GetPixelChannelChannel(image,i);
+ PixelTrait traits=GetPixelChannelTraits(image,channel);
+ PixelTrait unsharp_traits=GetPixelChannelTraits(unsharp_image,channel);
if ((traits == UndefinedPixelTrait) ||
(unsharp_traits == UndefinedPixelTrait))
continue;