sug0 / libgoimg

C library that aims to provide the ease of operation Go enables for image processing

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

colors

sug0 opened this issue · comments

  • Add im_initcolor_* methods for Color_t
  • Add cap field to Color_t to prevent future wasteful memory allocations, namely in
    • if (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, then size should be updated in accordance with the storage used