added a new function : fimg_put_rgb
This commit is contained in:
@@ -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;
|
||||
}
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user