Function fast_srgb8::f32x4_to_srgb8
source · pub fn f32x4_to_srgb8(input: [f32; 4]) -> [u8; 4]
Expand description
Performs 4 simultaneous calls to f32_to_srgb8
, and returns 4 results.
If available, this uses SIMD to perform all 4 computations simultaneously —
currently this is just on x86_64 and x86 targets that suppost SSE2 (which in
practice will be all x86_64 (aside from weird things like OS kernels), and
all Rust targets beginning with i686-
). On machines where it cannot use
the CPU’s vector instructions, this function simply performs 4 calls to
f32_to_srgb8
.
The check for this support is performed at compile time, so it does no runtime SIMD feature checks. This seems like the right call for SSE2.
Behavior is otherwise exactly (bitwise) identical to f32_to_srgb8
, so see
it’s documentation for more information.