Skip to content

Commit 0a70d07

Browse files
author
cristy
committed
git-svn-id: https://subversion.imagemagick.org/subversion/ImageMagick@14246 aa41f4f7-0bf4-0310-aa73-e5a19afd5a74
1 parent bf62855 commit 0a70d07

File tree

2 files changed

+29
-25
lines changed

2 files changed

+29
-25
lines changed

trunk/MagickCore/identify.c

+19-17
Original file line numberDiff line numberDiff line change
@@ -371,26 +371,28 @@ static ssize_t PrintChannelLocations(FILE *file,const Image *image,
371371
static ssize_t PrintChannelMoments(FILE *file,const PixelChannel channel,
372372
const char *name,const ChannelMoments *channel_moments)
373373
{
374+
register ssize_t
375+
i;
376+
374377
ssize_t
375378
n;
376379

377-
n=FormatLocaleFile(file,"% s:\n",name);
378-
n+=FormatLocaleFile(file," i1: %.*g\n",GetMagickPrecision(),
379-
channel_moments[channel].I1);
380-
n+=FormatLocaleFile(file," i2: %.*g\n",GetMagickPrecision(),
381-
channel_moments[channel].I2);
382-
n+=FormatLocaleFile(file," i3: %.*g\n",GetMagickPrecision(),
383-
channel_moments[channel].I3);
384-
n+=FormatLocaleFile(file," i4: %.*g\n",GetMagickPrecision(),
385-
channel_moments[channel].I4);
386-
n+=FormatLocaleFile(file," i5: %.*g\n",GetMagickPrecision(),
387-
channel_moments[channel].I5);
388-
n+=FormatLocaleFile(file," i6: %.*g\n",GetMagickPrecision(),
389-
channel_moments[channel].I6);
390-
n+=FormatLocaleFile(file," i7: %.*g\n",GetMagickPrecision(),
391-
channel_moments[channel].I7);
392-
n+=FormatLocaleFile(file," i8: %.*g\n",GetMagickPrecision(),
393-
channel_moments[channel].I8);
380+
n=FormatLocaleFile(file," %s:\n",name);
381+
n+=FormatLocaleFile(file," Centroid: %.*g,%.*g\n",
382+
GetMagickPrecision(),channel_moments[channel].centroid.x,
383+
GetMagickPrecision(),channel_moments[channel].centroid.y);
384+
n+=FormatLocaleFile(file," Ellipse Semi-Major/Minor axis: %.*g,%.*g\n",
385+
GetMagickPrecision(),channel_moments[channel].ellipse_axis.x,
386+
GetMagickPrecision(),channel_moments[channel].ellipse_axis.y);
387+
n+=FormatLocaleFile(file," Ellipse angle: %.*g\n",
388+
GetMagickPrecision(),channel_moments[channel].ellipse_angle);
389+
n+=FormatLocaleFile(file," Ellipse eccentricity: %.*g\n",
390+
GetMagickPrecision(),channel_moments[channel].ellipse_eccentricity);
391+
n+=FormatLocaleFile(file," Ellipse intensity: %.*g\n",
392+
GetMagickPrecision(),channel_moments[channel].ellipse_intensity);
393+
for (i=0; i < 8; i++)
394+
n+=FormatLocaleFile(file," I%.20g: %.*g\n",i+1.0,GetMagickPrecision(),
395+
channel_moments[channel].I[i]);
394396
return(n);
395397
}
396398

trunk/MagickCore/statistic.h

+10-8
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ typedef struct _ChannelStatistics
4545
typedef struct _ChannelMoments
4646
{
4747
double
48-
I1,
49-
I2,
50-
I3,
51-
I4,
52-
I5,
53-
I6,
54-
I7,
55-
I8;
48+
I[8];
49+
50+
PointInfo
51+
centroid,
52+
ellipse_axis;
53+
54+
double
55+
ellipse_angle,
56+
ellipse_eccentricity,
57+
ellipse_intensity;
5658
} ChannelMoments;
5759

5860
typedef enum

0 commit comments

Comments
 (0)