]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Tue, 12 Mar 2013 16:31:13 +0000 (16:31 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Tue, 12 Mar 2013 16:31:13 +0000 (16:31 +0000)
MagickCore/pixel-accessor.h
MagickCore/pixel.c
MagickCore/pixel.h

index f54e055dfbebcc5ebd3676ab21fd6ccda0251f23..b8311a624e66c6f3785e121b46d769d833e0ba47 100644 (file)
@@ -233,29 +233,6 @@ static inline MagickRealType GetPixelInfoLuminance(
   return(0.21267f*red+0.71516f*green+0.07217f*blue);
 }
 
-static inline MagickRealType GetPixelIntensity(const Image *restrict image,
-  const Quantum *restrict pixel)
-{
-  MagickRealType
-    blue,
-    green,
-    red;
-
-  if (image->colorspace == GRAYColorspace)
-    return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
-  if (image->colorspace != sRGBColorspace)
-    return(0.298839f*pixel[image->channel_map[RedPixelChannel].offset]+
-      0.586811f*pixel[image->channel_map[GreenPixelChannel].offset]+
-      0.114350f*pixel[image->channel_map[BluePixelChannel].offset]);
-  red=DecodePixelGamma((MagickRealType)
-    pixel[image->channel_map[RedPixelChannel].offset]);
-  green=DecodePixelGamma((MagickRealType)
-    pixel[image->channel_map[GreenPixelChannel].offset]);
-  blue=DecodePixelGamma((MagickRealType)
-    pixel[image->channel_map[BluePixelChannel].offset]);
-  return(0.298839f*red+0.586811f*green+0.114350f*blue);
-}
-
 static inline Quantum GetPixelL(const Image *restrict image,
   const Quantum *restrict pixel)
 {
index 5e97f880b8f8adfd1185548cbd23e9a86fdf0ca3..dfbbf3628f87431f7de94bab9a14f3749964c4a6 100644 (file)
@@ -2083,6 +2083,55 @@ MagickExport void GetPixelInfo(const Image *image,PixelInfo *pixel)
   pixel->depth=image->depth;
   pixel->fuzz=image->fuzz;
 }
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%   G e t P i x e l I n t e n s i t y                                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  GePixelIntensity() returns a single sample intensity value from the
+%  red, green, and blue components of a pixel.
+%
+%  The format of the GetPixelIntensity method is:
+%
+%      GetPixelIntensity(const Image *image,const Quantum *pixel)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o pixel: Specifies a pointer to a Quantum structure.
+%
+*/
+MagickExport MagickRealType GetPixelIntensity(const Image *restrict image,
+  const Quantum *restrict pixel)
+{
+  MagickRealType
+    blue,
+    green,
+    red;
+
+  if (image->colorspace == GRAYColorspace)
+    return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
+  if (image->colorspace != sRGBColorspace)
+    return(0.298839f*pixel[image->channel_map[RedPixelChannel].offset]+
+      0.586811f*pixel[image->channel_map[GreenPixelChannel].offset]+
+      0.114350f*pixel[image->channel_map[BluePixelChannel].offset]);
+  red=DecodePixelGamma((MagickRealType)
+    pixel[image->channel_map[RedPixelChannel].offset]);
+  green=DecodePixelGamma((MagickRealType)
+    pixel[image->channel_map[GreenPixelChannel].offset]);
+  blue=DecodePixelGamma((MagickRealType)
+    pixel[image->channel_map[BluePixelChannel].offset]);
+  return(0.298839f*red+0.586811f*green+0.114350f*blue);
+}
+
 \f
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
index 966d8dd56fd70d6980557b9860740a037dbb3271..474ed59ee8ab797bb937f6156d4485b60da2de16 100644 (file)
@@ -205,6 +205,10 @@ extern MagickExport MagickBooleanType
   IsFuzzyEquivalencePixelInfo(const PixelInfo *,const PixelInfo *),
   SetPixelMetaChannels(Image *,const size_t,ExceptionInfo *);
 
+extern MagickExport MagickRealType
+  GetPixelIntensity(const Image *restrict,const Quantum *restrict)
+    magick_hot_spot;
+
 extern MagickExport PixelChannelMap
   *AcquirePixelChannelMap(void),
   *ClonePixelChannelMap(PixelChannelMap *),