#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

#1072 in Embedded development

Download history 101/week @ 2024-04-09 103/week @ 2024-04-16 153/week @ 2024-04-23 103/week @ 2024-04-30 160/week @ 2024-05-07 142/week @ 2024-05-14 165/week @ 2024-05-21 95/week @ 2024-05-28 30/week @ 2024-06-04 62/week @ 2024-06-11 80/week @ 2024-06-18 111/week @ 2024-06-25 66/week @ 2024-07-02 65/week @ 2024-07-09 116/week @ 2024-07-16 147/week @ 2024-07-23

403 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