This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T, typename TValue, typename TIntermediate = double> | |
T color_normalize( TValue value, TValue valuemax = color_limits<TValue>::max( ), TValue valuemin = color_limits<TValue>::max( ), T max = color_limits<T>::max( ), T min = color_limits<T>::min( ) ) { | |
TIntermediate valuerange = static_cast<TIntermediate>( value - valuemin ) / static_cast<TIntermediate>( valuemax ); | |
return static_cast<T>( valuerange * ( max - min ) ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T, ulword n, typename Tw> | |
RVector<T, n> lerp( const RVector<T, n>& from, const RVector<T, n>& towards, Tw weight ) { | |
weight = Mathema<Tw>::MiniMax( weight, static_cast<Tw>( 0 ), static_cast<Tw>( 1 ) ); | |
Tw affweight = 1.0f - weight; | |
RVector<T, n> r; | |
for ( ulword i = 0; i < n; ++i ) { | |
r[ i ] = static_cast<T>( from[i] * weight + affweight * towards[i] ); | |
} | |
return r; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace foo { | |
struct bar { | |
bar(qux a, | |
quux b); | |
int xxx; | |
double yyy; | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
struct adder { | |
template <typename Tl, typename Tr> | |
auto operator()( Tl&& left, Tr&& right ) | |
-> decltype( left + right ) { | |
return left + right; | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace sol { | |
template <typename... Tn> | |
struct constructors { }; | |
template <typename T> | |
class lua_class { | |
public: | |
static const std::string classname; | |
static const std::string meta; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sol/state.hpp> | |
#include <sol/lua_function.hpp> | |
#include <sol/demangle.hpp> | |
#include <vector> | |
namespace sol { | |
template <typename... Tn> | |
struct constructors { }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SeparableKernelFilter( std::initializer_list<float> kx, std::initializer_list<float> ky ) | |
: SeparableKernelFilter( std::move( kx ), std::move( ky ), dummy ) { | |
} | |
template <typename Tx, typename Ty> | |
SeparableKernelFilter ( Tx&& xkern, Ty&& ykern, dummy_t = dummy ) { | |
for ( auto& x : xkern ) { | |
xkernel.push_back( static_cast<float>( x ) ); | |
} | |
for ( auto& y : ykern ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\accctrl.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\aclapi.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\aclui.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\activation.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\activaut.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\activecf.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\activeds.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\mingw64\x86_64-w64-mingw32\include\activprof.h" | |
skip file "C:\Program Files\mingw-w64\x86_64-4.9.0-posix-seh-rt_v3-rev2\min |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool present; | |
struct storage_t { | |
T& ref; | |
} storage; | |
template <typename... Tn> | |
void place( Tn&&... argn ) { | |
assert( !present ); | |
unchecked_place( std::forward<Tn>( argn )... ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
T& value( ) const { | |
typedef decltype( std::addressof( storage ) ) storage_address_t; | |
typedef typename std::conditional<std::is_const<T>::value, const void, void>::type void_t; | |
typedef typename std::remove_const<storage_address_t>::type address_t; | |
return *static_cast<T*>( static_cast<void_t*>( const_cast<address_t>( std::addressof( storage ) ) ) ); | |
} |
OlderNewer