9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: okamoto@granite.cias.osakafu-u.ac.jp
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Re: moving things in a window
Date: Wed, 27 Sep 2000 09:17:01 +0900	[thread overview]
Message-ID: <20000927001625.F0ADD199ED@mail> (raw)

[-- Attachment #1: Type: text/plain, Size: 174 bytes --]

So, I wrote my comment to note this technique is not so generally
applicable to want ot avoid Russ doesn't stop his effort to implement
translucent layer.  :-)

kenji


[-- Attachment #2: Type: message/rfc822, Size: 2934 bytes --]

From: andrey mirtchovski <aam396@mail.usask.ca>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Re: moving things in a window
Date: Tue, 26 Sep 2000 11:15:16 -0600 (CST)
Message-ID: <Pine.LNX.4.10.10009261109230.13135-100000@neon.myriadgate.net>

I asked Russ Cox for an explanation of the code, and I promptly received
one:
(with hopes it's useful and he doesn't mind me sending private email)

--- begin paste ---
/* clean up previous location */
if (osize && clear) {
        draw(imgmask, imgmask->r, display->black, nil, ZP);     // transparent
        fillellipse(imgmask, subpt(oldp, p1), osize, osize, display->white, ZP);        // draw opaque old
        fillellipse(imgmask, ZP, size, size, display->black, ZP);       // cover new

        draw(screen, rectaddpt(imgmask->r, p1), display->white, imgmask, imgmask->r.min);
}

We start with a black square.
Then we draw a white circle where the old circle was.
Then we draw a black circle where the new circle will be.

The result is a black image with a sliver of white corresponding to
the area of the old circle that is outside the new circle.

Interpreted as a mask, black is transparent; white opaque.
So the mask says ``only draw where the old circle was
but the new circle is not''.
The final draw puts white down in those places.
--- end paste --

the explanation may be a bit too high level for you though :)


On Tue, 26 Sep 2000, Theo Honohan wrote:
[snip]


             reply	other threads:[~2000-09-27  0:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-27  0:17 okamoto [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-09-29 12:35 Russ Cox
2000-10-02  9:00 ` Douglas A. Gwyn
2000-09-27  6:27 okamoto
2000-09-27  0:35 rob pike
2000-09-27  0:30 okamoto
2000-09-27  0:08 okamoto
2000-09-27  0:19 ` Theo Honohan
2000-09-26 17:00 Theo Honohan
2000-09-26 17:15 ` andrey mirtchovski
2000-09-26 18:00   ` Theo Honohan
2000-09-28 10:18   ` Douglas A. Gwyn
2000-09-28 11:28     ` Theo Honohan
2000-09-29  8:31       ` Douglas A. Gwyn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20000927001625.F0ADD199ED@mail \
    --to=okamoto@granite.cias.osakafu-u.ac.jp \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).