From: cristy Date: Mon, 16 May 2011 00:56:05 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7549 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f53f26f4d5e92eec49acb06da802bb0ebb94ab16;p=imagemagick --- diff --git a/magick/color-private.h b/magick/color-private.h index 93709ea87..93b7292bd 100644 --- a/magick/color-private.h +++ b/magick/color-private.h @@ -49,16 +49,16 @@ static inline MagickBooleanType IsMagickColorEqual(const MagickPixelPacket *p, { #if !defined(MAGICKCORE_HDRI_SUPPORT) if ((p->matte != MagickFalse) && (q->matte == MagickFalse) && - (GetOpacityPixelComponent(p) != OpaqueOpacity)) + (p->opacity != OpaqueOpacity)) return(MagickFalse); if ((q->matte != MagickFalse) && (p->matte == MagickFalse) && (q->opacity != OpaqueOpacity)) return(MagickFalse); if ((p->matte != MagickFalse) && (q->matte != MagickFalse)) { - if (GetOpacityPixelComponent(p) != q->opacity) + if (p->opacity != q->opacity) return(MagickFalse); - if (GetOpacityPixelComponent(p) == TransparentOpacity) + if (p->opacity == TransparentOpacity) return(MagickTrue); } if (p->red != q->red) @@ -71,16 +71,16 @@ static inline MagickBooleanType IsMagickColorEqual(const MagickPixelPacket *p, return(MagickFalse); #else if ((p->matte != MagickFalse) && (q->matte == MagickFalse) && - (fabs(GetOpacityPixelComponent(p)-OpaqueOpacity) > 0.5)) + (fabs(p->opacity-OpaqueOpacity) > 0.5)) return(MagickFalse); if ((q->matte != MagickFalse) && (p->matte == MagickFalse) && (fabs(q->opacity-OpaqueOpacity)) > 0.5) return(MagickFalse); if ((p->matte != MagickFalse) && (q->matte != MagickFalse)) { - if (fabs(GetOpacityPixelComponent(p)-q->opacity) > 0.5) + if (fabs(p->opacity-q->opacity) > 0.5) return(MagickFalse); - if (fabs(GetOpacityPixelComponent(p)-TransparentOpacity) <= 0.5) + if (fabs(p->opacity-TransparentOpacity) <= 0.5) return(MagickTrue); } if (fabs(p->red-q->red) > 0.5) diff --git a/magick/deprecate.c b/magick/deprecate.c index a2c5569fc..7fe6c197a 100644 --- a/magick/deprecate.c +++ b/magick/deprecate.c @@ -6697,11 +6697,14 @@ MagickExport unsigned int ThresholdImageChannel(Image *image, else for (x=0; x < (ssize_t) image->columns; x++) { - SetRedPixelComponent(q,q->red <= pixel.red ? 0 : QuantumRange); - SetGreenPixelComponent(q,q->green <= pixel.green ? 0 : QuantumRange); - SetBluePixelComponent(q,q->blue <= pixel.blue ? 0 : QuantumRange); - SetOpacityPixelComponent(q,q->opacity <= pixel.opacity ? 0 : - QuantumRange); + SetRedPixelComponent(q,(MagickRealType) q->red <= pixel.red + ? 0 : QuantumRange); + SetGreenPixelComponent(q,(MagickRealType) q->green <= pixel.green + ? 0 : QuantumRange); + SetBluePixelComponent(q,(MagickRealType) q->blue <= pixel.blue + ? 0 : QuantumRange); + SetOpacityPixelComponent(q,(MagickRealType) q->opacity <= pixel.opacity + ? 0 : QuantumRange); q++; } if (!SyncAuthenticPixels(image,&image->exception)) diff --git a/magick/draw.c b/magick/draw.c index d2c460390..0e76778e6 100644 --- a/magick/draw.c +++ b/magick/draw.c @@ -2886,7 +2886,7 @@ MagickExport MagickBooleanType DrawImage(Image *image,const DrawInfo *draw_info) alpha=bounds.x2-bounds.x1; beta=bounds.y2-bounds.y1; radius=hypot((double) alpha,(double) beta); - length=2*((size_t) ceil(MagickPI*radius))+6*BezierQuantum+360; + length=2*((size_t) ceil((double) MagickPI*radius))+6*BezierQuantum+360; break; } default: diff --git a/magick/geometry.c b/magick/geometry.c index 8a4c300a1..e5f93b719 100644 --- a/magick/geometry.c +++ b/magick/geometry.c @@ -191,7 +191,7 @@ MagickExport MagickStatusType GetGeometry(const char *geometry,ssize_t *x, value=strtod(p,&q); (void) value; if (LocaleNCompare(p,"0x",2) == 0) - value=strtol(p,&q,10); + value=(double) strtol(p,&q,10); if ((((int) *q) == -41) || (*q == 'x') || (*q == 'X') || (*q == '\0')) { /* diff --git a/magick/morphology.c b/magick/morphology.c index 9caa09721..351d31bab 100644 --- a/magick/morphology.c +++ b/magick/morphology.c @@ -3861,10 +3861,10 @@ MagickExport Image *MorphologyApply(const Image *image, const ChannelType if ( method == VoronoiMorphology ) { /* Preserve the alpha channel of input image - but turned off */ - SetImageAlphaChannel(rslt_image, DeactivateAlphaChannel); + (void) SetImageAlphaChannel(rslt_image, DeactivateAlphaChannel); (void) CompositeImageChannel(rslt_image, DefaultChannels, - CopyOpacityCompositeOp, image, 0, 0); - SetImageAlphaChannel(rslt_image, DeactivateAlphaChannel); + CopyOpacityCompositeOp, image, 0, 0); + (void) SetImageAlphaChannel(rslt_image, DeactivateAlphaChannel); } goto exit_cleanup; } diff --git a/magick/statistic.c b/magick/statistic.c index 0047aa5be..5e83c34ef 100644 --- a/magick/statistic.c +++ b/magick/statistic.c @@ -806,8 +806,8 @@ MagickExport MagickBooleanType EvaluateImageChannel(Image *image, random_info[id],GetOpacityPixelComponent(q),op,value))); else SetOpacityPixelComponent(q,ClampToQuantum(QuantumRange- - ApplyEvaluateOperator(random_info[id],GetAlphaPixelComponent(q), - op,value))); + ApplyEvaluateOperator(random_info[id],(Quantum) + GetAlphaPixelComponent(q),op,value))); } if (((channel & IndexChannel) != 0) && (indexes != (IndexPacket *) NULL)) SetIndexPixelComponent(indexes+x,ClampToQuantum(ApplyEvaluateOperator( diff --git a/magick/thread-private.h b/magick/thread-private.h index 9c5b89ac3..2588eeeb5 100644 --- a/magick/thread-private.h +++ b/magick/thread-private.h @@ -96,22 +96,20 @@ static inline MagickBooleanType IsMagickThreadEqual(const MagickThreadType id) */ static inline size_t GetOpenMPMaximumThreads(void) { + static size_t + maximum_threads = 1; + #if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203) { ssize_t threads; - static size_t - maximum_threads = 1UL; - threads=omp_get_max_threads(); if (threads > (ssize_t) maximum_threads) maximum_threads=threads; - return(maximum_threads); } -#else - return(1UL); #endif + return(maximum_threads); } static inline int GetOpenMPThreadId(void)