diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-08 21:51:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-08 21:51:28 +0400 |
commit | 2580575658c17538baf2770ef823cf21c7ec1710 (patch) | |
tree | e93e697cc7c2911229eec3003c3524b1db0f45a0 | |
parent | 063f78041af082222f8a5c6dc4fd3f6f956ae9fe (diff) |
correct another case of nonnull (all should be correct now), and comment about color conversion.
-rw-r--r-- | source/blender/blenkernel/BKE_idprop.h | 2 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_color_inline.c | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h index 0f9c987b47c..3cf4a2c5cdc 100644 --- a/source/blender/blenkernel/BKE_idprop.h +++ b/source/blender/blenkernel/BKE_idprop.h @@ -180,7 +180,7 @@ __attribute__((nonnull)) int IDP_InsertToGroup(struct IDProperty *group, struct IDProperty *previous, struct IDProperty *pnew) #ifdef __GNUC__ -__attribute__((nonnull)) +__attribute__((nonnull (1, 3))) /* 'group', 'pnew' */ #endif ; diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index a3835b5bb4a..6b90cbfe9c3 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -237,6 +237,10 @@ MINLINE float rgb_to_bw(const float rgb[3]) return 0.35f * rgb[0] + 0.45f * rgb[1] + 0.2f * rgb[2]; } +/* non-linear luma from ITU-R BT.601-2 + * see: http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html#RTFToC11 + * note: the values used for are not exact matches to those documented above, + * but they are from the same */ MINLINE float rgb_to_grayscale(const float rgb[3]) { return 0.3f * rgb[0] + 0.58f * rgb[1] + 0.12f * rgb[2]; |