diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-12-09 12:01:44 +0300 |
commit | 9e365069afe156f33fadfad9705e1325f894cd54 (patch) | |
tree | 78373044d029feb51f987b45208e0c1a36958625 /source/blender/blenlib/intern/math_color_inline.c | |
parent | d8b42751625c915113b64f5a2d9c72f19f009fee (diff) |
Cleanup: move public doc-strings into headers for 'blenlib'
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
Diffstat (limited to 'source/blender/blenlib/intern/math_color_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_color_inline.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index 24c4143e587..febe1568176 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -271,20 +271,6 @@ MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack) * * \{ */ -/** - * ITU-R BT.709 primaries - * https://en.wikipedia.org/wiki/Relative_luminance - * - * Real values are: - * `Y = 0.2126390059(R) + 0.7151686788(G) + 0.0721923154(B)` - * according to: "Derivation of Basic Television Color Equations", RP 177-1993 - * - * As this sums slightly above 1.0, the document recommends to use: - * `0.2126(R) + 0.7152(G) + 0.0722(B)`, as used here. - * - * The high precision values are used to calculate the rounded byte weights so they add up to 255: - * `54(R) + 182(G) + 19(B)` - */ MINLINE float rgb_to_grayscale(const float rgb[3]) { return (0.2126f * rgb[0]) + (0.7152f * rgb[1]) + (0.0722f * rgb[2]); @@ -317,11 +303,11 @@ MINLINE int compare_rgb_uchar(const unsigned char col_a[3], return 0; } -/* Using a triangle distribution which gives a more final uniform noise. - * See Banding in Games:A Noisy Rant(revision 5) Mikkel Gjøl, Playdead (slide 27) */ -/* Return triangle noise in [-0.5..1.5[ range */ MINLINE float dither_random_value(float s, float t) { + /* Using a triangle distribution which gives a more final uniform noise. + * See Banding in Games:A Noisy Rant(revision 5) Mikkel Gjøl, Playdead (slide 27) */ + /* Uniform noise in [0..1[ range, using common GLSL hash function. * https://stackoverflow.com/questions/12964279/whats-the-origin-of-this-glsl-rand-one-liner. */ float hash0 = sinf(s * 12.9898f + t * 78.233f) * 43758.5453f; |