renaming a function for clarity
This commit is contained in:
parent
dd9ac7c948
commit
22e16d2ba6
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
% \lstset{frame=single} % dessin d'un cadre autour du listing
|
% \lstset{frame=single} % dessin d'un cadre autour du listing
|
||||||
\lstset{basicstyle=\ttfamily\small}
|
\lstset{basicstyle=\ttfamily\small}
|
||||||
\lstset{aboveskip=0.333em,belowskip=0.666em}
|
\lstset{aboveskip=0.222em,belowskip=0.222em}
|
||||||
|
|
||||||
\usepackage{babel}
|
\usepackage{babel}
|
||||||
|
|
||||||
@ -355,9 +355,12 @@ classiques : gray, rgb et rgba. et expliquées quelques lignes plus haut.
|
|||||||
|
|
||||||
Comme vous allez le voir plus loin, il y a plein de fonctions qui
|
Comme vous allez le voir plus loin, il y a plein de fonctions qui
|
||||||
prennent en argument deux images: une source et une destination.
|
prennent en argument deux images: une source et une destination.
|
||||||
|
Et dans la plupart des cas, ces deux images doivent être compatibles,
|
||||||
|
c'est à dire même type et mêmes dimensions.
|
||||||
|
|
||||||
\begin{lstlisting}
|
\begin{lstlisting}
|
||||||
int fimg_images_compatible(FloatImg *a, FloatImg *b);
|
/* return 0 if compatible */
|
||||||
|
int fimg_images_not_compatible(FloatImg *a, FloatImg *b);
|
||||||
\end{lstlisting}
|
\end{lstlisting}
|
||||||
|
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ int fimg_add_rgb(FloatImg *head, int x, int y, float r, float g, float b);
|
|||||||
int fimg_rgb_constant(FloatImg *head, float r, float g, float b);
|
int fimg_rgb_constant(FloatImg *head, float r, float g, float b);
|
||||||
|
|
||||||
/* --> lib/fimg-compare.c */
|
/* --> lib/fimg-compare.c */
|
||||||
int fimg_images_compatible(FloatImg *a, FloatImg *b);
|
int fimg_images_not_compatible(FloatImg *a, FloatImg *b);
|
||||||
|
|
||||||
int fimg_interpolate(FloatImg *s1, FloatImg *s2, FloatImg *d, float coef);
|
int fimg_interpolate(FloatImg *s1, FloatImg *s2, FloatImg *d, float coef);
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ extern int verbosity; /* must be declared around main() */
|
|||||||
/*
|
/*
|
||||||
* return 0 if images are compatibles
|
* return 0 if images are compatibles
|
||||||
*/
|
*/
|
||||||
int fimg_images_compatible(FloatImg *a, FloatImg *b)
|
int fimg_images_not_compatible(FloatImg *a, FloatImg *b)
|
||||||
{
|
{
|
||||||
#if DEBUG_LEVEL > 1
|
#if DEBUG_LEVEL > 1
|
||||||
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b);
|
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b);
|
||||||
|
@ -194,7 +194,7 @@ int foo;
|
|||||||
fprintf(stderr, ">>> %-25s ( %p %p )\n", __func__, from, to);
|
fprintf(stderr, ">>> %-25s ( %p %p )\n", __func__, from, to);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
foo = fimg_images_compatible(from, to);
|
foo = fimg_images_not_compatible(from, to);
|
||||||
if (foo) {
|
if (foo) {
|
||||||
fprintf(stderr, "%s: pics not compatible (%d)\n", __func__, foo);
|
fprintf(stderr, "%s: pics not compatible (%d)\n", __func__, foo);
|
||||||
return foo;
|
return foo;
|
||||||
|
@ -46,13 +46,13 @@ fprintf(stderr, ">>> %s ( %p %p %p %f )\n", __func__,
|
|||||||
s1, s2, d, coef);
|
s1, s2, d, coef);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
foo = fimg_images_compatible(s1, s2);
|
foo = fimg_images_not_compatible(s1, s2);
|
||||||
if (foo) {
|
if (foo) {
|
||||||
fprintf(stderr, "compat s1 s2 -> %d\n", foo);
|
fprintf(stderr, "compat s1 s2 -> %d\n", foo);
|
||||||
return foo;
|
return foo;
|
||||||
}
|
}
|
||||||
|
|
||||||
foo = fimg_images_compatible(s1, d);
|
foo = fimg_images_not_compatible(s1, d);
|
||||||
if (foo) {
|
if (foo) {
|
||||||
fprintf(stderr, "compat s1 d -> %d\n", foo);
|
fprintf(stderr, "compat s1 d -> %d\n", foo);
|
||||||
return foo;
|
return foo;
|
||||||
|
@ -153,7 +153,7 @@ if (verbosity > 1) { /* please, debug me */
|
|||||||
fimg_describe(&srcB, argv[optind+1]);
|
fimg_describe(&srcB, argv[optind+1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
foo = fimg_images_compatible(&srcA, &srcB);
|
foo = fimg_images_not_compatible(&srcA, &srcB);
|
||||||
if (foo) {
|
if (foo) {
|
||||||
fprintf(stderr, "images are not compatibles, %d\n", foo);
|
fprintf(stderr, "images are not compatibles, %d\n", foo);
|
||||||
exit(4);
|
exit(4);
|
||||||
|
Loading…
Reference in New Issue
Block a user