9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Pietro Gagliardi <pietro10@mac.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] First/second edition image manipulation tools
Date: Wed, 11 Jun 2008 23:33:01 -0400	[thread overview]
Message-ID: <C4B14D5E-7A30-4BA3-B3DB-7FBDE40C42C6@mac.com> (raw)

Hello.

My next experiment in learning libraries, as well as my next project,
is a reimplementation of the first and second edition raster graphics
manipulation tools. These use libmemdraw, which provides Memimage.
Since I only have a working first edition manual, the program I will
present shortly conforms to the first edition.

NAME
	transpose - re-orient an image
SYNOPSIS
	transpose [-vhadrlui] [-o 'x y'] [imgfile]
DESCRIPTION
	transpose produces an image from another image by applying a
transformation
	that satisfies the property of involution. The options are:

		-d	Reflect image through descending axis (y=-x), the default
		-a	Reflect image through ascending axis (y=x)
		-v	Reflect image left-to-right through vertical center line (x=0)
		-h	Reflect image top-to-bottom through horizontal center line (y=0)
		-r	Rotates image right 90 degrees (clockwise)
		-l	Rotates image left 90 degrees (counterclockwise)
		-u	Rotates image upside down (180 degrees)
		-i	Identity (for completeness)

	If the -o option is given, the new image has the upper-left
coordinates given as an
	argument. Otherwise, the original upper-left coordinates are used.
EXAMPLES
	Mirror image.
		transpose -v img > img2
	Set the origin of an image to (0,0) without changing any pixels.
		transpose -i -o '0 0' img > img2
	Involution exposition.
		transpose img | transpose > img2
BUGS
	The first edition specified the arguments to -o as two values - this
cannot be done
	due to idiosyncrasies with args(2).

	What should I do to supply something like -o outfile?

	O(N^2) algorithms, even with -i - using -o makes the running time
O(2(N^2)).

You can find it in /n/sources/contrib/pietro/transpose.c.

Pietro




             reply	other threads:[~2008-06-12  3:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  3:33 Pietro Gagliardi [this message]
2008-06-12  3:46 ` Russ Cox
2008-06-12  3:57   ` Pietro Gagliardi
2008-06-12  8:24     ` Charles Forsyth
2008-06-12 14:29     ` Russ Cox

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=C4B14D5E-7A30-4BA3-B3DB-7FBDE40C42C6@mac.com \
    --to=pietro10@mac.com \
    --cc=9fans@9fans.net \
    /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).