big commit for 2 new funcs

This commit is contained in:
2020-02-13 20:44:22 +01:00
parent 68a66dffaa
commit 2b26645b49
7 changed files with 142 additions and 15 deletions

View File

@@ -294,10 +294,23 @@ return 0;
}
/* --------------------------------------------------------------------- */
/* nouveau 12 fevrier 2020 */
int fimg_get_rgb(FloatImg *head, int x, int y, float *prgb)
{
int offset;
if (head->type != FIMG_TYPE_RGB) {
#if DEBUG_LEVEL > 1
fprintf(stderr, "%s : type %d is bad.\n", __func__, head->type);
#endif
return -1;
}
offset = x + (y * head->width);
prgb[0] = head->R[offset];
prgb[1] = head->G[offset];
prgb[2] = head->B[offset];
return 0;
}
/* --------------------------------------------------------------------- */