colors
sug0 opened this issue · comments
Tiago Carvalho commented
- Add
im_initcolor_*
methods forColor_t
- Add
cap
field toColor_t
to prevent future wasteful memory allocations, namely inif (unlikely(!dst->color || (dst->color && dst->size < sizeof(uint8_t))))
which should become...if (unlikely(!dst->color || (dst->color && dst->cap < sizeof(uint8_t))))
- New allocations should save the
cap
of the region - If
Color_t
is modified to contain a new type of color, thensize
should be updated in accordance with the storage used