Changeset 4078
- Timestamp:
- 03/28/11 20:51:23 (2 years ago)
- Location:
- ImageMagick/trunk
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
magick/effect.c (modified) (4 diffs)
-
magick/effect.h (modified) (1 diff)
-
magick/option.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ImageMagick/trunk/ChangeLog
r4077 r4078 1 2011-03-29 6.6.9-1 Cristy <quetzlzacatenango@image...> 2 * Support -statistic standard-deviation option. 3 1 4 2011-03-28 6.6.9-0 Cristy <quetzlzacatenango@image...> 2 5 * New version 6.6.9-0. -
ImageMagick/trunk/magick/effect.c
r4012 r4078 4786 4786 size_t 4787 4787 color, 4788 mean;4788 sum; 4789 4789 4790 4790 ssize_t … … 4802 4802 color=65536L; 4803 4803 count=0; 4804 mean=0;4804 sum=0; 4805 4805 do 4806 4806 { 4807 4807 color=list->nodes[color].next[0]; 4808 mean+=list->nodes[color].count*color;4808 sum+=list->nodes[color].count*color; 4809 4809 count+=list->nodes[color].count; 4810 4810 } while (count < (ssize_t) pixel_list->length); 4811 channels[channel]=(unsigned short) ( mean/pixel_list->length);4811 channels[channel]=(unsigned short) (sum/pixel_list->length); 4812 4812 } 4813 4813 GetMagickPixelPacket((const Image *) NULL,&pixel); … … 5009 5009 color=previous; 5010 5010 channels[channel]=(unsigned short) color; 5011 } 5012 GetMagickPixelPacket((const Image *) NULL,&pixel); 5013 pixel.red=(MagickRealType) ScaleShortToQuantum(channels[0]); 5014 pixel.green=(MagickRealType) ScaleShortToQuantum(channels[1]); 5015 pixel.blue=(MagickRealType) ScaleShortToQuantum(channels[2]); 5016 pixel.opacity=(MagickRealType) ScaleShortToQuantum(channels[3]); 5017 pixel.index=(MagickRealType) ScaleShortToQuantum(channels[4]); 5018 return(pixel); 5019 } 5020 5021 static MagickPixelPacket GetStandardDeviationPixelList(PixelList *pixel_list) 5022 { 5023 MagickPixelPacket 5024 pixel; 5025 5026 register SkipList 5027 *list; 5028 5029 register ssize_t 5030 channel; 5031 5032 size_t 5033 color, 5034 sum, 5035 sum_squared; 5036 5037 ssize_t 5038 count; 5039 5040 unsigned short 5041 channels[ListChannels]; 5042 5043 /* 5044 Find the mean value for each of the color. 5045 */ 5046 for (channel=0; channel < 5; channel++) 5047 { 5048 list=pixel_list->lists+channel; 5049 color=65536L; 5050 count=0; 5051 sum=0; 5052 do 5053 { 5054 color=list->nodes[color].next[0]; 5055 sum+=list->nodes[color].count*color; 5056 sum_squared+=(list->nodes[color].count*color)* 5057 (list->nodes[color].count*color); 5058 count+=list->nodes[color].count; 5059 } while (count < (ssize_t) pixel_list->length); 5060 channels[channel]=(unsigned short) sqrt((sum_squared/pixel_list->length)- 5061 ((sum/pixel_list->length)*(sum/pixel_list->length))); 5011 5062 } 5012 5063 GetMagickPixelPacket((const Image *) NULL,&pixel); … … 5253 5304 { 5254 5305 pixel=GetNonpeakPixelList(pixel_list[id]); 5306 break; 5307 } 5308 case StandardDeviationStatistic: 5309 { 5310 pixel=GetStandardDeviationPixelList(pixel_list[id]); 5255 5311 break; 5256 5312 } -
ImageMagick/trunk/magick/effect.h
r3900 r4078 67 67 MinimumStatistic, 68 68 ModeStatistic, 69 NonpeakStatistic 69 NonpeakStatistic, 70 StandardDeviationStatistic 70 71 } StatisticType; 71 72 -
ImageMagick/trunk/magick/option.c
r4036 r4078 1457 1457 { "Mode", (ssize_t) ModeStatistic, MagickFalse }, 1458 1458 { "Nonpeak", (ssize_t) NonpeakStatistic, MagickFalse }, 1459 { "StandardDeviation", (ssize_t) StandardDeviationStatistic, MagickFalse }, 1459 1460 { (char *) NULL, (ssize_t) UndefinedMethod, MagickFalse } 1460 1461 },
Note: See TracChangeset
for help on using the changeset viewer.
