From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Alex Gramiak Newsgroups: gmane.emacs.devel Subject: Re: Removing assumption of unsigned long pixel values for colours Date: Mon, 06 May 2019 10:29:38 -0600 Message-ID: <874l67k0lp.fsf@gmail.com> References: <87v9yqjdnh.fsf@gmail.com> <83a7g2kqsi.fsf@gnu.org> <87lfzlkeic.fsf@gmail.com> <83zho0khdu.fsf@gnu.org> <87h8a8k84a.fsf@gmail.com> <83pnowjo63.fsf@gnu.org> <87d0kvk489.fsf@gmail.com> <83ftprk2nj.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="2422"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 06 18:30:16 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hNgVL-0000Ut-Ve for ged-emacs-devel@m.gmane.org; Mon, 06 May 2019 18:30:16 +0200 Original-Received: from localhost ([127.0.0.1]:59119 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNgVK-0003H6-V8 for ged-emacs-devel@m.gmane.org; Mon, 06 May 2019 12:30:14 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:49859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hNgUi-0003Gz-4x for emacs-devel@gnu.org; Mon, 06 May 2019 12:29:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hNgUh-0006uC-1q for emacs-devel@gnu.org; Mon, 06 May 2019 12:29:36 -0400 Original-Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:44887) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hNgUg-0006tn-O6; Mon, 06 May 2019 12:29:34 -0400 Original-Received: by mail-pf1-x42f.google.com with SMTP id y13so7037418pfm.11; Mon, 06 May 2019 09:29:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=whytryOLKoValmojpgyiCAPDAsSWWvt2qSRxIzDfgh0=; b=gXFm36NR3EDddJhpNOGXp1H9wj9iPhKPusMQkwp2xF4Su74ktf1PiibsTUjTSQONw5 0cT1SH1IT9xmcgBicdaIrgWrjpmmKCRtiQ1hTUi5wtGTjFns5G0bawH7SHLmOY3RdvUf XwqDp30JlMtWBFiUyfoTM+SBXeyM1/bzhwQ8aP+1xaFIsUoKvCFjgLLTWw7pfhuvBKbu uJjjvmWHgu1d9AUKYje/bNML8XZLR2O7RUIszHkHf+z0BG0fNc8uh06QHeDg6EWJ6z5Y JBm/CroNnYQ/TbddzO0Yfi9KxtFxIp+Dak59xg56cXgkPetiaq7kdrWRQuYMetVmvMnU wmoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=whytryOLKoValmojpgyiCAPDAsSWWvt2qSRxIzDfgh0=; b=p1KGUXFgj/E8APFxpge4KNKgIfie3S8o9NKyDzj+C/B2kqlZ0BZXB6phAffJmkbDGj 1uKhn/BP3hZIpDo4OF1tTDdR/BQOfckRydTDWCgHDDBRvezWGMcWSBsaee8kj09EK3WD bTlUNHMUCByGCWtPLyuHfpi9TBF4/oO5s7POiKcQTKU2nZRQGvchbRxfuihYnyutpLnL uHM3xxOaAWvir7ydPvTkT2jzQsajecja97mz+8weieJpNV6ROIjgrMyP9GHUizqgnlIW r6IiuDf4oMbfYkWB2TPo9iRZot8nH/KgSxIL+pg9/DEXj/uSpAEJlfjvJ8voxdmuWcXL MIWQ== X-Gm-Message-State: APjAAAWnNmG2Cs0DNZEFZnFnkqRoTWFLrpQzDwXkPO3z3Ui2gesuEd92 K4twzH4QWtxB8ox9N6bd+xGO55hZ X-Google-Smtp-Source: APXvYqzn9aRigNhECXKNgTuwT9iy86axdyYu9qT7Ap+gKhSJOknNnjBMo957zcI/zUx4Rb7ulV6k2A== X-Received: by 2002:a65:4489:: with SMTP id l9mr32288490pgq.1.1557160172814; Mon, 06 May 2019 09:29:32 -0700 (PDT) Original-Received: from lylat ([2604:3d09:e37f:1500:1a72:4878:e793:7302]) by smtp.gmail.com with ESMTPSA id q144sm12970141pgq.76.2019.05.06.09.29.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 09:29:31 -0700 (PDT) In-Reply-To: <83ftprk2nj.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 06 May 2019 18:45:20 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236199 Archived-At: Eli Zaretskii 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 >> 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.