.PTR
OS/2 colour pointer (CP)
Introduction
The OS/2 colour pointer is a colour mouse pointer stored as a BMP file with the type
code CP. It is laid out exactly like a
colour OS/2 icon: a 1-bit bitmap of AND and XOR
masks that decides where the pointer is transparent, then a colour image for the rest.
The file header carries the hotspot, the pixel that marks where the pointer points.
Pointer files are usually named .ptr. A file with versions for several
screens is a bitmap array whose entries are
CP images.
Software
Structure
The parts are those of a colour icon: two sets of
headers, each starting with CP, then the mask bits and the colour image.
The hotspot is in the first file header, in the fields described on the
pointer page. All numbers are little-endian.
0File headerCP, size, hotspot and the offset of the masks14 bytes14DIB header and two-entry colour table for the masksvaries…Second file headerCPagain, with the offset of the colour image14 bytes…DIB header and colour table for the colour imagevaries…Masks then the colour image, each at the offset in its file headervaries
Telling it apart
The file starts with CP (43 50). After the first DIB header
and its two-entry colour table comes a second file header, also starting with
CP. Apart from the type code it is identical to a
colour icon. A black and white
pointer starts with PT and has only
one file header.