From: anthony Date: Mon, 9 Apr 2012 05:46:25 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~5864 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ea068a53d23d6dca08f1bce44c8937d54f83b983;p=imagemagick --- diff --git a/MagickCore/composite.c b/MagickCore/composite.c index 0804cd9b4..889ae893f 100644 --- a/MagickCore/composite.c +++ b/MagickCore/composite.c @@ -128,6 +128,53 @@ % */ +/* + Composition based on the SVG specification: + + A Composition is defined by... + Color Function : f(Sc,Dc) where Sc and Dc are the normizalized colors + Blending areas : X = 1 for area of overlap, ie: f(Sc,Dc) + Y = 1 for source preserved + Z = 1 for destination preserved + + Conversion to transparency (then optimized) + Dca' = f(Sc, Dc)*Sa*Da + Y*Sca*(1-Da) + Z*Dca*(1-Sa) + Da' = X*Sa*Da + Y*Sa*(1-Da) + Z*Da*(1-Sa) + + Where... + Sca = Sc*Sa normalized Source color divided by Source alpha + Dca = Dc*Da normalized Dest color divided by Dest alpha + Dc' = Dca'/Da' the desired color value for this channel. + + Da' in in the follow formula as 'gamma' The resulting alpla value. + + Most functions use a blending mode of over (X=1,Y=1,Z=1) this results in + the following optimizations... + gamma = Sa+Da-Sa*Da; + gamma = 1 - QuantiumScale*alpha * QuantiumScale*beta; + opacity = QuantiumScale*alpha*beta; // over blend, optimized 1-Gamma + + The above SVG definitions also definate that Mathematical Composition + methods should use a 'Over' blending mode for Alpha Channel. + It however was not applied for composition modes of 'Plus', 'Minus', + the modulus versions of 'Add' and 'Subtract'. + + Mathematical operator changes to be applied from IM v6.7... + + 1) Modulus modes 'Add' and 'Subtract' are obsoleted and renamed + 'ModulusAdd' and 'ModulusSubtract' for clarity. + + 2) All mathematical compositions work as per the SVG specification + with regard to blending. This now includes 'ModulusAdd' and + 'ModulusSubtract'. + + 3) When the special channel flag 'sync' (syncronize channel updates) + is turned off (enabled by default) then mathematical compositions are + only performed on the channels specified, and are applied + independantally of each other. In other words the mathematics is + performed as 'pure' mathematical operations, rather than as image + operations. +*/ static void CompositeHSB(const Quantum red,const Quantum green, const Quantum blue,double *hue,double *saturation,double *brightness) { @@ -523,53 +570,6 @@ MagickExport MagickBooleanType CompositeImage(Image *image, ssize_t y; - /* - Composition based on the SVG specification: - - A Composition is defined by... - Color Function : f(Sc,Dc) where Sc and Dc are the normizalized colors - Blending areas : X = 1 for area of overlap, ie: f(Sc,Dc) - Y = 1 for source preserved - Z = 1 for destination preserved - - Conversion to transparency (then optimized) - Dca' = f(Sc, Dc)*Sa*Da + Y*Sca*(1-Da) + Z*Dca*(1-Sa) - Da' = X*Sa*Da + Y*Sa*(1-Da) + Z*Da*(1-Sa) - - Where... - Sca = Sc*Sa normalized Source color divided by Source alpha - Dca = Dc*Da normalized Dest color divided by Dest alpha - Dc' = Dca'/Da' the desired color value for this channel. - - Da' in in the follow formula as 'gamma' The resulting alpla value. - - Most functions use a blending mode of over (X=1,Y=1,Z=1) this results in - the following optimizations... - gamma = Sa+Da-Sa*Da; - gamma = 1 - QuantiumScale*alpha * QuantiumScale*beta; - opacity = QuantiumScale*alpha*beta; // over blend, optimized 1-Gamma - - The above SVG definitions also definate that Mathematical Composition - methods should use a 'Over' blending mode for Alpha Channel. - It however was not applied for composition modes of 'Plus', 'Minus', - the modulus versions of 'Add' and 'Subtract'. - - Mathematical operator changes to be applied from IM v6.7... - - 1) Modulus modes 'Add' and 'Subtract' are obsoleted and renamed - 'ModulusAdd' and 'ModulusSubtract' for clarity. - - 2) All mathematical compositions work as per the SVG specification - with regard to blending. This now includes 'ModulusAdd' and - 'ModulusSubtract'. - - 3) When the special channel flag 'sync' (syncronize channel updates) - is turned off (enabled by default) then mathematical compositions are - only performed on the channels specified, and are applied - independantally of each other. In other words the mathematics is - performed as 'pure' mathematical operations, rather than as image - operations. - */ assert(image != (Image *) NULL); assert(image->signature == MagickSignature); if (image->debug != MagickFalse) @@ -772,7 +772,7 @@ MagickExport MagickBooleanType CompositeImage(Image *image, } /* Blur Image by resampling. - FUTURE: this is currently broken, especially for small sigma blurs + FUTURE: this is currently broken, especially for small sigma blurs This needs to be fixed to use a non-user filter setup that provides far more control than currently available. */ diff --git a/MagickCore/morphology.c b/MagickCore/morphology.c index 5263e1065..f105c6104 100644 --- a/MagickCore/morphology.c +++ b/MagickCore/morphology.c @@ -284,9 +284,9 @@ static KernelInfo *ParseKernelArray(const char *kernel_string) if ( args.xi < 0.0 || args.psi < 0.0 ) return(DestroyKernelInfo(kernel)); kernel->x = ((flags & XValue)!=0) ? (ssize_t)args.xi - : (ssize_t) (kernel->width-1)/2; + : (ssize_t) (kernel->width-1)/2; kernel->y = ((flags & YValue)!=0) ? (ssize_t)args.psi - : (ssize_t) (kernel->height-1)/2; + : (ssize_t) (kernel->height-1)/2; if ( kernel->x >= (ssize_t) kernel->width || kernel->y >= (ssize_t) kernel->height ) return(DestroyKernelInfo(kernel)); @@ -328,7 +328,7 @@ static KernelInfo *ParseKernelArray(const char *kernel_string) GetMagickToken(p,&p,token); if ( LocaleCompare("nan",token) == 0 || LocaleCompare("-",token) == 0 ) { - kernel->values[i] = nan; /* do not include this value in kernel */ + kernel->values[i] = nan; /* this value is not part of neighbourhood */ } else { kernel->values[i]=StringToDouble(token,(char **) NULL); @@ -3463,7 +3463,8 @@ static ssize_t MorphologyPrimitiveDirect(Image *image, } break; case VoronoiMorphology: - /* Apply Distance to 'Matte' channel, coping the closest color. + /* Apply Distance to 'Matte' channel, while coping the color + ** values of the closest pixel. ** ** This is experimental, and realy the 'alpha' component should ** be completely separate 'masking' channel so that alpha can diff --git a/MagickCore/option.c b/MagickCore/option.c index 19a1e843c..e5b4c6177 100644 --- a/MagickCore/option.c +++ b/MagickCore/option.c @@ -457,7 +457,7 @@ static const OptionInfo { "+level-colors", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "-level-colors", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "+limit", 0L, DeprecateOptionFlag, MagickTrue }, - { "-limit", 2L, GlobalOptionFlag | ListOperatorOptionFlag | FireOptionFlag, MagickFalse }, + { "-limit", 2L, GlobalOptionFlag | FireOptionFlag, MagickFalse }, { "+linear-stretch", 1L, DeprecateOptionFlag, MagickTrue }, { "-linear-stretch", 1L, SimpleOperatorOptionFlag, MagickFalse }, { "+liquid-rescale", 1L, DeprecateOptionFlag, MagickTrue }, @@ -606,6 +606,7 @@ static const OptionInfo { "-scenes", 1L, NonMagickOptionFlag, MagickFalse }, { "+screen", 0L, NonMagickOptionFlag, MagickFalse }, { "-screen", 1L, NonMagickOptionFlag, MagickFalse }, + { "-script", 1L, UndefinedOptionFlag, MagickFalse }, /* special handling */ { "+seed", 0L, GlobalOptionFlag, MagickFalse }, { "-seed", 1L, GlobalOptionFlag, MagickFalse }, { "+segment", 1L, DeprecateOptionFlag, MagickTrue }, @@ -825,6 +826,7 @@ static const OptionInfo { "Divide", DivideDstCompositeOp, DeprecateOptionFlag, MagickTrue }, { "Minus", MinusDstCompositeOp, DeprecateOptionFlag, MagickTrue }, { "Threshold", ThresholdCompositeOp, DeprecateOptionFlag, MagickTrue }, + { "CopyOpacity", CopyAlphaCompositeOp, UndefinedOptionFlag, MagickTrue }, { (char *) NULL, UndefinedCompositeOp, UndefinedOptionFlag, MagickFalse } }, CompressOptions[] = diff --git a/MagickWand/wandcli.c b/MagickWand/wandcli.c index 9329c33c9..e6c025934 100644 --- a/MagickWand/wandcli.c +++ b/MagickWand/wandcli.c @@ -43,6 +43,7 @@ */ #include "MagickWand/studio.h" #include "MagickWand/MagickWand.h" +#include "MagickWand/wand.h" #include "MagickWand/magick-wand-private.h" #include "MagickWand/wandcli.h" #include "MagickWand/wandcli-private.h" diff --git a/config/english.xml b/config/english.xml index 79aab307d..25a6fb00d 100644 --- a/config/english.xml +++ b/config/english.xml @@ -883,6 +883,9 @@ script token with unbalanced quotes + + unable to open script + unrecognized colormap type diff --git a/config/francais.xml b/config/francais.xml index 1d338deae..ae00b5d13 100644 --- a/config/francais.xml +++ b/config/francais.xml @@ -874,6 +874,9 @@ de script token avec des citations asymétriques + + impossible d'ouvrir le script + type de table de couleurs non reconnnu