9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Fariborz (Skip) Tavakkolian" <skipt@real.com>
To: 9fans@cse.psu.edu, 9fans@cse.psu.edu
Subject: Re: [9fans] Pico (again)
Date: Thu, 18 Jul 2002 11:07:01 -0700	[thread overview]
Message-ID: <5.1.0.14.2.20020718105900.0367a648@mail.real.com> (raw)
In-Reply-To: <20020718141436.3434B19A3E@mail.cse.psu.edu>

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

I've attached my cheesy C version of display.bas that is in the package.
You can use it view the faces. It uses libXg that came with 9libs-1.0,
so the graphics model is understandable by a human being.

I've got popi running on Plan9 also. I guess I should have ask
the more direct question:

Why isn't a tool like pico available now? not chic anymore?

At 10:14 AM 7/18/2002 -0400, anothy@cosym.net wrote:
>just out of curiosity, i grabbed the popi stuff from holzmann's
>page and gave it a shot. popi, the portable pico, popi, compiles
>fine out of the box, although it runs into the buffered IO issue
>common to most unix command line programs on Plan 9. i've not
>checked to see that it does sensable things with images, though,
>mainly because i don't know what to do with popi's output. 
>
>the compiled version of pico available from holzmann's page
>doesn't compile. i put no effort into figuring out why. the notes
>on holzmann's page are not encouraging in this regard.
>
>i was not able to pull the version of pico described in Rakitzis'
>message, so it's untested.
>
>anyone got anything to deal with pico (v10 picfile(5)) images?
>ã‚¢

[-- Attachment #2: disp.c --]
[-- Type: text/plain, Size: 1014 bytes --]

#include	<u.h>
#include	<libc.h>
#include	<libg.h>

#define res 8

int threshold[res][res] = {
	{ 0,128,32,160,8,136,40,168}, 
	{ 192,64,224,96,200,72,232,104 },
	{ 48,176,16,144,56,184,24,152 },
	{ 240,112,208,80,248,120,216,88 },
	{ 12,140,44,172,4,132,36,164 },
	{ 204,76,236,108,196,68,228,100 },
	{ 60,188,28,156,52,180,20,148 },
	{ 252,124,220,92,244,116,212,84 }
};

main(int ac, char **av)
{
	FILE *infile;
	Point p;
	Event ev;
	register int x, y;

	if (ac < 2) {
		fprintf(stderr, "usage: %s filename\n", *av);
		exit(1);
	}
	if (! (infile = fopen(*(av+1), "r"))) {
		fprintf(stderr, "can't open %s\n", *(av+1));
		exit(1);
	}
	ac--;
	av++;

	xtbinit(0,0, &ac, av, 0);
	einit(Ekeyboard|Emouse);

	for (x = 0; x < 248; x++)
		for (y = 0; y < 248; y++) {
			int c;
			p = add(screen.r.min, Pt(y,x));
			if ((c = getc(infile)) == EOF)
				break;
			if (c <= threshold[x%res][y%res])
				point(&screen, p, ~0, S);
		}

	while(event(&ev) != Ekeyboard)
		continue;

	exit(0);
}

void
ereshaped(Rectangle r)
{
}

  reply	other threads:[~2002-07-18 18:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-18 14:14 anothy
2002-07-18 18:07 ` Fariborz (Skip) Tavakkolian [this message]
2002-07-18 23:07 ` Micah Stetson
2002-07-29 15:57 ` Douglas A. Gwyn
  -- strict thread matches above, loose matches on Subject: below --
2002-07-26  6:03 Byron Rakitzis
2002-07-18 20:04 Dennis Ritchie
2002-07-19  8:19 ` ggm
2002-07-29 15:57 ` Douglas A. Gwyn
2002-07-18  8:53 steve.simon
2002-07-17 22:46 Sam
2002-07-18  0:28 ` Fariborz (Skip) Tavakkolian
2002-07-17 23:19   ` Sam
2002-07-18  0:35     ` Fariborz (Skip) Tavakkolian
2002-07-18  9:51   ` William Josephson

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=5.1.0.14.2.20020718105900.0367a648@mail.real.com \
    --to=skipt@real.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).