forked from tTh/FloatImg
big commit for 2 new funcs
This commit is contained in:
@@ -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;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user