76 lines · 1.5 KB · Text
RawDownload
.TH READCOLMAP 2.SH NAMERGB, readcolmap, writecolmap \- access display color map.SH SYNOPSIS.B #include <u.h>.br.B #include <libc.h>.br.B #include <draw.h>.PP.PP.ta \w'\fLvoid 'u.PP.Bint	readcolmap(Display *d, RGB *map).PP.Bint	writecolmap(Display *d, RGB *map).fi.SH DESCRIPTIONColors are described by their red, green, and bluelight intensities, in an.B RGBdatum:.IP.EX.ta 6ntypedefstruct RGB {	ulong red;	ulong green;	ulong blue;} RGB;.EE.PPBlack is represented by zero in all three positions andwhite has the maximum.B unsigned.B longvalue in all three positions..PPA color map is an array of.BR RGB s,of length.if t \x'-.8n'2\u\s-1\fIdepth\fP\s+1\d,.if n 2^\fIdepth\fP,giving the colors for pixels 0, 1, 2, etc.On displays with color mapped pixels(typically 8-bit displays),one retrieves RGB color informationby treating the pixel data as an offsetinto the color map..PP.I Readcolmapreads the color map for the given display into the provided.IR map ,which must have enough space to hold it..I Writecolmapassociates the given color map with the given display, if possible.(The hardware might not allow this.)Both return 0 on success, or \-1 on error, setting.IR errstr ..PPChanging the hardware color map does not changethe color map used by the.IR draw (2)operator to convert betweenmapped and true color or greyscale images,which is described in .IR color (6)..SH SOURCE.B /sys/src/libdraw.SH "SEE ALSO".IR graphics (2),.IR draw (3),.IR color (6)