Thanks for the response.  It strikes me that the primitive NRGBA operations 
(get pixel, set pixel, and the like) would occur far more common in 
practice than encoders, decoders, compress/*, and io, but maybe that's just 
how I tend to use images.

On Tuesday, September 28, 2021 at 5:02:48 PM UTC-6 Nigel Tao wrote:

> On Tue, Sep 28, 2021 at 3:53 AM Scott Pakin <scot...@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/127da67d-5fd2-4ad7-8049-9189a9542f88n%40googlegroups.com.

Reply via email to