Chapter 37
Transitions

For a basic description of how to query a document for the specified presentation details, see section 8.9 Presentations. Given these details, the caller is still responsible for displaying (animating) the transition.

To help with this task, MuPDF provides a helper function that generate the required frame of the transition into the supplied target pixmap from supplied rendered pixmaps of the start/end of the transition:

/* 
   fz_generate_transition: Generate a frame of a transition. 
 
   tpix: Target pixmap 
   opix: Old pixmap 
   npix: New pixmap 
   time: Position within the transition (0 to 256) 
   trans: Transition details 
 
   Returns 1 if successfully generated a frame. 
*/ 
int fz_generate_transition(fz_context *ctx, fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time, fz_transition *trans);

This helper function is largely independent of the rest of MuPDF, and will be dropped from the library at link time if it is not used.

It is still the callers responsibility to drive this, to display the updated pixmaps, and to generate the time field as appropriate from the actual real clock values.