Skip to content
Permalink
Browse files Browse the repository at this point in the history
No commit message
  • Loading branch information
cristy committed Jan 9, 2015
1 parent 530f17f commit 450bd71
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion MagickCore/composite.c
Expand Up @@ -2305,7 +2305,7 @@ if (0)
break;
}
}
q[i]=ClampToQuantum(pixel);
q[i]=ClampPixel(pixel);
}
p+=GetPixelChannels(composite_image);
channels=GetPixelChannels(composite_image);
Expand Down
13 changes: 13 additions & 0 deletions MagickCore/pixel-accessor.h
Expand Up @@ -31,6 +31,19 @@ extern "C" {

#undef index

static inline Quantum ClampPixel(const MagickRealType value)
{
#if !defined(MAGICKCORE_HDRI_SUPPORT)
return((Quantum) value);
#else
if (value < 0.0)
return((Quantum) 0.0);
if (value >= (MagickRealType) QuantumRange)
return((Quantum) QuantumRange);
return((Quantum) value);
#endif
}

static inline Quantum GetPixela(const Image *restrict image,
const Quantum *restrict pixel)
{
Expand Down
13 changes: 0 additions & 13 deletions MagickCore/threshold.c
Expand Up @@ -685,19 +685,6 @@ MagickExport MagickBooleanType BlackThresholdImage(Image *image,
%
*/

static inline Quantum ClampPixel(const MagickRealType value)
{
#if !defined(MAGICKCORE_HDRI_SUPPORT)
return((Quantum) value);
#else
if (value < 0.0f)
return(0.0);
if (value >= (MagickRealType) QuantumRange)
return((Quantum) QuantumRange);
return(value);
#endif
}

MagickExport MagickBooleanType ClampImage(Image *image,ExceptionInfo *exception)
{
#define ClampImageTag "Clamp/Image"
Expand Down
2 changes: 2 additions & 0 deletions coders/sun.c
Expand Up @@ -337,6 +337,8 @@ static Image *ReadSUNImage(const ImageInfo *image_info,ExceptionInfo *exception)
}
switch (sun_info.maptype)
{
case RMT_NONE:
break;
case RMT_EQUAL_RGB:
{
unsigned char
Expand Down

0 comments on commit 450bd71

Please sign in to comment.