On Tue, Sep 28, 2021 at 3:53 AM Scott Pakin <scott...@pakin.org> wrote:

> I'm curious: Why does image.NRGBA64 define Pix as a []uint8 and
> perpetually pack pairs of uint8 values into a uint16?  Wouldn't it have
> been easier and faster to define Pix as a []uint16 and Stride to be a
> stride in uint16s rather than uint8s?


It would have been easier for some things, but it would make it harder to
work with the encoders and decoders. The compress/* and io packages work
with []uint8, not []uint16.

There didn't seem to be perfect solution, only trade-offs.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOeFMNXMrMeGwzXda3MevLcghqh9K%2BYu1PLq07yVGiZnDhrJbw%40mail.gmail.com.

Reply via email to