Blame IlmImf/ImfFramesPerSecond.h

Packit 0d464f
///////////////////////////////////////////////////////////////////////////
Packit 0d464f
//
Packit 0d464f
// Copyright (c) 2006, Industrial Light & Magic, a division of Lucas
Packit 0d464f
// Digital Ltd. LLC
Packit 0d464f
// 
Packit 0d464f
// All rights reserved.
Packit 0d464f
// 
Packit 0d464f
// Redistribution and use in source and binary forms, with or without
Packit 0d464f
// modification, are permitted provided that the following conditions are
Packit 0d464f
// met:
Packit 0d464f
// *       Redistributions of source code must retain the above copyright
Packit 0d464f
// notice, this list of conditions and the following disclaimer.
Packit 0d464f
// *       Redistributions in binary form must reproduce the above
Packit 0d464f
// copyright notice, this list of conditions and the following disclaimer
Packit 0d464f
// in the documentation and/or other materials provided with the
Packit 0d464f
// distribution.
Packit 0d464f
// *       Neither the name of Industrial Light & Magic nor the names of
Packit 0d464f
// its contributors may be used to endorse or promote products derived
Packit 0d464f
// from this software without specific prior written permission. 
Packit 0d464f
// 
Packit 0d464f
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 0d464f
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 0d464f
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
Packit 0d464f
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
Packit 0d464f
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
Packit 0d464f
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
Packit 0d464f
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
Packit 0d464f
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
Packit 0d464f
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
Packit 0d464f
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 0d464f
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 0d464f
//
Packit 0d464f
///////////////////////////////////////////////////////////////////////////
Packit 0d464f
Packit 0d464f
Packit 0d464f
#ifndef INCLUDED_IMF_FRAMES_PER_SECOND_H
Packit 0d464f
#define INCLUDED_IMF_FRAMES_PER_SECOND_H
Packit 0d464f
Packit 0d464f
//-----------------------------------------------------------------------------
Packit 0d464f
//
Packit 0d464f
//	Convenience functions related to the framesPerSecond attribute
Packit 0d464f
//
Packit 0d464f
//	Functions that return the exact values for commonly used frame rates:
Packit 0d464f
//
Packit 0d464f
//	    name		frames per second
Packit 0d464f
//
Packit 0d464f
//	    fps_23_976()	23.976023...
Packit 0d464f
//	    fps_24()		24.0		35mm film frames
Packit 0d464f
//	    fps_25()		25.0		PAL video frames
Packit 0d464f
//	    fps_29_97()		29.970029...	NTSC video frames
Packit 0d464f
//	    fps_30()		30.0		60Hz HDTV frames
Packit 0d464f
//	    fps_47_952()	47.952047...
Packit 0d464f
//	    fps_48()		48.0
Packit 0d464f
//	    fps_50()		50.0		PAL video fields
Packit 0d464f
//	    fps_59_94()		59.940059...	NTSC video fields
Packit 0d464f
//	    fps_60()		60.0		60Hz HDTV fields
Packit 0d464f
//
Packit 0d464f
//	Functions that try to convert inexact frame rates into exact ones:
Packit 0d464f
//
Packit 0d464f
//	    Given a frame rate, fps, that is close to one of the pre-defined
Packit 0d464f
//	    frame rates fps_23_976(), fps_29_97(), fps_47_952() or fps_59_94(),
Packit 0d464f
//	    guessExactFps(fps) returns the corresponding pre-defined frame
Packit 0d464f
//	    rate.  If fps is not close to one of the pre-defined frame rates,
Packit 0d464f
//	    then guessExactFps(fps) returns Rational(fps).
Packit 0d464f
//
Packit 0d464f
//-----------------------------------------------------------------------------
Packit 0d464f
Packit 0d464f
#include "ImfRational.h"
Packit 0d464f
#include "ImfNamespace.h"
Packit 0d464f
#include "ImfExport.h"
Packit 0d464f
Packit 0d464f
Packit 0d464f
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
Packit 0d464f
Packit 0d464f
Packit 0d464f
inline Rational	fps_23_976 ()	{return Rational (24000, 1001);}
Packit 0d464f
inline Rational	fps_24 ()	{return Rational (24, 1);}
Packit 0d464f
inline Rational	fps_25 ()	{return Rational (25, 1);}
Packit 0d464f
inline Rational	fps_29_97 ()	{return Rational (30000, 1001);}
Packit 0d464f
inline Rational	fps_30 ()	{return Rational (30, 1);}
Packit 0d464f
inline Rational	fps_47_952 ()	{return Rational (48000, 1001);}
Packit 0d464f
inline Rational	fps_48 ()	{return Rational (48, 1);}
Packit 0d464f
inline Rational	fps_50 ()	{return Rational (50, 1);}
Packit 0d464f
inline Rational	fps_59_94 ()	{return Rational (60000, 1001);}
Packit 0d464f
inline Rational	fps_60 ()	{return Rational (60, 1);}
Packit 0d464f
Packit 0d464f
IMF_EXPORT Rational	guessExactFps (double fps);
Packit 0d464f
IMF_EXPORT Rational	guessExactFps (const Rational &fps;;
Packit 0d464f
Packit 0d464f
Packit 0d464f
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
Packit 0d464f
Packit 0d464f
Packit 0d464f
#endif