libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
util.h File Reference
#include <array>
#include <stdexcept>
#include <cstdint>
#include <limits>
#include <type_traits>
#include <promeki/core/namespace.h>
#include <promeki/core/platform.h>
#include <promeki/core/error.h>
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PROMEKI_ASSERT(x)
 
#define PROMEKI_STATIC_ASSERT(x)   static_assert(x, __LINE__ ":" PROMEKI_STRINGIFY(__LINE__) " Assertion failed: " PROMEKI_STRINGIFY(x));
 
#define PROMEKI_STRINGIFY_ARGS(...)   #__VA_ARGS__
 
#define PROMEKI_STRINGIFY_IMPL(value)   #value
 
#define PROMEKI_STRINGIFY(value)   PROMEKI_STRINGIFY_IMPL(value)
 
#define PROMEKI_CONCAT_IMPL(v1, v2)   v1##v2
 
#define PROMEKI_CONCAT(v1, v2)   PROMEKI_CONCAT_IMPL(v1, v2)
 
#define PROMEKI_UNIQUE_ID   PROMEKI_CONCAT(__LINE__, __COUNTER__)
 
#define PROMEKI_ARRAY_SIZE(array)   (sizeof(array) / sizeof(array[0]))
 
#define PROMEKI_ALIGN_UP(x, align)   (((x) + ((align) - 1)) & ~((align) - 1))
 
#define PROMEKI_PRINTF_FUNC(m, n)
 
#define PROMEKI_PACKED_STRUCT_BEGIN
 
#define PROMEKI_PACKED_STRUCT_END
 

Functions

StringList promekiStackTrace (bool demangle=true)
 
template<typename OutputType , typename InputType >
OutputType promekiConvert (const InputType &input, Error *err=nullptr)
 
template<typename T >
T promekiLerp (const T &a, const T &b, const double &t)
 
template<typename T >
T promekiCatmullRom (const std::array< T, 4 > &points, T t)
 
template<typename T >
T promekiBezier (const std::array< T, 4 > &points, T t)
 
template<typename T >
T promekiBicubic (const std::array< std::array< T, 4 >, 4 > &points, T x, T y)
 
template<typename T >
T promekiCubic (const std::array< T, 4 > &points, T t)
 

Detailed Description

See LICENSE file in the project root folder for license information.

Macro Definition Documentation

◆ PROMEKI_ASSERT

#define PROMEKI_ASSERT (   x)
Value:
if(!(x)) { \
promekiErr("Assertion failed: " PROMEKI_STRINGIFY(x)); \
throw std::runtime_error(__FILE__ ":" PROMEKI_STRINGIFY(__LINE__) " Assertion failed: " PROMEKI_STRINGIFY(x)); \
}
Dynamic array container wrapping std::vector.
Definition list.h:40
@ Err
Error messages.
Definition logger.h:110