PBRT
|
00001 00002 // 00003 // Copyright (c) 2006, Industrial Light & Magic, a division of Lucas 00004 // Digital Ltd. LLC 00005 // 00006 // All rights reserved. 00007 // 00008 // Redistribution and use in source and binary forms, with or without 00009 // modification, are permitted provided that the following conditions are 00010 // met: 00011 // * Redistributions of source code must retain the above copyright 00012 // notice, this list of conditions and the following disclaimer. 00013 // * Redistributions in binary form must reproduce the above 00014 // copyright notice, this list of conditions and the following disclaimer 00015 // in the documentation and/or other materials provided with the 00016 // distribution. 00017 // * Neither the name of Industrial Light & Magic nor the names of 00018 // its contributors may be used to endorse or promote products derived 00019 // from this software without specific prior written permission. 00020 // 00021 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00022 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00024 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00025 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00026 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00027 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00028 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00029 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00030 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00031 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 // 00034 00035 00036 #ifndef INCLUDED_IMF_FRAMES_PER_SECOND_H 00037 #define INCLUDED_IMF_FRAMES_PER_SECOND_H 00038 00039 //----------------------------------------------------------------------------- 00040 // 00041 // Convenience functions related to the framesPerSecond attribute 00042 // 00043 // Functions that return the exact values for commonly used frame rates: 00044 // 00045 // name frames per second 00046 // 00047 // fps_23_976() 23.976023... 00048 // fps_24() 24.0 35mm film frames 00049 // fps_25() 25.0 PAL video frames 00050 // fps_29_97() 29.970029... NTSC video frames 00051 // fps_30() 30.0 60Hz HDTV frames 00052 // fps_47_952() 47.952047... 00053 // fps_48() 48.0 00054 // fps_50() 50.0 PAL video fields 00055 // fps_59_94() 59.940059... NTSC video fields 00056 // fps_60() 60.0 60Hz HDTV fields 00057 // 00058 // Functions that try to convert inexact frame rates into exact ones: 00059 // 00060 // Given a frame rate, fps, that is close to one of the pre-defined 00061 // frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(), 00062 // guessExactFps(fps) returns the corresponding pre-defined frame 00063 // rate. If fps is not close to one of the pre-defined frame rates, 00064 // then guessExactFps(fps) returns Rational(fps). 00065 // 00066 //----------------------------------------------------------------------------- 00067 00068 #include <ImfRational.h> 00069 00070 namespace Imf { 00071 00072 inline Rational fps_23_976 () {return Rational (24000, 1001);} 00073 inline Rational fps_24 () {return Rational (24, 1);} 00074 inline Rational fps_25 () {return Rational (25, 1);} 00075 inline Rational fps_29_97 () {return Rational (30000, 1001);} 00076 inline Rational fps_30 () {return Rational (30, 1);} 00077 inline Rational fps_47_952 () {return Rational (48000, 1001);} 00078 inline Rational fps_48 () {return Rational (48, 1);} 00079 inline Rational fps_50 () {return Rational (50, 1);} 00080 inline Rational fps_59_94 () {return Rational (60000, 1001);} 00081 inline Rational fps_60 () {return Rational (60, 1);} 00082 00083 Rational guessExactFps (double fps); 00084 Rational guessExactFps (const Rational &fps); 00085 00086 } // namespace Imf 00087 00088 #endif