Skip to content

Commit

Permalink
Merge branch 'darby_edit_original' into test_merge
Browse files Browse the repository at this point in the history
  • Loading branch information
ggarra13 committed Oct 3, 2023
2 parents 5e184dd + 95244f5 commit c6c2707
Show file tree
Hide file tree
Showing 32 changed files with 1,022 additions and 342 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
endif()

if(TLRENDER_TESTS)
add_definitions(-DTLRENDER_SAMPLE_DATA="${CMAKE_CURRENT_SOURCE_DIR}/etc/SampleData")
set(CTEST_OUTPUT_ON_FAILURE ON)
enable_testing()
endif()
Expand Down
4 changes: 2 additions & 2 deletions etc/Linux/lcov.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh

lcov -c -b . -d . -o coverage.info --exclude deps
lcov -c -b . -d . -o coverage.info
lcov -r coverage.info '*/usr/*' -o coverage_filtered.info
lcov -r coverage_filtered.info '*/install/*' -o coverage_filtered.info
lcov -r coverage_filtered.info '*/tests/*' -o coverage_filtered.info
lcov -r coverage_filtered.info '*/deps/*' -o coverage_filtered.info
lcov --list coverage_filtered.info

29 changes: 25 additions & 4 deletions lib/tlCore/Matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ namespace tl

constexpr bool operator == (const Matrix3x3<T>&) const;
constexpr bool operator != (const Matrix3x3<T>&) const;

inline Matrix3x3<T> operator * (const Matrix3x3<T>&) const;
};

//! 4x4 matrix.
Expand All @@ -45,8 +43,6 @@ namespace tl

constexpr bool operator == (const Matrix4x4<T>&) const;
constexpr bool operator != (const Matrix4x4<T>&) const;

Matrix4x4<T> operator * (const Matrix4x4<T>&) const;
};

//! 3x3 floating point matrix.
Expand All @@ -55,6 +51,9 @@ namespace tl
//! 4x4 floating point matrix.
typedef Matrix4x4<float> Matrix4x4f;

//! \name Matrices
///@{

//! Create a translation matrix.
template<typename T>
constexpr Matrix4x4<T> translate(const Vector3<T>&);
Expand Down Expand Up @@ -83,6 +82,28 @@ namespace tl
template<typename T>
constexpr Matrix4x4<T> perspective(T fov, T aspect, T nearClip, T farClip);

///@}

//! \name Operators
///@{

template<typename T>
Matrix3x3<T> operator * (const Matrix3x3<T>&, const Matrix3x3<T>&);

template<typename T>
Vector2<T> operator * (const Matrix3x3<T>&, const Vector2<T>&);

template<typename T>
Matrix4x4<T> operator * (const Matrix4x4<T>&, const Matrix4x4<T>&);

template<typename T>
Vector3<T> operator * (const Matrix4x4<T>&, const Vector3<T>&);

template<typename T>
Vector4<T> operator * (const Matrix4x4<T>&, const Vector4<T>&);

///@}

//! \name Serialize
///@{

Expand Down
118 changes: 80 additions & 38 deletions lib/tlCore/MatrixInline.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,6 @@ namespace tl
return !(*this == other);
}

template<typename T>
inline Matrix3x3<T> Matrix3x3<T>::operator * (const Matrix3x3<T>& value) const
{
Matrix3x3<T> out;
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
float tmp = 0.F;
for (int k = 0; k < 3; ++k)
{
tmp += value.e[i * 3 + k] * e[k * 3 + j];
}
out.e[i * 3 + j] = tmp;
}
}
return out;
}

template<typename T>
constexpr bool Matrix4x4<T>::operator == (const Matrix4x4<T>& other) const
{
Expand Down Expand Up @@ -117,25 +98,6 @@ namespace tl
return !(*this == other);
}

template<typename T>
inline Matrix4x4<T> Matrix4x4<T>::operator * (const Matrix4x4<T>& value) const
{
Matrix4x4<T> out;
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
float tmp = 0.F;
for (int k = 0; k < 4; ++k)
{
tmp += value.e[i * 4 + k] * e[k * 4 + j];
}
out.e[i * 4 + j] = tmp;
}
}
return out;
}

template<typename T>
constexpr Matrix4x4<T> translate(const Vector3<T>& value)
{
Expand Down Expand Up @@ -221,5 +183,85 @@ namespace tl
T(0), T(0), b, T(-1),
T(0), T(0), c, T(0));
}

template<typename T>
inline Matrix3x3<T> operator * (const Matrix3x3<T>& a, const Matrix3x3<T>& b)
{
Matrix3x3<T> out;
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
float tmp = 0.F;
for (int k = 0; k < 3; ++k)
{
tmp += b.e[i * 3 + k] * a.e[k * 3 + j];
}
out.e[i * 3 + j] = tmp;
}
}
return out;
}

template<typename T>
inline Vector2<T> operator * (const Matrix3x3<T>& a, const Vector2<T>& v)
{
Vector2<T> out;
for (int i = 0; i < 2; ++i)
{
for (int j = 0; j < 2; ++j)
{
out[i] += a.e[i * 3 + j] * v[j];
}
}
return out;
}

template<typename T>
inline Matrix4x4<T> operator * (const Matrix4x4<T>& a, const Matrix4x4<T>& b)
{
Matrix4x4<T> out;
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
float tmp = 0.F;
for (int k = 0; k < 4; ++k)
{
tmp += b.e[i * 4 + k] * a.e[k * 4 + j];
}
out.e[i * 4 + j] = tmp;
}
}
return out;
}

template<typename T>
inline Vector3<T> operator * (const Matrix4x4<T>& a, const Vector3<T>& v)
{
Vector3<T> out;
for (int i = 0; i < 3; ++i)
{
for (int j = 0; j < 3; ++j)
{
out[i] += a.e[i * 4 + j] * v[j];
}
}
return out;
}

template<typename T>
inline Vector4<T> operator * (const Matrix4x4<T>& a, const Vector4<T>& v)
{
Vector4<T> out;
for (int i = 0; i < 4; ++i)
{
for (int j = 0; j < 4; ++j)
{
out[i] += a.e[i * 4 + j] * v[j];
}
}
return out;
}
};
}
9 changes: 9 additions & 0 deletions lib/tlCore/Vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ namespace tl

void zero();

constexpr T operator [] (int) const;
T& operator [] (int);

///@}

constexpr bool operator == (const Vector2<T>&) const;
Expand All @@ -51,6 +54,9 @@ namespace tl

void zero();

constexpr T operator [] (int) const;
T& operator [] (int);

///@}

constexpr bool operator == (const Vector3<T>&) const;
Expand All @@ -75,6 +81,9 @@ namespace tl

void zero();

constexpr T operator [] (int) const;
T& operator [] (int);

///@}

constexpr bool operator == (const Vector4<T>&) const;
Expand Down
48 changes: 39 additions & 9 deletions lib/tlCore/VectorInline.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,55 @@ namespace tl
template<typename T>
inline void Vector2<T>::zero()
{
x = T(0);
y = T(0);
x = y = T(0);
}

template<typename T>
inline void Vector3<T>::zero()
{
x = T(0);
y = T(0);
z = T(0);
x = y = z = T(0);
}

template<typename T>
inline void Vector4<T>::zero()
{
x = T(0);
y = T(0);
z = T(0);
w = T(0);
x = y = z = w = T(0);
}

template<typename T>
constexpr T Vector2<T>::operator [] (int index) const
{
return 0 == index ? x : y;
}

template<typename T>
T& Vector2<T>::operator [] (int index)
{
return 0 == index ? x : y;
}

template<typename T>
constexpr T Vector3<T>::operator [] (int index) const
{
return 0 == index ? x : (1 == index ? y : z);
}

template<typename T>
T& Vector3<T>::operator [] (int index)
{
return 0 == index ? x : (1 == index ? y : z);
}

template<typename T>
constexpr T Vector4<T>::operator [] (int index) const
{
return 0 == index ? x : (1 == index ? y : (2 == index ? z : w));
}

template<typename T>
T& Vector4<T>::operator [] (int index)
{
return 0 == index ? x : (1 == index ? y : (2 == index ? z : w));
}

template<typename T>
Expand Down
3 changes: 1 addition & 2 deletions lib/tlPlayQtApp/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include <tlPlayQtApp/DevicesModel.h>
#include <tlPlayQtApp/MainWindow.h>
#include <tlPlayQtApp/MemoryTimeline.h>
#include <tlPlayQtApp/OpenSeparateAudioDialog.h>
#include <tlPlayQtApp/SettingsObject.h>

Expand Down Expand Up @@ -786,7 +785,7 @@ namespace tl
timeline::create(items[i]->path, items[i]->audioPath, _context, options);
if (0)
{
createMemoryTimeline(
timeline::toMemoryReferences(
otioTimeline,
items[i]->path.getDirectory(),
options.pathOptions);
Expand Down
2 changes: 0 additions & 2 deletions lib/tlPlayQtApp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ set(HEADERS
InfoTool.h
InfoModel.h
MainWindow.h
MemoryTimeline.h
MessagesTool.h
OpenSeparateAudioDialog.h
PlaybackActions.h
Expand Down Expand Up @@ -47,7 +46,6 @@ set(SOURCE
InfoTool.cpp
InfoModel.cpp
MainWindow.cpp
MemoryTimeline.cpp
MessagesTool.cpp
OpenSeparateAudioDialog.cpp
PlaybackActions.cpp
Expand Down
Loading

0 comments on commit c6c2707

Please sign in to comment.