diff options
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/divers.c | 20 | ||||
-rw-r--r-- | source/blender/imbuf/intern/util.c | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c index 90ee2692cf0..7fc7669601d 100644 --- a/source/blender/imbuf/intern/divers.c +++ b/source/blender/imbuf/intern/divers.c @@ -490,3 +490,23 @@ float *IMB_float_profile_ensure(struct ImBuf *ibuf, int profile, int *alloc) return fbuf; } } + + +/* no profile conversion */ +void IMB_color_to_bw(struct ImBuf *ibuf) +{ + float *rctf= ibuf->rect_float; + unsigned char *rct= (unsigned char *)ibuf->rect; + int i; + if(rctf) { + for (i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4) { + rctf[0]= rctf[1]= rctf[2]= rgb_to_grayscale(rctf); + } + } + + if(rct) { + for (i = ibuf->x * ibuf->y; i > 0; i--, rct+=4) { + rct[0]= rct[1]= rct[2]= rgb_to_grayscale_byte(rct); + } + } +} diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 6e5e87d7e5c..fe85f63e109 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -142,6 +142,9 @@ const char *imb_ext_audio[] = { ".flac", ".wma", ".eac3", + ".aif", + ".aiff", + ".m4a", NULL}; static int IMB_ispic_name(const char *name) |