return value;
}
-/*template<typename T>
+template<typename T>
typename std::enable_if<sizeof(T) == sizeof(std::uint16_t), T>::type swap_byte_order(
const T& value)
{
#ifdef _MSC_VER
auto swapped = _byteswap_ushort(reinterpret_cast<const unsigned short&>(value));
#elif __GNUC__
- auto swapped = __builtin_bswap32(value);
+ auto swapped = __builtin_bswap16(value);
#endif
return reinterpret_cast<const T&>(swapped);
-}*/
+}
template<typename T>
typename std::enable_if<sizeof(T) == sizeof(std::uint32_t), T>::type swap_byte_order(
#include <array>
+#if defined(_MSC_VER)
+#pragma warning (push)
+#pragma warning (disable : 4244)
+#endif
+extern "C"
+{
#include <libavutil/avutil.h>
+}
+#if defined(_MSC_VER)
+#pragma warning (pop)
+#endif
struct AVFrame;
struct AVFormatContext;
blurred_copy.reset(new uint8_t[count]);
image_view<bgra_pixel> blurred_view(blurred_copy.get(), width_, height_);
- core::tweener blur_tweener(L"easeInQuad");
+ caspar::tweener blur_tweener(L"easeInQuad");
blur(original_view, blurred_view, angle, motion_blur_px, blur_tweener);
bytes = blurred_copy.get();
bitmap.reset();
};
template<class T>
-std::vector<T> get_tweened_values(const core::tweener& tweener, size_t num_values, T from, T to)
+std::vector<T> get_tweened_values(const caspar::tweener& tweener, size_t num_values, T from, T to)
{
std::vector<T> result;
result.reserve(num_values);
const SrcView& src,
DstView& dst,
const std::vector<std::pair<int, int>>& motion_trail_coordinates,
- const core::tweener& tweener)
+ const caspar::tweener& tweener)
{
auto blur_px = motion_trail_coordinates.size();
auto tweened_weights_y = get_tweened_values<uint8_t>(tweener, blur_px + 2, 255, 0);
DstView& dst,
double angle_radians,
int blur_px,
- const core::tweener& tweener)
+ const caspar::tweener& tweener)
{
auto motion_trail = get_line_points(blur_px, angle_radians);
cmake_minimum_required (VERSION 2.6)
project (shell)
+if (MSVC)
+ set(OS_SPECIFIC_SOURCES
+ resource.h
+ shell.rc
+ )
+elseif (CMAKE_COMPILER_IS_GNUCXX)
+ set(OS_SPECIFIC_SOURCES
+ )
+endif ()
set(SOURCES
main.cpp
server.cpp
stdafx.cpp
)
set(HEADERS
- resource.h
server.h
stdafx.h
)
-add_executable(casparcg ${SOURCES} ${HEADERS})
+add_executable(casparcg ${SOURCES} ${HEADERS} ${OS_SPECIFIC_SOURCES})
add_precompiled_header(casparcg stdafx.h FORCEINCLUDE)
include_directories(..)