/src/FreeImage/Source/OpenEXR/IlmImf/ImfFramesPerSecond.h

https://bitbucket.org/cabalistic/ogredeps/ · C++ Header · 88 lines · 18 code · 9 blank · 61 comment · 0 complexity · ec0a89e82b219c9065e2d8abc1a9fe08 MD5 · raw file

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas
  4. // Digital Ltd. LLC
  5. //
  6. // All rights reserved.
  7. //
  8. // Redistribution and use in source and binary forms, with or without
  9. // modification, are permitted provided that the following conditions are
  10. // met:
  11. // * Redistributions of source code must retain the above copyright
  12. // notice, this list of conditions and the following disclaimer.
  13. // * Redistributions in binary form must reproduce the above
  14. // copyright notice, this list of conditions and the following disclaimer
  15. // in the documentation and/or other materials provided with the
  16. // distribution.
  17. // * Neither the name of Industrial Light & Magic nor the names of
  18. // its contributors may be used to endorse or promote products derived
  19. // from this software without specific prior written permission.
  20. //
  21. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. //
  33. ///////////////////////////////////////////////////////////////////////////
  34. #ifndef INCLUDED_IMF_FRAMES_PER_SECOND_H
  35. #define INCLUDED_IMF_FRAMES_PER_SECOND_H
  36. //-----------------------------------------------------------------------------
  37. //
  38. // Convenience functions related to the framesPerSecond attribute
  39. //
  40. // Functions that return the exact values for commonly used frame rates:
  41. //
  42. // name frames per second
  43. //
  44. // fps_23_976() 23.976023...
  45. // fps_24() 24.0 35mm film frames
  46. // fps_25() 25.0 PAL video frames
  47. // fps_29_97() 29.970029... NTSC video frames
  48. // fps_30() 30.0 60Hz HDTV frames
  49. // fps_47_952() 47.952047...
  50. // fps_48() 48.0
  51. // fps_50() 50.0 PAL video fields
  52. // fps_59_94() 59.940059... NTSC video fields
  53. // fps_60() 60.0 60Hz HDTV fields
  54. //
  55. // Functions that try to convert inexact frame rates into exact ones:
  56. //
  57. // Given a frame rate, fps, that is close to one of the pre-defined
  58. // frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(),
  59. // guessExactFps(fps) returns the corresponding pre-defined frame
  60. // rate. If fps is not close to one of the pre-defined frame rates,
  61. // then guessExactFps(fps) returns Rational(fps).
  62. //
  63. //-----------------------------------------------------------------------------
  64. #include <ImfRational.h>
  65. namespace Imf {
  66. inline Rational fps_23_976 () {return Rational (24000, 1001);}
  67. inline Rational fps_24 () {return Rational (24, 1);}
  68. inline Rational fps_25 () {return Rational (25, 1);}
  69. inline Rational fps_29_97 () {return Rational (30000, 1001);}
  70. inline Rational fps_30 () {return Rational (30, 1);}
  71. inline Rational fps_47_952 () {return Rational (48000, 1001);}
  72. inline Rational fps_48 () {return Rational (48, 1);}
  73. inline Rational fps_50 () {return Rational (50, 1);}
  74. inline Rational fps_59_94 () {return Rational (60000, 1001);}
  75. inline Rational fps_60 () {return Rational (60, 1);}
  76. Rational guessExactFps (double fps);
  77. Rational guessExactFps (const Rational &fps);
  78. } // namespace Imf
  79. #endif