24 lines · 437 B · C
RawDownload
#include <u.h>#include <libc.h>#include <draw.h> staticintunitsperline(Rectangle r, int d, int bitsperunit){	if(d <= 0 || d > 32)	/* being called wrong.  d is image depth. */		abort();	return (r.max.x*d - (r.min.x*d & -bitsperunit) + bitsperunit - 1) / bitsperunit;} intwordsperline(Rectangle r, int d){	return unitsperline(r, d, 8*sizeof(ulong));} intbytesperline(Rectangle r, int d){	return unitsperline(r, d, 8);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t