9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Russ Cox" <rsc@swtch.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] How to read/write pixels from Memimage
Date: Sat, 26 Jan 2008 09:55:20 -0500	[thread overview]
Message-ID: <20080126145515.6C2CA1E8C1C@holo.morphisms.net> (raw)
In-Reply-To: <DBDD10CB-C763-4795-A6D0-10C043AFCEBC@mac.com>

> However, I want to be able to read 32-bit color values. How does  
> Memimage store colors and 

You should be able to answer this by reading the programs
I pointed out as well as color(6), image(6), and memdraw(2).
If all else fails, you could try writing a simple program and
see how far you get.

> will the code I use work? 

Probably not at first (whose code does?), but eventually.

> I can change it  to 24-bit if necessary, but that would make it slower to read files.  
> If I do what these programs say, how will my u32int be arranged?

The answers to these questions are *in* those programs
(not to mention the manual pages!).  Given that your reply
came in four minutes after my post, it sounds like you didn't
actually read the programs I pointed out.  The first one on
the list, /sys/src/cmd/crop.c, picks up a Plan 9 image file
and then walks over every 32-bit pixel looking for a given color.
And it's only 211 lines.  Between that and the documentation
I'd think that would be enough to answer questions about
how colors are stored.  At the least it should prompt 
questions that are more specific than "how do I do this?"

Read /sys/src/cmd/crop.c, color(6), image(6), and memdraw(2).

Russ


  reply	other threads:[~2008-01-26 14:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25 22:05 Pietro Gagliardi
2008-01-26 14:05 ` Russ Cox
2008-01-26 14:09   ` Pietro Gagliardi
2008-01-26 14:55     ` Russ Cox [this message]
2008-01-26 23:22       ` Pietro Gagliardi
2008-01-27 18:05         ` Skip Tavakkolian
2008-01-27 18:55           ` Pietro Gagliardi
2008-01-27 19:29             ` [9fans] pico Steve Simon
2008-01-28 23:36               ` Russ Cox
2008-01-29  0:30                 ` Pietro Gagliardi
2008-01-29  5:30                   ` Bruce Ellis
2008-01-29 20:33                     ` Pietro Gagliardi
2008-01-29 20:35                       ` Pietro Gagliardi
2008-01-29 22:46                         ` Russ Cox
2008-01-30  1:13                           ` Pietro Gagliardi
2008-01-30  6:53                             ` Bruce Ellis
2008-01-30 23:42                               ` Pietro Gagliardi
2008-01-30 23:55                                 ` Pietro Gagliardi
2008-01-31  7:41                                   ` Bruce Ellis
2008-02-05  3:01                                     ` Pietro Gagliardi
2008-01-27 19:14           ` [9fans] How to read/write pixels from Memimage Pietro Gagliardi
2008-01-27 23:44           ` Pietro Gagliardi
2008-01-28  0:18             ` Pietro Gagliardi
2008-01-28  1:08               ` Pietro Gagliardi
2008-01-28  1:22                 ` erik quanstrom
2008-01-28  3:23                   ` Pietro Gagliardi
2008-01-28  9:24                     ` mattmobile
2008-01-28 16:20                       ` ron minnich

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=20080126145515.6C2CA1E8C1C@holo.morphisms.net \
    --to=rsc@swtch.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).