]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Thu, 11 Aug 2011 02:35:43 +0000 (02:35 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Thu, 11 Aug 2011 02:35:43 +0000 (02:35 +0000)
Magick++/lib/Image.cpp
MagickCore/enhance.c
MagickCore/enhance.h
MagickCore/magick-config.h
MagickWand/magick-image.c
MagickWand/mogrify.c

index 7d20f4b24472e00ec59d865fc9a7ce33ab17a4f4..15255b916ac7b65d29aea65bd60882b0c20ddb81 100644 (file)
@@ -575,8 +575,11 @@ void Magick::Image::chop( const Geometry &geometry_ )
 void Magick::Image::cdl ( const std::string &cdl_ )
 {
   modifyImage();
-  (void) ColorDecisionListImage( image(), cdl_.c_str() );
-  throwImageException();
+  ExceptionInfo exceptionInfo;
+  GetExceptionInfo( &exceptionInfo );
+  (void) ColorDecisionListImage( image(), cdl_.c_str(), &exceptionInfo );
+  throwException( exceptionInfo );
+  (void) DestroyExceptionInfo( &exceptionInfo );
 }
 
 // Colorize
index 966b598138c67a4378ec1856d9d3244ee6a2e730..6f5b50ce08dadc1b57e38cf6606e43cab53bb5f4 100644 (file)
@@ -455,7 +455,7 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image,
 %  The format of the ColorDecisionListImage method is:
 %
 %      MagickBooleanType ColorDecisionListImage(Image *image,
-%        const char *color_correction_collection)
+%        const char *color_correction_collection,ExceptionInfo *exception)
 %
 %  A description of each parameter follows:
 %
@@ -463,9 +463,11 @@ MagickExport MagickBooleanType ClutImage(Image *image,const Image *clut_image,
 %
 %    o color_correction_collection: the color correction collection in XML.
 %
+%    o exception: return any errors or warnings in this structure.
+%
 */
 MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
-  const char *color_correction_collection)
+  const char *color_correction_collection,ExceptionInfo *exception)
 {
 #define ColorDecisionListCorrectImageTag  "ColorDecisionList/Image"
 
@@ -501,9 +503,6 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
     *content,
     *p;
 
-  ExceptionInfo
-    *exception;
-
   MagickBooleanType
     status;
 
@@ -534,7 +533,7 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
   if (color_correction_collection == (const char *) NULL)
     return(MagickFalse);
-  ccc=NewXMLTree((const char *) color_correction_collection,&image->exception);
+  ccc=NewXMLTree((const char *) color_correction_collection,exception);
   if (ccc == (XMLTreeInfo *) NULL)
     return(MagickFalse);
   cc=GetXMLTreeChild(ccc,"ColorCorrection");
@@ -712,14 +711,14 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
 #endif
   for (i=0; i <= (ssize_t) MaxMap; i++)
   {
-    cdl_map[i].red=ClampToQuantum((MagickRealType) ScaleMapToQuantum((
-      MagickRealType) (MaxMap*(pow(color_correction.red.slope*i/MaxMap+
+    cdl_map[i].red=ClampToQuantum((MagickRealType) ScaleMapToQuantum(
+      (MagickRealType) (MaxMap*(pow(color_correction.red.slope*i/MaxMap+
       color_correction.red.offset,color_correction.red.power)))));
-    cdl_map[i].green=ClampToQuantum((MagickRealType) ScaleMapToQuantum((
-      MagickRealType) (MaxMap*(pow(color_correction.green.slope*i/MaxMap+
+    cdl_map[i].green=ClampToQuantum((MagickRealType) ScaleMapToQuantum(
+      (MagickRealType) (MaxMap*(pow(color_correction.green.slope*i/MaxMap+
       color_correction.green.offset,color_correction.green.power)))));
-    cdl_map[i].blue=ClampToQuantum((MagickRealType) ScaleMapToQuantum((
-      MagickRealType) (MaxMap*(pow(color_correction.blue.slope*i/MaxMap+
+    cdl_map[i].blue=ClampToQuantum((MagickRealType) ScaleMapToQuantum(
+      (MagickRealType) (MaxMap*(pow(color_correction.blue.slope*i/MaxMap+
       color_correction.blue.offset,color_correction.blue.power)))));
   }
   if (image->storage_class == PseudoClass)
@@ -737,13 +736,15 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
 
         luma=0.2126*image->colormap[i].red+0.7152*image->colormap[i].green+
           0.0722*image->colormap[i].blue;
-        image->colormap[i].red=ClampToQuantum(luma+color_correction.saturation*
-          cdl_map[ScaleQuantumToMap(image->colormap[i].red)].red-luma);
+        image->colormap[i].red=ClampToQuantum(luma+
+          color_correction.saturation*cdl_map[ScaleQuantumToMap(
+          image->colormap[i].red)].red-luma);
         image->colormap[i].green=ClampToQuantum(luma+
           color_correction.saturation*cdl_map[ScaleQuantumToMap(
           image->colormap[i].green)].green-luma);
-        image->colormap[i].blue=ClampToQuantum(luma+color_correction.saturation*
-          cdl_map[ScaleQuantumToMap(image->colormap[i].blue)].blue-luma);
+        image->colormap[i].blue=ClampToQuantum(luma+
+          color_correction.saturation*cdl_map[ScaleQuantumToMap(
+          image->colormap[i].blue)].blue-luma);
       }
     }
   /*
@@ -751,7 +752,6 @@ MagickExport MagickBooleanType ColorDecisionListImage(Image *image,
   */
   status=MagickTrue;
   progress=0;
-  exception=(&image->exception);
   image_view=AcquireCacheView(image);
 #if defined(MAGICKCORE_OPENMP_SUPPORT)
   #pragma omp parallel for schedule(dynamic,4) shared(progress,status)
index 909256dbc06c8a286058d4ef96b4ae1fc6c56229..fcebcebab9da7fd3148d3a0d5d9981d4c1a61f5e 100644 (file)
@@ -27,7 +27,7 @@ extern MagickExport MagickBooleanType
   AutoLevelImage(Image *,ExceptionInfo *),
   BrightnessContrastImage(Image *,const double,const double,ExceptionInfo *),
   ClutImage(Image *,const Image *,ExceptionInfo *),
-  ColorDecisionListImage(Image *,const char *),
+  ColorDecisionListImage(Image *,const char *,ExceptionInfo *),
   ContrastImage(Image *,const MagickBooleanType),
   ContrastStretchImage(Image *,const double,const double),
   EqualizeImage(Image *image),
index 500da0bb60145bfb7a8368d9346b13a533721997..60334d7b94cf6fee05d1743764d535c4bcdb04ab 100644 (file)
 
 /* Define to the system default library search path. */
 #ifndef MAGICKCORE_LT_DLSEARCH_PATH
-#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/xulrunner-2"
 #endif
 
 /* The archive extension */
index 01a95840e3bafefbdcc1a59b7e82db0ea5828a72..6c9786c6a5b843fe7dc9ed8fecc7bb9f284577a0 100644 (file)
@@ -1404,9 +1404,8 @@ WandExport MagickBooleanType MagickColorDecisionListImage(MagickWand *wand,
     (void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
   if (wand->images == (Image *) NULL)
     ThrowWandException(WandError,"ContainsNoImages",wand->name);
-  status=ColorDecisionListImage(wand->images,color_correction_collection);
-  if (status == MagickFalse)
-    InheritException(wand->exception,&wand->images->exception);
+  status=ColorDecisionListImage(wand->images,color_correction_collection,
+    &wand->images->exception);
   return(status);
 }
 \f
index 945ca11b9532ab484b4ccd31347f495f7aec9cdf..a06d28f5bfb89eb42b60a00e47277270bf28e11f 100644 (file)
@@ -977,7 +977,8 @@ WandExport MagickBooleanType MogrifyImage(ImageInfo *image_info,const int argc,
             color_correction_collection=FileToString(argv[i+1],~0,exception);
             if (color_correction_collection == (char *) NULL)
               break;
-            (void) ColorDecisionListImage(*image,color_correction_collection);
+            (void) ColorDecisionListImage(*image,color_correction_collection,
+              exception);
             InheritException(exception,&(*image)->exception);
             break;
           }