Home Man
Today's Posts

Linux & Unix Commands - Search Man Pages

Plan 9 - man page for picfile (plan9 section 9)

PICFILE(9.6)									     PICFILE(9.6)

       picfile - raster graphic image format

       Files  in this format store images represented as two-dimensional arrays of multiple-chan-
       nel pixels.  A picfile consists of an textual header followed by binary data encoding  the
       pixels  in  row-major  order.   The header is a list of attribute/value pairs separated by
       newlines, terminated by an empty line.  Each header line has  the  form	name=value.   The
       name  may  not contain an ASCII NUL, newline, or the value may not contain NUL or newline.
       The last line of a header is empty.

       The standard attributes are described below; all but TYPE and WINDOW are  optional.   TYPE
       must  come  first; otherwise order is irrelevant.  As any unrecognized attribute is passed
       over uninterpreted by all standard software, applications are welcome to include arbitrary
       annotations, such as SHOESIZE=101/2, if they wish.

	      How the pixels are encoded.  Standard types are
		     A	run-length  encoding.	The data are a sequence of (nchan+1)-byte records
		     each containing a count k and  nchan  bytes  giving  a  pixel  value  to  be
		     repeated k+1 times.  A run may not span scanlines.
	      dump   A two-dimensional array of nchan-byte records in row major order.
	      bitmap One-bit  pixels,  packed into bytes high bit leftmost.  Zero bits are white,
		     one bits are black.  Rows are padded with zeros to a multiple of 16 bits.
		     A black-and-white image under CCITT FAX Group 4 compression.  This format is
		     highly compressive on images of text and line art.  Similarly, and for Group
		     3, 1-D and 2-D.
	      pico   A sequence of nchan two-dimensional arrays of single bytes.
		     Pixels are in dump order, 2 bytes per pixel encoded according  to	the  IEEE
		     digital component video standard.
       WINDOW=x0 y0 x1 y1
	      The  x,y coordinates of the upper left corner and the point just diagonally outside
	      the lower right corner, x increasing to the right, y down.
	      The number of channels, default 1.
	      The names of the channels.  Channels should be nchan characters long.  Certain sub-
	      strings  of  channels  are conventionally understood by most programs that read and
	      write picture files: m is a monochrome image channel, rgb is a full-color image,	a
	      is  an alpha channel, and z...  is a floating point (four-byte, single precision) z
	      value.  Some very old monochrome pictures have CHAN=r.  This  usage  is  deprecated
	      but still recognized by some programs.
       RES=x y
	      The digitizing resolution horizontally and vertically, in pixels/inch.

       CMAP=  (The  value  is empty.)  A color map, a 256x3-byte translation table for color val-
	      ues, follows the header.	In a full-color picture, each color-map  row  maps  pixel
	      values  of  the corresponding channel.  In a monochrome picture, pixel values index
	      the color map to yield red, green and blue, like this:

	      uchar cmap[256][3];
	      red = cmap[pixel][0];
	      green = cmap[pixel][1];
	      blue = cmap[pixel][2];

       sed '/^$/q' image
	      Print a header.  A sample header follows.

       WINDOW=0 0 512 512
       RES=300 300
       COMMAND= antiquantize 'halftone CLASSIC' 512.halftone LIBERTY.anticlassic
       COMMAND=  halftone CLASSIC 512.liberty 512.halftone 1.75 512.halftone
       COMMAND=   transpose IN OUT
       COMMAND=    resample 512 IN OUT
       COMMAND=     transpose IN OUT
       COMMAND=      resample 512 IN OUT
       COMMAND=       clip 400 400 LIBERTY OUT

       Tom Duff, ``Raster Graphics in Plan 9''


All times are GMT -4. The time now is 12:56 PM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
Show Password