9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] new versions of graphics programs?
Date: Tue, 12 Sep 2000 22:58:26 -0400	[thread overview]
Message-ID: <20000913025833.8987A199CC@mail> (raw)

It's hard to know which one is really right.
We decided that the most common use of DTransparent
was when allocating bitmaps, so it should be 0x00000000
(that is, the alpha channel should be 0, indicating
that the pixels are completely see-through).
This means that the transparent pixels, once put
into an image, have no effect when doing other
draw operations with those images.  Hence the comment
	DTransparent	= 0x00000000,		/* only useful for allocimage, memfillcolor */

We used to use 0x000000FF (that is, an alpha channel
of 255, indicating that the pixels are completely
opaque).  The reason for this was that then if you
were trying to create or manipulate masks, you'd want
the "transparent" color to have some substance to it,
so it could be copied from place to place (see for 
example /sys/src/cmd/page/rotate.c).  Thus I gave it
a solid alpha.

When you are creating images without an alpha 
channel, the lack of an alpha channel means the
distinction is lost (indeed, this is why
page/rotate.c still works with DTransparent = 0).

DTransparent really should be 0, so that when you
create an image filled with DTransparent and then draw
it on top of another image, nothing happens.
Before, you'd have blacked out the whole image.

This minor error hints at a bigger problems.  
Aside from creation, there is no way to do things
like fill a bitmap with a partially transparent
color.  And so on.  This is because the draw operator only
uses the Porter-Duff "over" operator.  I'm starting
to rework some of these things, and it looks like
being able to specify the operator as an argument
to gendraw will solve this and other problems.

Russ



             reply	other threads:[~2000-09-13  2:58 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-09-13  2:58 Russ Cox [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-09-15  2:30 okamoto
2000-09-15  2:03 Russ Cox
2000-09-15  8:47 ` Douglas A. Gwyn
2000-09-15  8:47 ` Elliott Hughes
2000-09-15  1:51 okamoto
2000-09-14  2:31 okamoto
2000-09-14  8:14 ` Douglas A. Gwyn
2000-09-13  5:55 okamoto
2000-09-13  3:32 okamoto
2000-09-13  3:19 okamoto
2000-09-13  2:55 okamoto
2000-09-13  2:51 okamoto
2000-09-13  1:28 okamoto
2000-09-12 13:33 Russ Cox
2000-09-12 10:01 okamoto
2000-09-08  4:34 okamoto
2000-09-07 21:57 rob pike
     [not found] ` <rob@plan9.bell-labs.com>
2000-09-07 22:18   ` Tom Duff
2000-09-07 22:50 ` Jim Choate
     [not found]   ` <ravage@einstein.ssz.com>
2000-09-07 22:35     ` Tom Duff
2000-09-07 23:24       ` Jim Choate
2000-09-08 15:28         ` please_no_spam_to_
     [not found]           ` <D.M.Pick@qmw.ac.uk>
2000-09-08 16:43             ` Tom Duff
2000-09-07 16:08 Anthony Sorace

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=20000913025833.8987A199CC@mail \
    --to=rsc@plan9.bell-labs.com \
    --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).