#srgb #convert #rgb #blend #performance #no-std-compatible #fast

no-std blend-srgb

A small, #![no_std]-compatible sRGB conversion and blending library designed for performance

2 releases

0.1.1 Jun 15, 2022
0.1.0 Jun 15, 2022

#986 in Embedded development

Download history 40/week @ 2023-11-20 91/week @ 2023-11-27 81/week @ 2023-12-04 39/week @ 2023-12-11 14/week @ 2023-12-18 36/week @ 2023-12-25 43/week @ 2024-01-01 65/week @ 2024-01-08 27/week @ 2024-01-15 115/week @ 2024-01-22 91/week @ 2024-01-29 171/week @ 2024-02-05 133/week @ 2024-02-12 57/week @ 2024-02-19 69/week @ 2024-02-26 48/week @ 2024-03-04

315 downloads per month
Used in stackblur-iter

MIT license

10KB
116 lines

blend-srgb is a small, #![no_std]-compatible sRGB conversion and blending library designed for performance.

It provides a small number of helper functions for converting and blending sRGB values. See the documentation for more details.


lib.rs:

blend-srgb is a small, #![no_std]-compatible sRGB conversion and blending library designed for performance.

It provides a small number of helper functions for converting and blending sRGB values:

Additionally, these functions are designed to be performant enough to be used in software composition pipelines. To facilitate this, a small (4.5k) lookup table is included. The lookup table can be small due to the usage of 12-bit linear values rather than 16-bit. 12 bits are enough to store all 8-bit sRGB values in linear space.

All functions other than srgb_to_rgb and rgb_to_srgb use only integer operations, and are therefore fully compatible with #![no_std]. To activate #![no_std], just deactivate the std feature. To keep the floating-point methods, also add the libm feature.

Dependencies

~105KB