#srgb #convert #rgb #blend #performance #graphics

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

#1624 in Embedded development

Download history 88/week @ 2024-11-18 33/week @ 2024-11-25 47/week @ 2024-12-02 111/week @ 2024-12-09 75/week @ 2024-12-16 6/week @ 2024-12-30 49/week @ 2025-01-06 106/week @ 2025-01-13 118/week @ 2025-01-20 167/week @ 2025-01-27 150/week @ 2025-02-03 159/week @ 2025-02-10 118/week @ 2025-02-17 180/week @ 2025-02-24 215/week @ 2025-03-03

684 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

~98KB