Juicy.Pixels
Juicy.Pixels copied to clipboard
Addition of `paletteSize`, while removing private field of `Palette'`
From what I gather _paletteSize
is an unnecessary field in Palette'
, since it can be deduced from the size of _paletteData
and the type of pixel, which is exactly the way that the newly added paletteSize
is implemented. Couple benefits that come from this change:
-
Palette'
is now anewtype
aroundVector
, hence slight reduction to memory usage and overall improvement to performance - Safety improvement: Exposing private
_paletteSize
that is coupled to the actual data allows construction of incorrectPalette'
, which opens a possibility of a segfault when using images converted from such palettes bypalettedAsImage
At this point, while this is a worthwhile enhancement, I wouldn't break compatibility for such "low" issue, has to keep it in mind in case of bigger breaking change
@Twinside I agree, that bundling this together with a bigger breaking change is a good idea.