Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/imbuf/intern/divers.c')
-rw-r--r--source/blender/imbuf/intern/divers.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index a8ca282de66..d9ec3bf60c6 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -742,3 +742,10 @@ void IMB_color_to_bw(ImBuf *ibuf)
rct[0]= rct[1]= rct[2]= rgb_to_grayscale_byte(rct);
}
}
+
+void IMB_buffer_float_clamp(float *buf, int width, int height){
+ int i, total = width*height*4;
+ for(i = 0; i < total; i++){
+ buf[i] = MIN2(1.0, buf[i]);
+ }
+}