From: cristy Date: Sat, 6 Sep 2014 00:45:58 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~2042 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c018762fb6f380c9d0b1057ec2390e7422ab5178;p=imagemagick --- diff --git a/MagickCore/compare.c b/MagickCore/compare.c index e30b4ecc5..1fd4a58d8 100644 --- a/MagickCore/compare.c +++ b/MagickCore/compare.c @@ -1160,8 +1160,8 @@ static MagickBooleanType GetPerceptualHashDistortion(const Image *image, alpha, beta; - alpha=image_phash[channel].srgb_moment[i]; - beta=reconstruct_phash[channel].srgb_moment[i]; + alpha=image_phash[channel].srgb_hu_phash[i]; + beta=reconstruct_phash[channel].srgb_hu_phash[i]; difference+=(beta-alpha)*(beta-alpha); } distortion[channel]+=difference; @@ -1191,8 +1191,8 @@ static MagickBooleanType GetPerceptualHashDistortion(const Image *image, alpha, beta; - alpha=image_phash[channel].hclp_moment[i]; - beta=reconstruct_phash[channel].hclp_moment[i]; + alpha=image_phash[channel].hclp_hu_phash[i]; + beta=reconstruct_phash[channel].hclp_hu_phash[i]; difference+=(beta-alpha)*(beta-alpha); } distortion[channel]+=difference; diff --git a/MagickCore/identify.c b/MagickCore/identify.c index 69fc6d4a8..76ecb2bf8 100644 --- a/MagickCore/identify.c +++ b/MagickCore/identify.c @@ -394,8 +394,8 @@ static ssize_t PrintChannelPerceptualHash(FILE *file,const PixelChannel channel, n=FormatLocaleFile(file," %s:\n",name); for (i=0; i < 7; i++) n+=FormatLocaleFile(file," PH%.20g: %.*g, %.*g\n",i+1.0, - GetMagickPrecision(),channel_phash[channel].srgb_moment[i], - GetMagickPrecision(),channel_phash[channel].hclp_moment[i]); + GetMagickPrecision(),channel_phash[channel].srgb_hu_phash[i], + GetMagickPrecision(),channel_phash[channel].hclp_hu_phash[i]); return(n); } diff --git a/MagickCore/statistic.c b/MagickCore/statistic.c index c8270f844..bd3f9b904 100644 --- a/MagickCore/statistic.c +++ b/MagickCore/statistic.c @@ -1749,7 +1749,7 @@ MagickExport ChannelPerceptualHash *GetImagePerceptualHash( return((ChannelPerceptualHash *) NULL); for (channel=0; channel <= MaxPixelChannels; channel++) for (i=0; i < 7; i++) - perceptual_hash[channel].srgb_moment[i]= + perceptual_hash[channel].srgb_hu_phash[i]= (-MagickLog10(moments[channel].I[i])); moments=(ChannelMoments *) RelinquishMagickMemory(moments); /* @@ -1780,7 +1780,7 @@ MagickExport ChannelPerceptualHash *GetImagePerceptualHash( } for (channel=0; channel <= MaxPixelChannels; channel++) for (i=0; i < 7; i++) - perceptual_hash[channel].hclp_moment[i]= + perceptual_hash[channel].hclp_hu_phash[i]= (-MagickLog10(moments[channel].I[i])); moments=(ChannelMoments *) RelinquishMagickMemory(moments); return(perceptual_hash); diff --git a/MagickCore/statistic.h b/MagickCore/statistic.h index 0d7c6252b..5cfceb205 100644 --- a/MagickCore/statistic.h +++ b/MagickCore/statistic.h @@ -60,8 +60,8 @@ typedef struct _ChannelMoments typedef struct _ChannelPerceptualHash { double - srgb_moment[32], - hclp_moment[32]; + srgb_hu_phash[32], + hclp_hu_phash[32]; } ChannelPerceptualHash; typedef enum diff --git a/coders/json.c b/coders/json.c index 412f1a360..541c0c758 100644 --- a/coders/json.c +++ b/coders/json.c @@ -432,12 +432,12 @@ static ssize_t PrintChannelPerceptualHash(FILE *file,const ChannelType channel, for (i=0; i < 6; i++) n+=FormatLocaleFile(file, " \"PH%.20g\": [ \"%.*g\", \"%.*g\" ],\n",i+1.0, - GetMagickPrecision(),channel_phash[channel].srgb_moment[i], - GetMagickPrecision(),channel_phash[channel].hclp_moment[i]); + GetMagickPrecision(),channel_phash[channel].srgb_hu_phash[i], + GetMagickPrecision(),channel_phash[channel].hclp_hu_phash[i]); n+=FormatLocaleFile(file, " \"PH%.20g\": [ \"%.*g\", \"%.*g\" ]\n",i+1.0, - GetMagickPrecision(),channel_phash[channel].srgb_moment[i], - GetMagickPrecision(),channel_phash[channel].hclp_moment[i]); + GetMagickPrecision(),channel_phash[channel].srgb_hu_phash[i], + GetMagickPrecision(),channel_phash[channel].hclp_hu_phash[i]); (void) FormatLocaleFile(file," }"); if (separator != MagickFalse) (void) FormatLocaleFile(file,",");