Some file formats, such as PDF can be used as ‘presentations’, where pages are displayed as a slideshows - a form of poor man’s PowerPoint if you will. Essentially each page contains a record that says how long it should be displayed for before transitioning to the next page with a given graphical effect.
The core MuPDF library is never responsible for actually presenting a page to the user, so it is therefore not possible to expect it to cope with handling all the work required by such transitions.
What it can do is to help in 2 particular areas. Firstly, it can provide some functions to aid the caller in the task of querying the transitions required. Secondly, it can help in providing some helper functions to generate bitmaps of various stages of common transitions.
We define a structure type to hold the details of arbitrary transitions, together with some opaque state:
Armed with such a structure, we can call a function to get it filled out:
This structure is defined to be sufficient to encapsulate the currently defined PDF transition types; it may be extended in future if other formats require more expressiveness.
Callers are free to directly implement their transitions using the information herein, or else they can make use of a helper function.
Details of a helpful routine for displaying some of these transitions can be found in chapter 37 Transitions.