ImfFramesPerSecond.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. // Copyright (c) Contributors to the OpenEXR Project.
  4. //
  5. #ifndef INCLUDED_IMF_FRAMES_PER_SECOND_H
  6. #define INCLUDED_IMF_FRAMES_PER_SECOND_H
  7. //-----------------------------------------------------------------------------
  8. //
  9. // Convenience functions related to the framesPerSecond attribute
  10. //
  11. // Functions that return the exact values for commonly used frame rates:
  12. //
  13. // name frames per second
  14. //
  15. // fps_23_976() 23.976023...
  16. // fps_24() 24.0 35mm film frames
  17. // fps_25() 25.0 PAL video frames
  18. // fps_29_97() 29.970029... NTSC video frames
  19. // fps_30() 30.0 60Hz HDTV frames
  20. // fps_47_952() 47.952047...
  21. // fps_48() 48.0
  22. // fps_50() 50.0 PAL video fields
  23. // fps_59_94() 59.940059... NTSC video fields
  24. // fps_60() 60.0 60Hz HDTV fields
  25. //
  26. // Functions that try to convert inexact frame rates into exact ones:
  27. //
  28. // Given a frame rate, fps, that is close to one of the pre-defined
  29. // frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(),
  30. // guessExactFps(fps) returns the corresponding pre-defined frame
  31. // rate. If fps is not close to one of the pre-defined frame rates,
  32. // then guessExactFps(fps) returns Rational(fps).
  33. //
  34. //-----------------------------------------------------------------------------
  35. #include "ImfExport.h"
  36. #include "ImfNamespace.h"
  37. #include "ImfRational.h"
  38. OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
  39. inline Rational fps_23_976 () {return Rational (24000, 1001);}
  40. inline Rational fps_24 () {return Rational (24, 1);}
  41. inline Rational fps_25 () {return Rational (25, 1);}
  42. inline Rational fps_29_97 () {return Rational (30000, 1001);}
  43. inline Rational fps_30 () {return Rational (30, 1);}
  44. inline Rational fps_47_952 () {return Rational (48000, 1001);}
  45. inline Rational fps_48 () {return Rational (48, 1);}
  46. inline Rational fps_50 () {return Rational (50, 1);}
  47. inline Rational fps_59_94 () {return Rational (60000, 1001);}
  48. inline Rational fps_60 () {return Rational (60, 1);}
  49. IMF_EXPORT Rational guessExactFps (double fps);
  50. IMF_EXPORT Rational guessExactFps (const Rational &fps);
  51. OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
  52. #endif