diff --git a/src/core/geometry_func.cpp b/src/core/geometry_func.cpp index 162f2eae57..11722c0a4d 100644 --- a/src/core/geometry_func.cpp +++ b/src/core/geometry_func.cpp @@ -26,3 +26,17 @@ Dimension maxdim(const Dimension &d1, const Dimension &d2) d.height = max(d1.height, d2.height); return d; } + +/** + * Compute sum of both dimensions. + * @param d1 First dimension. + * @param d2 Second dimension. + * @return The sum of both dimensions. + */ +Dimension adddim(const Dimension &d1, const Dimension &d2) +{ + Dimension d; + d.width = d1.width + d2.width; + d.height = d1.height + d2.height; + return d; +} diff --git a/src/core/geometry_func.hpp b/src/core/geometry_func.hpp index cd136488ac..09d9d08b12 100644 --- a/src/core/geometry_func.hpp +++ b/src/core/geometry_func.hpp @@ -13,5 +13,6 @@ #include "geometry_type.hpp" Dimension maxdim(const Dimension &d1, const Dimension &d2); +Dimension adddim(const Dimension &d1, const Dimension &d2); #endif /* GEOMETRY_FUNC_HPP */