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

@@ -31,7 +31,9 @@ if (src->type != FIMG_TYPE_RGB) {
/* check if dst pic is not allocated */
if ( 0 == (dst->type | dst->width | dst->height) ) {
#if DEBUG_LEVEL
fprintf(stderr, "in %s, %p is empty\n", __func__, dst);
#endif
/* OK allocate a new fpic */
foo = fimg_create(dst, src->height, src->width, src->type);
if (foo) {
@@ -54,7 +56,7 @@ if ( (src->type != dst->type) ||
for (y=0; y<src->height; y++) {
for (x=0; x<src->width; x++) {
fimg_get_rgb(src, x, y, rgb);
fimg_plot_rgb(dst, y, x, rgb[0], rgb[1], rgb[2]);
fimg_put_rgb(dst, y, x, rgb);
}
}