added a new function : fimg_put_rgb

This commit is contained in:
tonton Th
2020-03-24 10:41:57 +01:00
parent e9a61bb96a
commit e128add5a6
4 changed files with 26 additions and 2 deletions

View File

@@ -314,3 +314,24 @@ prgb[2] = head->B[offset];
return 0;
}
/* --------------------------------------------------------------------- */
/* nouveau 24 mars 2020 - coronacoding */
int fimg_put_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);
head->R[offset] = prgb[0];
head->G[offset] = prgb[1];
head->B[offset] = prgb[2];
return 0;
}
/* --------------------------------------------------------------------- */