diff --git a/lib/fimg-core.c b/lib/fimg-core.c index 8d272ea6..40ee79ff 100644 --- a/lib/fimg-core.c +++ b/lib/fimg-core.c @@ -164,6 +164,28 @@ if ( ! fimg_type_is_valid(fimg->type) ) { size = fimg->width * fimg->height * fimg->type * sizeof(float); memset(fimg->R, 0, size); +return 0; +} +/* --------------------------------------------------------------------- */ +int fimg_rgb_constant(FloatImg *head, float r, float g, float b) +{ +int idx, size; + +fprintf(stderr, ">>> %-25s ( %p %f %f %f )\n", __func__, head, + r, g, b); + +if (head->type != FIMG_TYPE_RGB) { + return -21; + } + +size = head->width * head->height; + +for (idx=0; idxR[idx] = r; + head->G[idx] = g; + head->B[idx] = b; + } + return 0; } /* --------------------------------------------------------------------- */