FloatImg4PythonBinding/lib/fimg-compare.c

44 lines
876 B
C
Raw Normal View History

2019-09-10 01:31:48 +02:00
/*
2019-12-27 12:25:33 +01:00
* fimg-compare.c
2019-09-10 01:31:48 +02:00
*
*/
#include <stdio.h>
#include <stdlib.h>
2021-05-20 09:31:28 +02:00
#include <stdint.h>
2019-09-10 01:31:48 +02:00
#include <unistd.h>
#include "string.h"
#include "../floatimg.h"
extern int verbosity; /* must be declared around main() */
/* ---------------------------------------------------------------- */
2020-04-02 14:49:10 +02:00
/*
* return 0 if images are compatibles
*/
2020-04-06 20:09:11 +02:00
int fimg_images_not_compatible(FloatImg *a, FloatImg *b)
2019-09-10 01:31:48 +02:00
{
2020-02-17 07:40:06 +01:00
#if DEBUG_LEVEL > 1
2019-09-10 01:31:48 +02:00
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b);
#endif
if (a->type != b->type) {
if (verbosity) fprintf(stderr, "%p %p != type\n", a, b);
return -10;
}
if (a->width != b->width) {
if (verbosity) fprintf(stderr, "%p %p != width\n", a, b);
return -11;
}
if (a->height != b->height) {
if (verbosity) fprintf(stderr, "%p %p != height\n", a, b);
return -12;
}
return 0;
}
/* ---------------------------------------------------------------- */