#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

#1058 in Embedded development

Download history 210/week @ 2024-08-26 108/week @ 2024-09-02 146/week @ 2024-09-09 72/week @ 2024-09-16 116/week @ 2024-09-23 140/week @ 2024-09-30 65/week @ 2024-10-07 54/week @ 2024-10-14 100/week @ 2024-10-21 109/week @ 2024-10-28 252/week @ 2024-11-04 125/week @ 2024-11-11 88/week @ 2024-11-18 33/week @ 2024-11-25 47/week @ 2024-12-02 111/week @ 2024-12-09

283 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

~99KB