├── src
├── stable.cpp
├── xdog-demo.rc
├── test.png
├── xdog-demo.icns
├── xdog-demo.ico
├── resources.qrc
├── stable.h
├── main.cpp
├── CMakeLists.txt
└── mainwindow.h
├── util
├── stable.cpp
├── stable.h
├── settingscheck.h
├── logwindow.h
├── cudadevicedialog.h
├── CMakeLists.txt
├── libav_encoder.h
├── settingscheck.cpp
├── imageutil.h
├── fancystyle.h
├── cudadevicedialog.ui
├── rolloutbox.h
├── videocontrols.h
├── libav_decoder.h
├── videoplayer.h
├── paramui.h
├── imageview.h
├── logwindow.cpp
├── imageutil.cpp
├── videocontrols.cpp
├── rolloutbox.cpp
└── cudadevicedialog.cpp
├── .gitignore
├── version.h.in
├── gpu
├── CMakeLists.txt
├── gpu_noise.h
├── gpu_cache.h
├── gpu_convert.h
├── gpu_etf.h
├── gpu_minmax.h
├── gpu_dog2.h
├── gpu_error.h
├── gpu_bilateral.h
├── gpu_shuffle.h
├── gpu_gauss.h
├── gpu_util.h
├── gpu_stbf2.h
├── cpu_sampler.h
├── gpu_dog.h
├── gpu_binder.h
├── gpu_color.h
├── gpu_grad.h
├── gpu_noise.cu
├── gpu_plm2.h
├── gpu_oabf.h
├── gpu_error.cpp
├── gpu_blend.h
├── gpu_wog.h
├── gpu_sampler.h
├── gpu_stgauss2.cpp
├── gpu_cache.cpp
├── gpu_convert.cu
├── gpu_image.cu
├── gpu_st.h
├── gpu_dog2.cu
├── gpu_image.h
├── gpu_oabf.cu
├── cpu_image.h
├── gpu_util.cu
├── basic_image.h
├── gpu_bilateral.cu
├── gpu_minmax.cu
├── gpu_stgauss2.h
├── gpu_etf.cu
├── gpu_dog.cu
├── gpu_stgauss2.cu
├── gpu_gauss.cu
└── gpu_wog.cu
├── CMakeLists.txt
└── cmake
├── SetupCUDA.cmake
├── SetupCPack.cmake
├── FindLibav.cmake
└── Utils.cmake
/src/stable.cpp:
--------------------------------------------------------------------------------
1 | #include "stable.h"
2 |
--------------------------------------------------------------------------------
/util/stable.cpp:
--------------------------------------------------------------------------------
1 | #include "stable.h"
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | CMakeLists.txt.user
3 |
--------------------------------------------------------------------------------
/src/xdog-demo.rc:
--------------------------------------------------------------------------------
1 | IDI_ICON1 ICON DISCARDABLE "xdog-demo.ico"
--------------------------------------------------------------------------------
/version.h.in:
--------------------------------------------------------------------------------
1 | #define PACKAGE_VERSION "@CPACK_PACKAGE_VERSION@"
2 |
--------------------------------------------------------------------------------
/src/test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gonzojive/xdog/HEAD/src/test.png
--------------------------------------------------------------------------------
/src/xdog-demo.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gonzojive/xdog/HEAD/src/xdog-demo.icns
--------------------------------------------------------------------------------
/src/xdog-demo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gonzojive/xdog/HEAD/src/xdog-demo.ico
--------------------------------------------------------------------------------
/src/resources.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | test.png
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gpu/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | FILE(GLOB sources *.cpp *.h *.cu)
2 | CUDA_ADD_LIBRARY(gpu ${sources})
3 | SOURCE_GROUP(src REGULAR_EXPRESSION "c$|cpp$|hpp$|h$|ui$|qrc$|cu$")
4 |
--------------------------------------------------------------------------------
/util/stable.h:
--------------------------------------------------------------------------------
1 | #ifndef INCLUDED_STABLE_H
2 | #define INCLUDED_STABLE_H
3 |
4 | #ifdef WIN32
5 | #define WINDOWS_LEAN_AND_MEAN
6 | #define NOMINMAX
7 | #endif
8 |
9 | #include
10 | #include
11 |
12 | #endif
13 |
--------------------------------------------------------------------------------
/src/stable.h:
--------------------------------------------------------------------------------
1 | #ifndef INCLUDED_STABLE_H
2 | #define INCLUDED_STABLE_H
3 |
4 | #ifdef __cplusplus
5 |
6 | #ifdef WIN32
7 | #define WINDOWS_LEAN_AND_MEAN
8 | #define NOMINMAX
9 | #endif
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #ifdef min
16 | #undef min
17 | #endif
18 | #ifdef max
19 | #undef max
20 | #endif
21 |
22 | #endif
23 | #endif
24 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2 | PROJECT(xdog-demo)
3 |
4 | SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" )
5 | SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "limited configs" FORCE)
6 | SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
7 | SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
8 | SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
9 |
10 | INCLUDE(Utils)
11 | INCLUDE(SetupCPack)
12 |
13 | INCLUDE(CPack)
14 | CONFIGURE_FILE(version.h.in ${PROJECT_BINARY_DIR}/version.h @ONLY)
15 |
16 | INCLUDE(SetupCUDA)
17 |
18 | FIND_PACKAGE(Libav QUIET)
19 | IF(LIBAV_FOUND)
20 | ADD_DEFINITIONS(/DHAVE_LIBAV)
21 | ENDIF()
22 |
23 | FIND_PACKAGE(Qt4)
24 |
25 | ADD_SUBDIRECTORY(gpu)
26 | ADD_SUBDIRECTORY(src)
27 | ADD_SUBDIRECTORY(util)
28 |
--------------------------------------------------------------------------------
/util/settingscheck.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | extern void settingsCheck();
19 |
--------------------------------------------------------------------------------
/gpu/gpu_noise.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_noise_random(unsigned w, unsigned h, float a=0, float b=1);
21 |
--------------------------------------------------------------------------------
/gpu/gpu_cache.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include
19 |
20 | void gpu_cache_alloc( void **ptr, unsigned *pitch, unsigned w, unsigned h );
21 | void gpu_cache_free( void *ptr, unsigned pitch, unsigned w, unsigned h );
22 | void gpu_cache_clear();
23 | size_t gpu_cache_size();
24 | size_t gpu_cache_total();
25 |
--------------------------------------------------------------------------------
/gpu/gpu_convert.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_8u_to_32f( const gpu_image& src );
21 | gpu_image gpu_32f_to_8u( const gpu_image& src );
22 | gpu_image gpu_8u_to_32f( const gpu_image& src );
23 | gpu_image gpu_32f_to_8u( const gpu_image& src );
24 |
--------------------------------------------------------------------------------
/cmake/SetupCUDA.cmake:
--------------------------------------------------------------------------------
1 | SET(CUDA_ARCH "sm_10" CACHE STRING "CUDA architecture")
2 | SET_PROPERTY(CACHE CUDA_ARCH PROPERTY STRINGS sm_10 sm_11 sm_20 sm_21 none)
3 | IF(NOT (${CUDA_ARCH} STREQUAL none))
4 | SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};;-arch=${CUDA_ARCH}")
5 | ENDIF()
6 | OPTION(CUDA_PTXAS_VERBOSE "Show ptxas verbose information" OFF)
7 | IF(${CUDA_PTXAS_VERBOSE})
8 | SET(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};;--ptxas-options=-v")
9 | ENDIF()
10 | FIND_PACKAGE(CUDA 4.0 REQUIRED)
11 |
12 | IF(WIN32)
13 | IF(CMAKE_CL_64)
14 | SET(CUDA_LIB_DIR "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64")
15 | ELSE()
16 | SET(CUDA_LIB_DIR "${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32")
17 | ENDIF()
18 | ELSEIF(APPLE)
19 | SET(CUDA_LIB_DIR "${CUDA_TOOLKIT_ROOT_DIR}/lib")
20 | ELSE()
21 | IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
22 | SET(CUDA_LIB_DIR "${CUDA_TOOLKIT_ROOT_DIR}/lib64")
23 | ELSE()
24 | SET(CUDA_LIB_DIR "${CUDA_TOOLKIT_ROOT_DIR}/lib")
25 | ENDIF()
26 | ENDIF()
27 | FIND_LIBRARY(CUDA_npp_LIBRARY npp HINTS "${CUDA_LIB_DIR}")
28 | FIND_LIBRARY(CUDA_curand_LIBRARY curand HINTS "${CUDA_LIB_DIR}")
29 |
--------------------------------------------------------------------------------
/gpu/gpu_etf.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_etf_full( const gpu_image& src, float sigma, int N,
21 | float precision=2, bool gaussian=false );
22 |
23 | gpu_image gpu_etf_xy( const gpu_image& src, float sigma, int N,
24 | float precision=2);
25 |
--------------------------------------------------------------------------------
/gpu/gpu_minmax.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | void gpu_minmax( const gpu_image& src, float *pmin, float *pmax );
21 | float gpu_min( const gpu_image& src );
22 | float gpu_max( const gpu_image& src );
23 |
24 | gpu_image gpu_normalize(const gpu_image& src);
25 | gpu_image gpu_normalize_gray(const gpu_image& src);
26 |
--------------------------------------------------------------------------------
/util/logwindow.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | class LogWindow : public QPlainTextEdit {
19 | Q_OBJECT
20 | public:
21 | LogWindow(QWidget *parent);
22 | ~LogWindow();
23 | virtual void closeEvent(QCloseEvent *e);
24 | virtual void contextMenuEvent(QContextMenuEvent *event);
25 |
26 | public slots:
27 | void logText(const QString& msg);
28 |
29 | public:
30 | static void install();
31 | };
32 |
--------------------------------------------------------------------------------
/gpu/gpu_dog2.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_isotropic_dog2( const gpu_image& src,
21 | float sigma, float k, float p, float precision=2 );
22 |
23 | gpu_image gpu_gradient_dog2( const gpu_image& src, const gpu_image& tfab,
24 | float sigma, float k, float p, float precision=2 );
25 |
--------------------------------------------------------------------------------
/gpu/gpu_error.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include
19 |
20 | extern void gpu_error_msg(cudaError_t err, const char *file, size_t line);
21 |
22 | #define GPU_CHECK_ERROR() \
23 | { cudaError_t err = cudaGetLastError(); if (err != cudaSuccess) gpu_error_msg(err, __FILE__, __LINE__); }
24 |
25 | #define GPU_SAFE_CALL( call ) \
26 | { cudaError_t err = call; if (err != cudaSuccess) gpu_error_msg(err, __FILE__, __LINE__); }
27 |
--------------------------------------------------------------------------------
/util/cudadevicedialog.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | class Ui_CudaDeviceDialog;
19 |
20 | class CudaDeviceDialog : public QDialog {
21 | Q_OBJECT
22 | public:
23 | CudaDeviceDialog(QWidget *parent);
24 | static int select(bool force=false);
25 |
26 | protected slots:
27 | void updateInfo(int index);
28 |
29 | protected:
30 | void addItem(int pad, const QString& a, const QString& b=QString::null);
31 | QString m_infoText;
32 | Ui_CudaDeviceDialog *m;
33 | };
34 |
--------------------------------------------------------------------------------
/util/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | INCLUDE(${QT_USE_FILE})
2 |
3 | INCLUDE_DIRECTORIES(
4 | ${CMAKE_CURRENT_SOURCE_DIR}
5 | ${CMAKE_CURRENT_BINARY_DIR}
6 | ${PROJECT_SOURCE_DIR}/gpu
7 | ${PROJECT_BINARY_DIR} )
8 |
9 | FILE(GLOB sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h *.ui)
10 | IF(LIBAV_FOUND)
11 | INCLUDE_DIRECTORIES( ${LIBAV_INCLUDE_DIR} )
12 | ELSE()
13 | LIST(REMOVE_ITEM sources
14 | libav_decoder.cpp
15 | libav_decoder.h
16 | libav_encoder.cpp
17 | libav_encoder.h )
18 | ENDIF()
19 |
20 | QT4_AUTO_WRAP( sources ${sources} )
21 | CUDA_ADD_LIBRARY( util STATIC ${sources} )
22 |
23 | SOURCE_GROUP( src REGULAR_EXPRESSION "c$|cpp$|hpp$|h$|ui$|qrc$|cu$" )
24 | SOURCE_GROUP( generated REGULAR_EXPRESSION "cxx$|ui_" )
25 |
26 | IF(MSVC)
27 | IF(MSVC_IDE)
28 | SET_TARGET_PROPERTIES( util PROPERTIES COMPILE_FLAGS "/FIstable.h /Yustable.h" )
29 | SET_SOURCE_FILES_PROPERTIES( stable.cpp PROPERTIES COMPILE_FLAGS "/Ycstable.h" )
30 | ELSE()
31 | SET_TARGET_PROPERTIES( util PROPERTIES COMPILE_FLAGS "/FIstable.h" )
32 | ENDIF()
33 | ELSE(MSVC)
34 | SET_TARGET_PROPERTIES( util PROPERTIES COMPILE_FLAGS "-include stable.h" )
35 | ENDIF(MSVC)
36 |
--------------------------------------------------------------------------------
/gpu/gpu_bilateral.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_bilateral_filter( const gpu_image& src, float sigma_d, float sigma_r, float precision=2 );
21 | gpu_image gpu_bilateral_filter( const gpu_image& src, float sigma_d, float sigma_r, float precision=2 );
22 |
23 | gpu_image gpu_bilateral_filter_xy( const gpu_image& src, float sigma_d, float sigma_r, float precision=2 );
24 | gpu_image gpu_bilateral_filter_xy( const gpu_image& src, float sigma_d, float sigma_r, float precision=2 );
25 |
--------------------------------------------------------------------------------
/gpu/gpu_shuffle.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_shuffle( const gpu_image& src, int x );
21 | gpu_image gpu_shuffle( const gpu_image& src, int x );
22 |
23 | gpu_image gpu_shuffle( const gpu_image& src, int x, int y );
24 | gpu_image gpu_shuffle( const gpu_image& src, int x, int y );
25 |
26 | gpu_image gpu_shuffle( const gpu_image& src, int x, int y, int z, int w );
27 | gpu_image gpu_shuffle( const gpu_image& src, int x, int y, int z, int w );
28 |
--------------------------------------------------------------------------------
/gpu/gpu_gauss.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_gauss_filter( const gpu_image& src, float sigma, float precision=2 );
21 | gpu_image gpu_gauss_filter( const gpu_image& src, float sigma, float precision=2 );
22 |
23 | gpu_image gpu_gauss_filter_xy( const gpu_image& src, float sigma, float precision=2 );
24 | gpu_image gpu_gauss_filter_xy( const gpu_image& src, float sigma, float precision=2 );
25 |
26 | gpu_image gpu_gauss_filter_3x3( const gpu_image& src );
27 | gpu_image gpu_gauss_filter_5x5( const gpu_image& src );
28 |
--------------------------------------------------------------------------------
/gpu/gpu_util.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | extern gpu_image gpu_adjust( const gpu_image& src, float a, float b );
21 | extern gpu_image gpu_adjust( const gpu_image& src, float4 a, float4 b );
22 |
23 | extern gpu_image gpu_invert( const gpu_image& src);
24 | extern gpu_image gpu_invert( const gpu_image& src);
25 |
26 | extern gpu_image gpu_saturate( const gpu_image& src);
27 | extern gpu_image gpu_saturate( const gpu_image& src);
28 |
29 | extern gpu_image gpu_lerp( const gpu_image& src0, const gpu_image& src1, float t );
30 |
--------------------------------------------------------------------------------
/gpu/gpu_stbf2.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_stbf2_filter( const gpu_image& src, const gpu_image& st,
21 | float sigma_d, float sigma_r, float precision, float max_angle, bool adaptive,
22 | bool src_linear, bool st_linear, int order, float step_size );
23 |
24 | gpu_image gpu_stbf2_filter( const gpu_image& src, const gpu_image& st,
25 | float sigma_d, float sigma_r, float precision, float max_angle, bool adaptive,
26 | bool src_linear, bool st_linear, int order, float step_size );
27 |
--------------------------------------------------------------------------------
/gpu/cpu_sampler.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | template
21 | struct cpu_sampler {
22 | const cpu_image& img_;
23 | cudaTextureFilterMode filter_mode_;
24 |
25 | cpu_sampler(const cpu_image& img, cudaTextureFilterMode filter_mode=cudaFilterModePoint)
26 | : img_(img), filter_mode_(filter_mode)
27 | { }
28 |
29 | unsigned w() const {
30 | return img_.w();
31 | }
32 |
33 | unsigned h() const {
34 | return img_.w();
35 | }
36 |
37 | T operator()(float x, float y) const {
38 | return (filter_mode_ == cudaFilterModePoint)? img_(x, y) : img_.sample_linear(x, y);
39 | }
40 | };
41 |
--------------------------------------------------------------------------------
/gpu/gpu_dog.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_isotropic_dog( const gpu_image& src,
21 | float sigma, float k, float tau, float precision=2 );
22 |
23 | gpu_image gpu_gradient_dog( const gpu_image& src, const gpu_image& tfab,
24 | float sigma, float k, float tau, float precision=2 );
25 |
26 | gpu_image gpu_dog_threshold_tanh( const gpu_image& src, float epsilon, float phi );
27 | gpu_image gpu_dog_threshold_smoothstep( const gpu_image& src, float epsilon, float phi );
28 | gpu_image gpu_dog_colorize( const gpu_image& src );
29 |
--------------------------------------------------------------------------------
/util/libav_encoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2011 by Jan Eric Kyprianidis
3 | //
4 | // Permission to use, copy, modify, and/or distribute this software for any
5 | // purpose with or without fee is hereby granted, provided that the above
6 | // copyright notice and this permission notice appear in all copies.
7 | //
8 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 | //
16 | #pragma once
17 |
18 | class libav_encoder {
19 | public:
20 | typedef unsigned char uint8_t;
21 | typedef long long int64_t;
22 |
23 | static libav_encoder* create( const char *path, unsigned width, unsigned height,
24 | const std::pair& frame_rate,
25 | int bit_rate = 8000000 );
26 | ~libav_encoder();
27 |
28 | bool append_frame ( const uint8_t *buffer );
29 | void finish ();
30 |
31 | private:
32 | struct impl;
33 | impl *m;
34 | libav_encoder(impl*);
35 | };
36 |
--------------------------------------------------------------------------------
/gpu/gpu_binder.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | #ifdef __CUDACC__
21 |
22 | template
23 | struct gpu_binder {
24 | texture& texture_ref;
25 |
26 | __host__ gpu_binder( texture& tf, const gpu_image& img,
27 | cudaTextureFilterMode filter_mode=cudaFilterModePoint )
28 | : texture_ref(tf)
29 | {
30 | texture_ref.filterMode = filter_mode;
31 | GPU_SAFE_CALL(cudaBindTexture2D(0, texture_ref, img.ptr(), img.w(), img.h(), img.pitch()));
32 | }
33 |
34 | __host__ ~gpu_binder() {
35 | texture_ref.filterMode = cudaFilterModePoint;
36 | cudaUnbindTexture(texture_ref);
37 | }
38 | };
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/util/settingscheck.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #include "settingscheck.h"
17 | #include "version.h"
18 |
19 |
20 | void settingsCheck() {
21 | QSettings settings;
22 | QString current = settings.value("version").toString();
23 | if (current != PACKAGE_VERSION) {
24 | if (current.isEmpty() ||
25 | QMessageBox::warning(NULL, "Warning",
26 | QString("Version of settings is invalid (\"%1\" != \"%2\"). "
27 | "Reset settings? (Yes, unless you know what you are doing!)").arg(current).arg(PACKAGE_VERSION),
28 | QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes)
29 | {
30 | settings.remove("");
31 | }
32 | settings.setValue("version", PACKAGE_VERSION);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #include "mainwindow.h"
17 | #include "fancystyle.h"
18 | #include "settingscheck.h"
19 | #include "cudadevicedialog.h"
20 | #include "logwindow.h"
21 |
22 |
23 | int main(int argc, char **argv) {
24 | LogWindow::install();
25 | QApplication::setOrganizationDomain("jkyprian.hpi3d.de");
26 | QApplication::setOrganizationName("jkyprian");
27 | QApplication::setApplicationName("xdogref");
28 | QApplication app(argc, argv);
29 | QApplication::setStyle(new FancyStyle);
30 | settingsCheck();
31 | if (CudaDeviceDialog::select() < 0) return 1;
32 |
33 | MainWindow mw;
34 | mw.showNormal();
35 | app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()));
36 | int result = app.exec();
37 | return 0;
38 | }
39 |
--------------------------------------------------------------------------------
/gpu/gpu_color.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_srgb2linear( const gpu_image& src);
21 | gpu_image gpu_linear2srgb( const gpu_image& src);
22 |
23 | gpu_image gpu_srgb2linear( const gpu_image& src);
24 | gpu_image gpu_linear2srgb( const gpu_image& src);
25 |
26 | gpu_image gpu_rgb2lab( const gpu_image& src);
27 | gpu_image gpu_lab2rgb( const gpu_image& src);
28 | gpu_image gpu_l2rgb( const gpu_image& src );
29 |
30 | gpu_image gpu_gray2rgb( const gpu_image& src, bool saturate=true );
31 | gpu_image gpu_rgb2gray( const gpu_image& src );
32 |
33 | gpu_image gpu_swap_rgba( const gpu_image& src );
34 |
--------------------------------------------------------------------------------
/gpu/gpu_grad.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_grad_central_diff( const gpu_image& src, bool normalize );
21 | gpu_image gpu_grad_scharr_for_axis( const gpu_image& src, int axis );
22 | gpu_image gpu_grad_scharr( const gpu_image& src, bool normalize );
23 |
24 | gpu_image gpu_grad_to_axis( const gpu_image& src, bool squared );
25 | gpu_image gpu_grad_from_axis( const gpu_image& src, bool squared );
26 | gpu_image gpu_grad_to_angle( const gpu_image& src );
27 | gpu_image gpu_grad_to_lfm( const gpu_image& src );
28 |
29 | gpu_image gpu_grad_sobel_mag( const gpu_image& src );
30 | gpu_image gpu_grad_sobel_mag( const gpu_image& src );
31 |
--------------------------------------------------------------------------------
/gpu/gpu_noise.cu:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #include "gpu_noise.h"
17 | #include
18 |
19 |
20 | static int randi() {
21 | static bool first = true;
22 | if (first) {
23 | first = false;
24 | std::srand(clock());
25 | }
26 | return std::rand();
27 | }
28 |
29 |
30 | static float randf() {
31 | return (float)randi()/RAND_MAX;
32 | }
33 |
34 |
35 | gpu_image gpu_noise_random(unsigned w, unsigned h, float a, float b) {
36 | float *n = new float[w * h];
37 | float *p = n;
38 | float da = b - a;
39 | for (unsigned j = 0; j < h; ++j) {
40 | for (unsigned i = 0; i < w; ++i) {
41 | *p++ = a + da * randf();
42 | }
43 | }
44 |
45 | gpu_image dst(n, w, h);
46 | delete[] n;
47 | return dst;
48 | }
49 |
--------------------------------------------------------------------------------
/gpu/gpu_plm2.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | template
19 | struct gpu_plm2 {
20 | T *ptr;
21 | unsigned stride;
22 | unsigned w;
23 | unsigned h;
24 |
25 | __host__ gpu_plm2() {
26 | ptr = 0;
27 | stride = w = h = 0;
28 | }
29 |
30 | __host__ gpu_plm2(T *ptr, unsigned pitch, unsigned w, unsigned h) {
31 | this->ptr = ptr;
32 | this->stride = pitch / sizeof(T);
33 | this->w = w;
34 | this->h = h;
35 | }
36 |
37 | #ifdef __CUDACC__
38 |
39 | inline __device__ T& operator()(int x, int y) {
40 | return ptr[y * stride + x];
41 | }
42 |
43 | inline __device__ const T& operator()(int x, int y) const {
44 | return ptr[y * stride + x];
45 | }
46 |
47 | #endif
48 | };
49 |
--------------------------------------------------------------------------------
/gpu/gpu_oabf.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_oabf_1d( const gpu_image& src, const gpu_image& lfm,
21 | float sigma_d, float sigma_r, bool tangential, float precision=2 );
22 |
23 | gpu_image gpu_oabf_1d( const gpu_image& src, const gpu_image& lfm,
24 | float sigma_d, float sigma_r, bool tangential, float precision=2 );
25 |
26 | gpu_image gpu_oabf( const gpu_image& src, const gpu_image& lfm,
27 | float sigma_d, float sigma_r, float precision=2);
28 |
29 | gpu_image gpu_oabf( const gpu_image& src, const gpu_image& lfm,
30 | float sigma_d, float sigma_r, float precision=2 );
31 |
--------------------------------------------------------------------------------
/util/imageutil.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | cpu_image cpu_image_from_qimage(const QImage& image);
21 |
22 | QImage cpu_data_to_qimage(const cpu_image_data *data);
23 | template
24 | inline QImage cpu_image_to_qimage(const cpu_image& image) {
25 | return cpu_data_to_qimage(image.data());
26 | }
27 |
28 | template gpu_image gpu_image_from_qimage(const QImage& image);
29 | template <> gpu_image gpu_image_from_qimage(const QImage& image);
30 | template <> gpu_image gpu_image_from_qimage(const QImage& image);
31 |
32 | QImage gpu_image_to_qimage(const gpu_image& image);
33 | QImage gpu_image_to_qimage(const gpu_image& image);
34 | QImage gpu_image_to_qimage(const gpu_image& image);
35 | QImage gpu_image_to_qimage(const gpu_image& image);
36 |
--------------------------------------------------------------------------------
/util/fancystyle.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | class FancyStyle : public QPlastiqueStyle {
19 | public:
20 | QSize sizeFromContents( ContentsType type, const QStyleOption *option,
21 | const QSize &size, const QWidget *widget ) const;
22 |
23 | void drawPrimitive( PrimitiveElement element, const QStyleOption *option,
24 | QPainter *painter, const QWidget *widget = 0 ) const;
25 |
26 | void drawControl( ControlElement element, const QStyleOption *option,
27 | QPainter *painter, const QWidget *widget) const;
28 |
29 | int styleHint( StyleHint hint, const QStyleOption *option = 0, const QWidget *widget = 0,
30 | QStyleHintReturn *returnData = 0 ) const;
31 |
32 | void polish(QApplication *application);
33 | void polish(QWidget *widget);
34 | QPalette standardPalette() const;
35 | };
36 |
--------------------------------------------------------------------------------
/gpu/gpu_error.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #include "gpu_error.h"
17 | #ifdef WIN32
18 | #include
19 | #include
20 | #else
21 | #include
22 | #include
23 | #endif
24 |
25 |
26 | void gpu_error_msg(cudaError_t err, const char *file, size_t line) {
27 | #ifdef WIN32
28 | if (!IsDebuggerPresent()) {
29 | std::ostringstream oss;
30 | oss << cudaGetErrorString(err) << "\n"
31 | << file << "(" << line << ")";
32 | MessageBoxA(NULL, oss.str().c_str(), "CUDA Error", MB_OK | MB_ICONERROR);
33 | } else {
34 | OutputDebugStringA("CUDA Error: ");
35 | OutputDebugStringA(cudaGetErrorString(err));
36 | OutputDebugStringA("\n");
37 | DebugBreak();
38 | }
39 | #else
40 | fprintf(stderr, "%s(%d): CUDA Error\n", file, (int)line);
41 | fprintf(stderr, "%s\n", cudaGetErrorString(err));
42 | #endif
43 | exit(1);
44 | }
45 |
--------------------------------------------------------------------------------
/gpu/gpu_blend.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis and Daniel Müller
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | enum gpu_blend_mode {
21 | GPU_BLEND_NORMAL,
22 | GPU_BLEND_MULTIPLY,
23 | GPU_BLEND_SCREEN,
24 | GPU_BLEND_HARD_LIGHT,
25 | GPU_BLEND_SOFT_LIGHT,
26 | GPU_BLEND_OVERLAY,
27 | GPU_BLEND_LINEAR_BURN,
28 | GPU_BLEND_DIFFERENCE,
29 | GPU_BLEND_LINEAR_DODGE
30 | };
31 |
32 | gpu_image gpu_blend( const gpu_image& back, const gpu_image& src,
33 | gpu_blend_mode mode );
34 |
35 | gpu_image gpu_blend( const gpu_image& back, const gpu_image& src,
36 | gpu_blend_mode mode );
37 |
38 |
39 | //gpu_image gpu_blend_intensity( const gpu_image& back, const gpu_image& src,
40 | // gpu_blend_mode mode, float color = 1 );
41 |
42 | gpu_image gpu_blend_intensity( const gpu_image& back, const gpu_image& src,
43 | gpu_blend_mode mode, float4 color = make_float4(1));
44 |
--------------------------------------------------------------------------------
/cmake/SetupCPack.cmake:
--------------------------------------------------------------------------------
1 | SET(CPACK_PACKAGE_VERSION_MAJOR "0")
2 | SET(CPACK_PACKAGE_VERSION_MINOR "0")
3 | SET(CPACK_PACKAGE_VERSION_PATCH "0")
4 | IF(APPLE)
5 | SET(CPACK_GENERATOR "DragNDrop")
6 | ELSE()
7 | SET(CPACK_GENERATOR "ZIP")
8 | ENDIF()
9 | set(CPACK_SOURCE_GENERATOR ZIP)
10 |
11 | IF(EXISTS ${PROJECT_SOURCE_DIR}/.git)
12 | FIND_PROGRAM(git_PROG NAMES git git.cmd)
13 | MARK_AS_ADVANCED(git_PROG)
14 | IF(git_PROG)
15 | EXECUTE_PROCESS(
16 | COMMAND ${git_PROG} describe --long
17 | WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
18 | OUTPUT_VARIABLE git_OUTPUT
19 | RESULT_VARIABLE git_RESULT)
20 | IF(${git_RESULT} EQUAL 0)
21 | STRING(REGEX REPLACE "v([0-9])+.[0-9]+-[0-9]+-g[0-9a-f]+.*" "\\1" CPACK_PACKAGE_VERSION_MAJOR "${git_OUTPUT}")
22 | STRING(REGEX REPLACE "v[0-9]+.([0-9])+-[0-9]+-g[0-9a-f]+.*" "\\1" CPACK_PACKAGE_VERSION_MINOR "${git_OUTPUT}")
23 | STRING(REGEX REPLACE "v[0-9]+.[0-9]+-([0-9]+-g[0-9a-f]+).*" "\\1" CPACK_PACKAGE_VERSION_PATCH "${git_OUTPUT}")
24 | ELSE()
25 | MESSAGE(WARNING ${git_OUTPUT})
26 | ENDIF()
27 | ENDIF()
28 | ENDIF()
29 |
30 | SET(CPACK_PACKAGE_VERSION "v${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}-${CPACK_PACKAGE_VERSION_PATCH}")
31 | MESSAGE(STATUS "VERSION: ${CPACK_PACKAGE_VERSION}")
32 |
33 | SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
34 | IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
35 | IF(CMAKE_CL_64)
36 | SET(CPACK_SYSTEM_NAME win64)
37 | ELSE()
38 | SET(CPACK_SYSTEM_NAME win32)
39 | ENDIF()
40 | ENDIF()
41 | IF(${CPACK_SYSTEM_NAME} MATCHES Darwin)
42 | SET(CPACK_SYSTEM_NAME mac)
43 | ENDIF()
44 |
45 | SET(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME})
46 | SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CPACK_PACKAGE_VERSION}-src")
47 | SET(CPACK_SOURCE_IGNORE_FILES "/build/;/.git/")
48 |
--------------------------------------------------------------------------------
/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | SET( QT_USE_QTMAIN 1 )
2 | INCLUDE( ${QT_USE_FILE} )
3 |
4 | INCLUDE_DIRECTORIES(
5 | ${CMAKE_CURRENT_SOURCE_DIR}
6 | ${CMAKE_CURRENT_BINARY_DIR}
7 | ${PROJECT_SOURCE_DIR}
8 | ${PROJECT_SOURCE_DIR}/gpu
9 | ${PROJECT_SOURCE_DIR}/util
10 | ${PROJECT_BINARY_DIR} )
11 |
12 | FILE(GLOB_RECURSE sources *.cpp *.h *.ui *.qrc)
13 | IF(WIN32)
14 | SET( sources ${sources} xdog-demo.rc )
15 | ENDIF()
16 | IF(APPLE)
17 | SET( sources ${sources} xdog-demo.icns )
18 | SET_SOURCE_FILES_PROPERTIES( xdog-demo.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources )
19 | ENDIF()
20 |
21 | QT4_AUTO_WRAP( sources ${sources} )
22 | CUDA_ADD_EXECUTABLE( xdog-demo WIN32 MACOSX_BUNDLE ${sources} )
23 |
24 | SOURCE_GROUP( src REGULAR_EXPRESSION "c$|cpp$|hpp$|h$|ui$|qrc$|cu$" )
25 | SOURCE_GROUP( generated REGULAR_EXPRESSION "cxx$|ui_" )
26 |
27 | IF(MSVC)
28 | IF(MSVC_IDE)
29 | SET_TARGET_PROPERTIES( xdog-demo PROPERTIES COMPILE_FLAGS "/FIstable.h /Yustable.h" )
30 | SET_SOURCE_FILES_PROPERTIES( stable.cpp PROPERTIES COMPILE_FLAGS "/Ycstable.h" )
31 | ELSE()
32 | SET_TARGET_PROPERTIES( xdog-demo PROPERTIES COMPILE_FLAGS "/FIstable.h" )
33 | ENDIF()
34 | ELSE()
35 | SET_TARGET_PROPERTIES( xdog-demo PROPERTIES COMPILE_FLAGS "-include stable.h" )
36 | ENDIF()
37 |
38 | IF(APPLE)
39 | SET_TARGET_PROPERTIES( xdog-demo PROPERTIES MACOSX_BUNDLE_ICON_FILE "xdog-demo.icns" )
40 | ENDIF()
41 |
42 | TARGET_LINK_LIBRARIES( xdog-demo
43 | util gpu
44 | ${QT_LIBRARIES})
45 |
46 | IF(LIBAV_FOUND)
47 | TARGET_LINK_LIBRARIES( xdog-demo ${LIBAV_LIBRARIES} )
48 | IF(MSVC)
49 | SET_TARGET_PROPERTIES( xdog-demo PROPERTIES LINK_FLAGS "/OPT:NOREF" )
50 | ENDIF()
51 | ENDIF()
52 |
53 | INSTALL( TARGETS xdog-demo
54 | BUNDLE DESTINATION .
55 | RUNTIME DESTINATION .
56 | CONFIGURATIONS Debug Release )
57 |
58 | DEPLOY_QT_CUDA(xdog-demo)
59 |
--------------------------------------------------------------------------------
/util/cudadevicedialog.ui:
--------------------------------------------------------------------------------
1 |
2 |
3 | CudaDeviceDialog
4 |
5 |
6 |
7 | 0
8 | 0
9 | 700
10 | 550
11 |
12 |
13 |
14 |
15 | 700
16 | 550
17 |
18 |
19 |
20 | Select CUDA Device
21 |
22 |
23 | -
24 |
25 |
26 | -
27 |
28 |
29 | -
30 |
31 |
32 | Qt::Horizontal
33 |
34 |
35 | QDialogButtonBox::Cancel|QDialogButtonBox::Ok
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | buttonBox
45 | accepted()
46 | CudaDeviceDialog
47 | accept()
48 |
49 |
50 | 248
51 | 254
52 |
53 |
54 | 157
55 | 274
56 |
57 |
58 |
59 |
60 | buttonBox
61 | rejected()
62 | CudaDeviceDialog
63 | reject()
64 |
65 |
66 | 316
67 | 260
68 |
69 |
70 | 286
71 | 274
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/util/rolloutbox.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | class RolloutBox : public QFrame {
19 | Q_OBJECT
20 | public:
21 | RolloutBox(QWidget *parent);
22 |
23 | void saveSettings(QSettings& settings);
24 | void restoreSettings(QSettings& settings);
25 |
26 | void setFrame(bool frame);
27 | QString title() const { return m_toolButton->text(); }
28 | void setTitle(const QString &title);
29 | bool isCheckable() const { return m_checkable; }
30 | void setCheckable(bool checkable);
31 | bool isChecked() const { return m_checked; }
32 | bool isExpanded() const { return m_expanded; }
33 |
34 | QWidgetList widgets() const;
35 | void addWidget(QWidget *w);
36 | void addWidget(QWidget *left, QWidget *right);
37 |
38 | public slots:
39 | void setChecked(bool checked);
40 | void setExpanded(bool expanded);
41 | void toggle();
42 |
43 | signals:
44 | void checkChanged(bool checked = false);
45 | void toggled(bool);
46 |
47 | private:
48 | QGridLayout *m_layout;
49 | QToolButton *m_toolButton;
50 | QCheckBox *m_checkBox;
51 | bool m_checkable;
52 | bool m_checked;
53 | bool m_expanded;
54 |
55 | public:
56 | static void restoreSettings(QSettings& settings, QObject *obj);
57 | static void saveSettings(QSettings& settings, QObject *obj);
58 | };
59 |
60 |
--------------------------------------------------------------------------------
/util/videocontrols.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | class VideoControls : public QFrame {
19 | Q_OBJECT
20 | public:
21 | VideoControls(QWidget *parent);
22 | virtual ~VideoControls();
23 |
24 | void setAutoHide(bool hide);
25 | bool autoHide() const { return m_autoHide; }
26 | bool isPlaying() const { return m_isPlaying; }
27 | bool isTracking() const { return m_isTracking; }
28 |
29 | public slots:
30 | void setFrameCount(int nframes);
31 | void setCurrentFrame(int frame);
32 | void setPlayback(bool playing);
33 | void play();
34 | void pause();
35 | void toogle();
36 |
37 | signals:
38 | void stepForward();
39 | void stepBack();
40 | void currentFrameChanged(int frame);
41 | void currentFrameTracked(int frame);
42 | void playbackChanged(bool playing);
43 | void playbackStarted();
44 | void playbackPaused();
45 | void trackingChanged(bool tracking);
46 | void trackingStarted();
47 | void trackingStopped();
48 |
49 | protected slots:
50 | void handleSliderPressed();
51 | void handleSliderReleased();
52 |
53 | protected:
54 | QHBoxLayout *m_hbox;
55 | bool m_autoHide;
56 | bool m_isPlaying;
57 | bool m_isTracking;
58 | QToolButton *m_prevButton;
59 | QToolButton *m_playButton;
60 | QToolButton *m_nextButton;
61 | QSlider *m_frameSlider;
62 | QSpinBox *m_frameEdit;
63 | };
64 |
--------------------------------------------------------------------------------
/util/libav_decoder.h:
--------------------------------------------------------------------------------
1 | //
2 | // Copyright (c) 2011 by Jan Eric Kyprianidis
3 | //
4 | // Permission to use, copy, modify, and/or distribute this software for any
5 | // purpose with or without fee is hereby granted, provided that the above
6 | // copyright notice and this permission notice appear in all copies.
7 | //
8 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 | //
16 | #pragma once
17 |
18 | class libav_decoder {
19 | public:
20 | typedef std::pair rational;
21 | typedef unsigned char uint8_t;
22 | typedef long long int64_t;
23 |
24 | static libav_decoder* open( const char *path );
25 | ~libav_decoder();
26 |
27 | bool next ();
28 | void rewind ();
29 | void set_time ( int64_t ts, bool exact=true );
30 | void set_frame ( int frame, bool exact=true );
31 |
32 | bool at_end () const;
33 | int width () const;
34 | int height () const;
35 | int64_t duration () const;
36 | int64_t start_time () const;
37 | int64_t end_time () const;
38 | int frame_count () const;
39 | rational frame_rate () const;
40 | rational time_base () const;
41 | uint8_t* buffer () const;
42 | int64_t current_time () const;
43 | int current_frame () const;
44 | double fps () const;
45 | int frame_from_time ( int64_t ts ) const;
46 | int64_t time_from_frame ( int frame ) const;
47 | int64_t ticks () const;
48 | int64_t ticks_from_time (int64_t t) const;
49 | int64_t time_from_ticks (int64_t x) const;
50 |
51 | private:
52 | struct impl;
53 | impl *m;
54 | libav_decoder(impl*);
55 | };
56 |
--------------------------------------------------------------------------------
/cmake/FindLibav.cmake:
--------------------------------------------------------------------------------
1 | # LIBAV_FOUND - system has Libav libraries
2 | # LIBAV_INCLUDE_DIR - the Libav include directory
3 | # LIBAV_LIBRARIES - link these to use Libav
4 |
5 | IF(WIN32)
6 | FIND_PATH( LIBAV_DIR include/libavformat/avformat.h PATH_SUFFIXES .. )
7 | GET_FILENAME_COMPONENT(LIBAV_DIR ${LIBAV_DIR} ABSOLUTE )
8 | SET(LIBAV_DIR ${LIBAV_DIR} CACHE FILEPATH "" FORCE)
9 |
10 | FIND_PATH( LIBAV_INCLUDE_DIR libavformat/avformat.h HINTS ${LIBAV_DIR}/include )
11 |
12 | FIND_LIBRARY( LIBAV_avutil_LIBRARY avutil HINTS ${LIBAV_DIR}/lib )
13 | FIND_LIBRARY( LIBAV_avcodec_LIBRARY avcodec HINTS ${LIBAV_DIR}/lib )
14 | FIND_LIBRARY( LIBAV_avformat_LIBRARY avformat HINTS ${LIBAV_DIR}/lib )
15 | FIND_LIBRARY( LIBAV_swscale_LIBRARY swscale HINTS ${LIBAV_DIR}/lib )
16 |
17 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAV DEFAULT_MSG
18 | LIBAV_INCLUDE_DIR
19 | LIBAV_avutil_LIBRARY
20 | LIBAV_avcodec_LIBRARY
21 | LIBAV_avformat_LIBRARY
22 | LIBAV_swscale_LIBRARY )
23 |
24 | IF(LIBAV_FOUND)
25 | SET(LIBAV_LIBRARIES
26 | ${LIBAV_avcodec_LIBRARY}
27 | ${LIBAV_avformat_LIBRARY}
28 | ${LIBAV_avutil_LIBRARY}
29 | ${LIBAV_swscale_LIBRARY} )
30 | ENDIF()
31 | ELSE()
32 | INCLUDE(FindPkgConfig)
33 | PKG_CHECK_MODULES( LIBAV_PKGCONF QUIET libavutil libavcodec libavformat libswscale )
34 |
35 | FIND_PATH(LIBAV_INCLUDE_DIR libavformat/avformat.h HINTS ${LIBAV_PKGCONG_INCLUDE_DIRS})
36 |
37 | FIND_LIBRARY( LIBAV_avutil_LIBRARY avutil HINTS ${LIBAV_PKGCONF_LIBRARY_DIRS} )
38 | FIND_LIBRARY( LIBAV_avcodec_LIBRARY avcodec HINTS ${LIBAV_PKGCONF_LIBRARY_DIRS} )
39 | FIND_LIBRARY( LIBAV_avformat_LIBRARY avformat HINTS ${LIBAV_PKGCONF_LIBRARY_DIRS} )
40 | FIND_LIBRARY( LIBAV_swscale_LIBRARY swscale HINTS ${LIBAV_PKGCONF_LIBRARY_DIRS} )
41 |
42 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAV DEFAULT_MSG
43 | LIBAV_INCLUDE_DIR
44 | LIBAV_avcodec_LIBRARY
45 | LIBAV_avformat_LIBRARY
46 | LIBAV_avutil_LIBRARY
47 | LIBAV_swscale_LIBRARY )
48 |
49 | IF(LIBAV_FOUND)
50 | SET(LIBAV_LIBRARIES
51 | ${LIBAV_avcodec_LIBRARY}
52 | ${LIBAV_avformat_LIBRARY}
53 | ${LIBAV_avutil_LIBRARY}
54 | ${LIBAV_swscale_LIBRARY}
55 | ${LIBAV_PKGCONF_LDFLAGS_OTHER} )
56 | ENDIF()
57 | ENDIF()
58 |
59 |
--------------------------------------------------------------------------------
/gpu/gpu_wog.h:
--------------------------------------------------------------------------------
1 | //
2 | // by Jan Eric Kyprianidis
3 | // Copyright (C) 2010-2012 Computer Graphics Systems Group at the
4 | // Hasso-Plattner-Institut, Potsdam, Germany
5 | //
6 | // This program is free software: you can redistribute it and/or modify
7 | // it under the terms of the GNU General Public License as published by
8 | // the Free Software Foundation, either version 3 of the License, or
9 | // (at your option) any later version.
10 | //
11 | // This program is distributed in the hope that it will be useful,
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | // GNU General Public License for more details.
15 | //
16 | #pragma once
17 |
18 | #include "gpu_image.h"
19 |
20 | gpu_image gpu_wog_dog( const gpu_image& src, float sigma_e, float sigma_r,
21 | float tau, float phi_e, float epsilon = 0, float precision = 2 );
22 |
23 | gpu_image gpu_wog_luminance_quant( const gpu_image