summarylogtreecommitdiffstats
path: root/fixes.patch
diff options
context:
space:
mode:
authorspider-mario2020-10-15 21:15:31 +0200
committerspider-mario2020-10-15 21:15:31 +0200
commit41229f681eabd525e228b65c66bf65d8c2b30815 (patch)
treed508ce810d87a1d688e49612c158b6410520b225 /fixes.patch
downloadaur-hdr-plus-git.tar.gz
Initial import
Diffstat (limited to 'fixes.patch')
-rw-r--r--fixes.patch143
1 files changed, 143 insertions, 0 deletions
diff --git a/fixes.patch b/fixes.patch
new file mode 100644
index 000000000000..fd0b93c3417a
--- /dev/null
+++ b/fixes.patch
@@ -0,0 +1,143 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index e4be369..6c57cfa 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -8,9 +8,9 @@ include("macro.cmake")
+ set(CMAKE_CXX_STANDARD 11)
+
+ # Define dependencies
+-link_halide()
+ link_libtiff()
+
++find_package(Halide REQUIRED)
+ find_package(ZLIB REQUIRED)
+ find_package(PNG REQUIRED)
+ find_package(JPEG REQUIRED)
+@@ -27,36 +27,28 @@ set(header_files
+ src/dngwriter.h
+ src/LibRaw2DngConverter.h)
+
+-include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${HALIDE_DISTRIB_DIR}/include ${HALIDE_DISTRIB_DIR}/tools ${RAW2DNG_INCLUDE_DIRS})
++include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${RAW2DNG_INCLUDE_DIRS})
+ include_directories(${CMAKE_BINARY_DIR}/genfiles)
+
+ set(HALIDE_TARGET "")
+ set(HALIDE_TARGET_FEATURES "")
+-halide_library(hdrplus_pipeline
+- SRCS src/hdrplus_pipeline_generator.cpp src/align.cpp src/merge.cpp src/finish.cpp src/util.cpp
+- # GENERATOR_DEPS # We don't have any yet
+- GENERATOR_NAME hdrplus_pipeline
+- # GENERATOR_ARGS # We don't have any yet
+- FUNCTION_NAME hdrplus_pipeline
+- # HALIDE_TARGET ${HALIDE_TARGET} # TODO: add option with custom HALIDE_TARGET
+- # HALIDE_TARGET_FEATURES ${HALIDE_TARGET_FEATURES} # TODO: add option with custom HALIDE_TARGET
+- # EXTRA_OUTPUTS "stmt;html;schedule") # uncomment for extra output
++add_executable(hdrplus_pipeline_generator
++ src/hdrplus_pipeline_generator.cpp src/align.cpp src/merge.cpp src/finish.cpp src/util.cpp
+ )
++target_link_libraries(hdrplus_pipeline_generator Halide::Generator)
++add_halide_library(hdrplus_pipeline FROM hdrplus_pipeline_generator)
+
+-halide_library(align_and_merge
+- SRCS src/align_and_merge_generator.cpp src/align.cpp src/merge.cpp src/util.cpp
+- GENERATOR_NAME align_and_merge
+- FUNCTION_NAME align_and_merge
+- # HALIDE_TARGET ${HALIDE_TARGET} # TODO: add option with custom HALIDE_TARGET
+- # HALIDE_TARGET_FEATURES ${HALIDE_TARGET_FEATURES} # TODO: add option with custom HALIDE_TARGET
+- # EXTRA_OUTPUTS "stmt;html;schedule") # uncomment for extra output
++add_executable(align_and_merge_generator
++ src/align_and_merge_generator.cpp src/align.cpp src/merge.cpp src/util.cpp
+ )
++target_link_libraries(align_and_merge_generator Halide::Generator)
++add_halide_library(align_and_merge FROM align_and_merge_generator)
+
+
+ add_executable(hdrplus bin/HDRPlus.cpp ${src_files})
+ add_dependencies(hdrplus hdrplus_pipeline)
+-target_link_libraries(hdrplus hdrplus_pipeline Halide png ${LIBRAW_LIBRARY} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY})
++target_link_libraries(hdrplus hdrplus_pipeline Halide::Halide png ${LIBRAW_LIBRARY} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY})
+
+ add_executable(stack_frames bin/stack_frames.cpp ${src_files})
+ add_dependencies(stack_frames align_and_merge)
+-target_link_libraries(stack_frames Halide align_and_merge ${LIBRAW_LIBRARY} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY})
++target_link_libraries(stack_frames Halide::Halide align_and_merge ${LIBRAW_LIBRARY} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${TIFFXX_LIBRARY})
+diff --git a/bin/HDRPlus.cpp b/bin/HDRPlus.cpp
+index f2b8683..2a5be35 100644
+--- a/bin/HDRPlus.cpp
++++ b/bin/HDRPlus.cpp
+@@ -8,7 +8,7 @@
+ #include <include/stb_image_write.h>
+
+ #include <src/Burst.h>
+-#include <hdrplus_pipeline/hdrplus_pipeline.h>
++#include "hdrplus_pipeline.h"
+
+ /*
+ * HDRPlus Class -- Houses file I/O, defines pipeline attributes and calls
+diff --git a/bin/stack_frames.cpp b/bin/stack_frames.cpp
+index 666c56f..b9d570e 100644
+--- a/bin/stack_frames.cpp
++++ b/bin/stack_frames.cpp
+@@ -7,7 +7,7 @@
+
+ #include <src/Burst.h>
+
+-#include <align_and_merge/align_and_merge.h>
++#include "align_and_merge.h"
+
+ Halide::Runtime::Buffer<uint16_t> align_and_merge(Halide::Runtime::Buffer<uint16_t> burst) {
+ if (burst.channels() < 2) {
+diff --git a/macro.cmake b/macro.cmake
+index 0c5c2bb..ece5e2e 100644
+--- a/macro.cmake
++++ b/macro.cmake
+@@ -1,16 +1,5 @@
+ cmake_minimum_required(VERSION 3.10)
+
+-macro(link_halide)
+- if("${HALIDE_DISTRIB_DIR}" STREQUAL " ")
+- message(FATAL_ERROR "Specify HALIDE_DISTRIB_DIR variable in the cmake options.")
+- endif()
+- find_package(Threads) # fix dynamic linking for halide
+- set(HALIDE_DISTRIB_USE_STATIC_LIBRARY OFF)
+- include(${HALIDE_DISTRIB_DIR}/halide.cmake)
+- include_directories(${HALIDE_DISTRIB_DIR}/include ${HALIDE_DISTRIB_DIR}/tools)
+- link_directories(${HALIDE_DISTRIB_DIR}/lib ${HALIDE_DISTRIB_DIR}/bin)
+-endmacro()
+-
+ macro(link_libtiff)
+ # Link as follows:
+ # target_link_libraries(TARGET ${TIFF_LIBRARIES})
+diff --git a/src/util.cpp b/src/util.cpp
+index 9c984f0..a31f1bc 100644
+--- a/src/util.cpp
++++ b/src/util.cpp
+@@ -3,6 +3,7 @@
+ #include "Halide.h"
+ #include <vector>
+ #include <algorithm>
++#include <sstream>
+
+ using namespace Halide;
+ using namespace Halide::ConciseCasts;
+@@ -37,7 +38,7 @@ Func box_down2(Func input, std::string name) {
+ Func gauss_down4(Func input, std::string name) {
+
+ Func output(name);
+- Buffer<uint32_t> k(5, 5, "gauss_down4_kernel");
++ Buffer<uint32_t> k(5, 5, "gauss_down4_kernel_" + name);
+ k.translate({-2, -2});
+
+ Var x, y, n;
+@@ -115,7 +116,10 @@ Func gauss_7x7(Func input, std::string name) {
+
+ // gaussian kernel
+
+- Buffer<float> k(7, "gauss_7x7_kernel");
++ static int i = 0;
++ std::ostringstream buffer_name;
++ buffer_name << "gauss_7x7_kernel_" << name << ++i;
++ Buffer<float> k(7, buffer_name.str());
+ k.translate({-3});
+
+ Var x;