transition.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef MUPDF_FITZ_TRANSITION_H
  2. #define MUPDF_FITZ_TRANSITION_H
  3. #include "mupdf/fitz/system.h"
  4. #include "mupdf/fitz/pixmap.h"
  5. /* Transition support */
  6. typedef struct fz_transition_s fz_transition;
  7. enum {
  8. FZ_TRANSITION_NONE = 0, /* aka 'R' or 'REPLACE' */
  9. FZ_TRANSITION_SPLIT,
  10. FZ_TRANSITION_BLINDS,
  11. FZ_TRANSITION_BOX,
  12. FZ_TRANSITION_WIPE,
  13. FZ_TRANSITION_DISSOLVE,
  14. FZ_TRANSITION_GLITTER,
  15. FZ_TRANSITION_FLY,
  16. FZ_TRANSITION_PUSH,
  17. FZ_TRANSITION_COVER,
  18. FZ_TRANSITION_UNCOVER,
  19. FZ_TRANSITION_FADE
  20. };
  21. struct fz_transition_s
  22. {
  23. int type;
  24. float duration; /* Effect duration (seconds) */
  25. /* Parameters controlling the effect */
  26. int vertical; /* 0 or 1 */
  27. int outwards; /* 0 or 1 */
  28. int direction; /* Degrees */
  29. /* Potentially more to come */
  30. /* State variables for use of the transition code */
  31. int state0;
  32. int state1;
  33. };
  34. /*
  35. fz_generate_transition: Generate a frame of a transition.
  36. tpix: Target pixmap
  37. opix: Old pixmap
  38. npix: New pixmap
  39. time: Position within the transition (0 to 256)
  40. trans: Transition details
  41. Returns 1 if successfully generated a frame.
  42. */
  43. int fz_generate_transition(fz_context *ctx, fz_pixmap *tpix, fz_pixmap *opix, fz_pixmap *npix, int time, fz_transition *trans);
  44. #endif