Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

balloc(2) [plan9 man page]

BALLOC(2)							System Calls Manual							 BALLOC(2)

NAME
balloc, bfree, rdbitmap, wrbitmap, rdbitmapfile, wrbitmapfile - allocating, freeing, reading, writing bitmaps SYNOPSIS
#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) DESCRIPTION
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 argu- ments, 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. SOURCE
/sys/src/libg SEE ALSO
graphics(2), bitblt(2), bit(3), bitmap(6) DIAGNOSTICS
These functions return 0 on failure, usually due to insufficient memory. May set errstr. BUGS
Ldepth must be 0, 1, 2, or 3. BALLOC(2)

Check Out this Related Man Page

Bitmap(3)						User Contributed Perl Documentation						 Bitmap(3)

NAME
Tk::Bitmap - Images that display two colors SYNOPSIS
$image = $widget->Bitmap?(name??,options?) DESCRIPTION
A bitmap is an image whose pixels can display either of two colors or be transparent. A bitmap image is defined by four things: a background color, a foreground color, and two bitmaps, called the source and the mask. Each of the bitmaps specifies 0/1 values for a rectangular array of pixels, and the two bitmaps must have the same dimensions. For pixels where the mask is zero, the image displays nothing, producing a transparent effect. For other pixels, the image displays the foreground color if the source data is one and the background color if the source data is zero. CREATING BITMAPS
Bitmaps are created using $widget->Bitmap. Bitmaps support the following options: -background => color Specifies a background color for the image in any of the standard ways accepted by Tk. If this option is set to an empty string then the background pixels will be transparent. This effect is achieved by using the source bitmap as the mask bitmap, ignoring any -maskdata or -maskfile options. -data => string Specifies the contents of the source bitmap as a string. The string must adhere to X11 bitmap format (e.g., as generated by the bitmap program). If both the -data and -file options are specified, the -data option takes precedence. -file => name name gives the name of a file whose contents define the source bitmap. The file must adhere to X11 bitmap format (e.g., as generated by the bitmap program). -foreground => color Specifies a foreground color for the image in any of the standard ways accepted by Tk. -maskdata => string Specifies the contents of the mask as a string. The string must adhere to X11 bitmap format (e.g., as generated by the bitmap program). If both the -maskdata and -maskfile options are specified, the -maskdata option takes precedence. -maskfile => name name gives the name of a file whose contents define the mask. The file must adhere to X11 bitmap format (e.g., as generated by the bitmap program). IMAGE METHODS
When a bitmap image is created, Tk also creates a new object. This object supports the configure and cget methods described in Tk::options which can be used to enquire and modify the options described above. SEE ALSO
Tk::Image Tk::Pixmap Tk::Photo KEYWORDS
bitmap, image perl v5.12.1 2007-05-05 Bitmap(3)
Man Page