projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35938c1
)
util/format: Use SATURATE
author
Alyssa Rosenzweig
<alyssa.rosenzweig@collabora.com>
Tue, 19 May 2020 15:14:52 +0000
(11:14 -0400)
committer
Marge Bot
<eric+marge@anholt.net>
Tue, 26 May 2020 22:31:31 +0000
(22:31 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
src/util/format/u_format_yuv.h
patch
|
blob
|
history
diff --git
a/src/util/format/u_format_yuv.h
b/src/util/format/u_format_yuv.h
index 3c822bcb148856fdedbf7728b18517f4e2e236e5..37f76dc014cc01c955cf51a691bf6c55d54e5e45 100644
(file)
--- a/
src/util/format/u_format_yuv.h
+++ b/
src/util/format/u_format_yuv.h
@@
-58,9
+58,9
@@
static inline void
util_format_rgb_float_to_yuv(float r, float g, float b,
uint8_t *y, uint8_t *u, uint8_t *v)
{
- const float _r =
CLAMP(r, 0.0f, 1.0f
);
- const float _g =
CLAMP(g, 0.0f, 1.0f
);
- const float _b =
CLAMP(b, 0.0f, 1.0f
);
+ const float _r =
SATURATE(r
);
+ const float _g =
SATURATE(g
);
+ const float _b =
SATURATE(b
);
const float scale = 255.0f;