Path: blob/master/3rdparty/openexr/IlmImf/ImfFramesPerSecond.h
16337 views
///////////////////////////////////////////////////////////////////////////1//2// Copyright (c) 2006, Industrial Light & Magic, a division of Lucas3// Digital Ltd. LLC4//5// All rights reserved.6//7// Redistribution and use in source and binary forms, with or without8// modification, are permitted provided that the following conditions are9// met:10// * Redistributions of source code must retain the above copyright11// notice, this list of conditions and the following disclaimer.12// * Redistributions in binary form must reproduce the above13// copyright notice, this list of conditions and the following disclaimer14// in the documentation and/or other materials provided with the15// distribution.16// * Neither the name of Industrial Light & Magic nor the names of17// its contributors may be used to endorse or promote products derived18// from this software without specific prior written permission.19//20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS21// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT22// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR23// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT24// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT26// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,27// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY28// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE30// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31//32///////////////////////////////////////////////////////////////////////////333435#ifndef INCLUDED_IMF_FRAMES_PER_SECOND_H36#define INCLUDED_IMF_FRAMES_PER_SECOND_H3738//-----------------------------------------------------------------------------39//40// Convenience functions related to the framesPerSecond attribute41//42// Functions that return the exact values for commonly used frame rates:43//44// name frames per second45//46// fps_23_976() 23.976023...47// fps_24() 24.0 35mm film frames48// fps_25() 25.0 PAL video frames49// fps_29_97() 29.970029... NTSC video frames50// fps_30() 30.0 60Hz HDTV frames51// fps_47_952() 47.952047...52// fps_48() 48.053// fps_50() 50.0 PAL video fields54// fps_59_94() 59.940059... NTSC video fields55// fps_60() 60.0 60Hz HDTV fields56//57// Functions that try to convert inexact frame rates into exact ones:58//59// Given a frame rate, fps, that is close to one of the pre-defined60// frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(),61// guessExactFps(fps) returns the corresponding pre-defined frame62// rate. If fps is not close to one of the pre-defined frame rates,63// then guessExactFps(fps) returns Rational(fps).64//65//-----------------------------------------------------------------------------6667#include <ImfRational.h>6869namespace Imf {7071inline Rational fps_23_976 () {return Rational (24000, 1001);}72inline Rational fps_24 () {return Rational (24, 1);}73inline Rational fps_25 () {return Rational (25, 1);}74inline Rational fps_29_97 () {return Rational (30000, 1001);}75inline Rational fps_30 () {return Rational (30, 1);}76inline Rational fps_47_952 () {return Rational (48000, 1001);}77inline Rational fps_48 () {return Rational (48, 1);}78inline Rational fps_50 () {return Rational (50, 1);}79inline Rational fps_59_94 () {return Rational (60000, 1001);}80inline Rational fps_60 () {return Rational (60, 1);}8182Rational guessExactFps (double fps);83Rational guessExactFps (const Rational &fps);8485} // namespace Imf8687#endif888990