From: cristy Date: Thu, 11 Aug 2011 02:35:43 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~7190 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1bfa9f0ec23fac5516e142428bd4e250e19b3c67;p=imagemagick --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 7d20f4b24..15255b916 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -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 diff --git a/MagickCore/enhance.c b/MagickCore/enhance.c index 966b59813..6f5b50ce0 100644 --- a/MagickCore/enhance.c +++ b/MagickCore/enhance.c @@ -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) diff --git a/MagickCore/enhance.h b/MagickCore/enhance.h index 909256dbc..fcebcebab 100644 --- a/MagickCore/enhance.h +++ b/MagickCore/enhance.h @@ -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), diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h index 500da0bb6..60334d7b9 100644 --- a/MagickCore/magick-config.h +++ b/MagickCore/magick-config.h @@ -1212,7 +1212,7 @@ /* 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 */ diff --git a/MagickWand/magick-image.c b/MagickWand/magick-image.c index 01a95840e..6c9786c6a 100644 --- a/MagickWand/magick-image.c +++ b/MagickWand/magick-image.c @@ -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); } diff --git a/MagickWand/mogrify.c b/MagickWand/mogrify.c index 945ca11b9..a06d28f5b 100644 --- a/MagickWand/mogrify.c +++ b/MagickWand/mogrify.c @@ -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; }