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.