ADDR(3R)

NAME
addr - return the Word address of a Point in a Bitmap

SYNOPSIS
#include <dmd.h>

Word *addr (b, p)
Bitmap *b;
Point p;

DESCRIPTION
The addr function returns the address of the Word containing the bit corresponding to the Point p in the Bitmap b.

EXAMPLE
The following subroutine can be used to determine whether a Point p in a Bitmap b is on or off (returning 1 or 0, respectively).

    #include <dmd.h>
    Word *addr();
    pixel (b, p)
    Bitmap *b;
    Point	p;
    {
    	Word *w;
    	UWord bit;
    	w = addr (b, p);
    	bit = FIRSTBIT >> (p.x%WORDSIZE);
    	return (*w&bit)==bit;
    }

This routine is implemented differently in rol(3L).

SEE ALSO
rol(3L), structure(3R).