9.2 Device Methods

Every Device in MuPDF is an extension of the fz_device structure. This contains a series of function pointers to implement the handling of different types of graphical object.

These function pointers are exposed to callers via convenience functions. These convenience functions should always be used in preference to calling the function pointers direct, as they perform various behind the scenes housekeeping functions. They also cope with the function pointers being NULL, as can permissibly happen when a device is not interested in a particular class of graphical object.

We will not describe these device functions here, but rather defer them to chapter 22 Device Internals in Part 2. While it is perfectly permissible for callers to call the device convenience functions themselves, the vast majority of application authors will never do so, and will simply treat each fz_device as a ‘black box’ to be passed to the interpretation functions (see section 8.8 Rendering Pages).