emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Removing assumption of unsigned long pixel values for colours


From: Alex Gramiak
Subject: Re: Removing assumption of unsigned long pixel values for colours
Date: Mon, 06 May 2019 10:29:38 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> Ideally, but if there is no way to represent a certain precision on a
>> particular platform, and if the size of structures is of concern to you,
>> then would it not make sense to only support the maximum precision
>> possible?
>> 
>> I meant something along the lines of:
>> 
>>   #ifdef <Using a platform needing 64-bits>
>>   typedef unsigned long long emacs_pixel;
>>   #else
>>   typedef unsigned long emacs_pixel;
>>   #endif
>
> This will bite us at some point because we currently more or less
> expose the X color values to users.

What do you mean here? Where is the pixel value exposed? I see that
color-values exposes a 16 bpc RGB representation, which the unsigned
long long still supports (as long as it uses 16 bpc with an alpha
channel, which is what I want to use it for).

>> P.S. You mention "platform-independent representation of standard
>> colors", but isn't the unsigned long used differently on different
>> platforms already? NS and X seem to use it as indices to color tables
>> (AFAIU X uses the pixel value to lookup a 48-bpp RGB triplet and store
>> it in an XColor), and w32 uses it to embed a COLORREF.
>
> COLORREF is just the RGB representation of a color, see
>
>   https://docs.microsoft.com/en-us/windows/desktop/gdi/colorref

Right, but my point is that AFAIU the unsigned long value is used in a
different manor (embedded rather than used to lookup a value) on the w32
side, so it could be viewed that the representation of colors is already
platform-dependent.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]