You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Initial check-in of OpenShot Library
This commit is contained in:
29
src/FrameRate.cpp
Normal file
29
src/FrameRate.cpp
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* \file
|
||||
* \brief Source code for the FrameRate class
|
||||
* \author Copyright (c) 2011 Jonathan Thomas
|
||||
*/
|
||||
|
||||
#include "../include/FrameRate.h"
|
||||
|
||||
using namespace openshot;
|
||||
|
||||
Framerate::Framerate(int numerator, int denominator) {
|
||||
m_numerator = numerator;
|
||||
m_denominator = denominator;
|
||||
}
|
||||
|
||||
Framerate::Framerate() {
|
||||
m_numerator = 24;
|
||||
m_denominator = 1;
|
||||
}
|
||||
|
||||
// Return a rounded integer of the frame rate (for example 30000/1001 returns 30 fps)
|
||||
int Framerate::GetRoundedFPS() {
|
||||
return round((float) m_numerator / m_denominator);
|
||||
}
|
||||
|
||||
// Return a float of the frame rate (for example 30000/1001 returns 29.97...)
|
||||
float Framerate::GetFPS() {
|
||||
return (float) m_numerator / m_denominator;
|
||||
}
|
||||
Reference in New Issue
Block a user