Home Man
Today's Posts

Linux & Unix Commands - Search Man Pages

Plan 9 - man page for balloc (plan9 section 2)

BALLOC(2)			       System Calls Manual				BALLOC(2)

       balloc, bfree, rdbitmap, wrbitmap, rdbitmapfile, wrbitmapfile - allocating, freeing, read-
       ing, writing bitmaps

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

       Bitmap *balloc(Rectangle r, int ldepth)

       void   bfree(Bitmap *b)

       void   rdbitmap(Bitmap *b, int ymin, int ymax, uchar *data)

       void   wrbitmap(Bitmap *b, int ymin, int ymax, uchar *data)

       Bitmap *rdbitmapfile(int fd)

       void   wrbitmapfile(int fd, Bitmap *b)

       A new bitmap is allocated with balloc; it will have the extent and ldepth (log base  2  of
       the  number  of bits per pixel) given by its arguments, and will be filled with zeros. The
       id field will have been set to the identifying number used by  /dev/bitblt  (see  bit(3)),
       and  the  cache	field will be zero.  Balloc returns 0 if the server has run out of bitmap
       resources.  Bfree frees the resources used by its argument bitmap.

       The remaining functions deal with moving groups of pixel values between bitmaps	and  user
       space  or  external files.  There is a fixed format for the exchange and storage of bitmap
       data (see bitmap(6)).

       Rdbitmap reads rows of pixels from bitmap b into data.  The rows read have  y=ymin,ymin+1,
       ...  ymax-1.  Those rows must be within the range allowed by b.r.

       Wrbitmap replaces the specified rows of pixels in bitmap b with data.

       Rdbitmapfile  creates a bitmap from data contained an external file (see bitmap(6) for the
       file format); fd is a file descriptor obtained by opening such a file  for  reading.   The
       returned bitmap is allocated using balloc.

       Wrbitmapfile  writes  bitmap  b onto file descriptor fd, which should be open for writing.
       The format is as described for rdbitmapfile.

       Rdbitmapfile and wrbitmapfile do not close fd.


       graphics(2), bitblt(2), bit(3), bitmap(6)

       These functions return 0 on failure, usually due to insufficient memory.

       May set errstr.

       Ldepth must be 0, 1, 2, or 3.


All times are GMT -4. The time now is 12:57 AM.

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