#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

#1014 in Embedded development

Download history 194/week @ 2024-07-26 287/week @ 2024-08-02 252/week @ 2024-08-09 168/week @ 2024-08-16 230/week @ 2024-08-23 133/week @ 2024-08-30 134/week @ 2024-09-06 89/week @ 2024-09-13 98/week @ 2024-09-20 154/week @ 2024-09-27 76/week @ 2024-10-04 54/week @ 2024-10-11 84/week @ 2024-10-18 106/week @ 2024-10-25 149/week @ 2024-11-01 220/week @ 2024-11-08

579 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