From eaad4db6f944834badd8c41a2d9205986186c2dd Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 3 Aug 2008 02:17:15 +0000 Subject: [PATCH] * measure.c: there is now pipi_measure_msd in addition to pipi_measure_rmsd. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2650 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/measure.c | 7 ++++++- pipi/pipi.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pipi/measure.c b/pipi/measure.c index c094e64..4ebd35d 100644 --- a/pipi/measure.c +++ b/pipi/measure.c @@ -25,6 +25,11 @@ #include "pipi_internals.h" double pipi_measure_rmsd(pipi_image_t *i1, pipi_image_t *i2) +{ + return sqrt(pipi_measure_msd(i1, i2)); +} + +double pipi_measure_msd(pipi_image_t *i1, pipi_image_t *i2) { pipi_format_t f1, f2; double ret = 0.0; @@ -57,6 +62,6 @@ double pipi_measure_rmsd(pipi_image_t *i1, pipi_image_t *i2) i1->last_modified = f1; i2->last_modified = f2; - return sqrt(ret / (w * h)); + return ret / (w * h); } diff --git a/pipi/pipi.h b/pipi/pipi.h index 6642569..f06e982 100644 --- a/pipi/pipi.h +++ b/pipi/pipi.h @@ -59,6 +59,7 @@ extern void pipi_save(pipi_image_t *, const char *); extern pipi_pixels_t *pipi_getpixels(pipi_image_t *, pipi_format_t); +extern double pipi_measure_msd(pipi_image_t *, pipi_image_t *); extern double pipi_measure_rmsd(pipi_image_t *, pipi_image_t *); extern pipi_image_t *pipi_resize(pipi_image_t *, int, int);