From f5317bc2d969ce8ea3317279d56b2a5640c7aafd Mon Sep 17 00:00:00 2001 From: johan Date: Sun, 26 Jan 2014 14:23:08 +0100 Subject: [PATCH] Moved black border detection code to seperate library Former-commit-id: 590029949b79689ea05409149677e51b748cb64f --- .../BlackBorderDetector.h | 0 .../BlackBorderProcessor.h | 0 include/hyperion/ImageProcessor.h | 4 +++- libsrc/CMakeLists.txt | 1 + .../BlackBorderDetector.cpp | 4 ++-- .../BlackBorderProcessor.cpp | 4 ++-- libsrc/blackborder/CMakeLists.txt | 23 +++++++++++++++++++ libsrc/hyperion/CMakeLists.txt | 6 +---- libsrc/hyperion/ImageProcessor.cpp | 4 +++- test/TestBlackBorderDetector.cpp | 4 +++- test/TestBlackBorderProcessor.cpp | 4 ++-- 11 files changed, 40 insertions(+), 14 deletions(-) rename include/{hyperion => blackborder}/BlackBorderDetector.h (100%) rename include/{hyperion => blackborder}/BlackBorderProcessor.h (100%) rename libsrc/{hyperion => blackborder}/BlackBorderDetector.cpp (69%) rename libsrc/{hyperion => blackborder}/BlackBorderProcessor.cpp (96%) create mode 100644 libsrc/blackborder/CMakeLists.txt diff --git a/include/hyperion/BlackBorderDetector.h b/include/blackborder/BlackBorderDetector.h similarity index 100% rename from include/hyperion/BlackBorderDetector.h rename to include/blackborder/BlackBorderDetector.h diff --git a/include/hyperion/BlackBorderProcessor.h b/include/blackborder/BlackBorderProcessor.h similarity index 100% rename from include/hyperion/BlackBorderProcessor.h rename to include/blackborder/BlackBorderProcessor.h diff --git a/include/hyperion/ImageProcessor.h b/include/hyperion/ImageProcessor.h index 990b6593..deb40df1 100644 --- a/include/hyperion/ImageProcessor.h +++ b/include/hyperion/ImageProcessor.h @@ -8,7 +8,9 @@ #include #include #include -#include + +// Black border includes +#include /// /// The ImageProcessor translates an RGB-image to RGB-values for the leds. The processing is diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt index 8eab4b33..8db13505 100644 --- a/libsrc/CMakeLists.txt +++ b/libsrc/CMakeLists.txt @@ -4,6 +4,7 @@ SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc) add_subdirectory(hyperion) +add_subdirectory(blackborder) add_subdirectory(jsonserver) add_subdirectory(protoserver) add_subdirectory(boblightserver) diff --git a/libsrc/hyperion/BlackBorderDetector.cpp b/libsrc/blackborder/BlackBorderDetector.cpp similarity index 69% rename from libsrc/hyperion/BlackBorderDetector.cpp rename to libsrc/blackborder/BlackBorderDetector.cpp index ed97bebe..6164f920 100644 --- a/libsrc/hyperion/BlackBorderDetector.cpp +++ b/libsrc/blackborder/BlackBorderDetector.cpp @@ -1,6 +1,6 @@ -// Local-Hyperion includes -#include +// BlackBorders includes +#include using namespace hyperion; diff --git a/libsrc/hyperion/BlackBorderProcessor.cpp b/libsrc/blackborder/BlackBorderProcessor.cpp similarity index 96% rename from libsrc/hyperion/BlackBorderProcessor.cpp rename to libsrc/blackborder/BlackBorderProcessor.cpp index efc97724..ee78efb9 100644 --- a/libsrc/hyperion/BlackBorderProcessor.cpp +++ b/libsrc/blackborder/BlackBorderProcessor.cpp @@ -1,6 +1,6 @@ -// Local-Hyperion includes -#include +// Blackborder includes +#include using namespace hyperion; diff --git a/libsrc/blackborder/CMakeLists.txt b/libsrc/blackborder/CMakeLists.txt new file mode 100644 index 00000000..0d693c89 --- /dev/null +++ b/libsrc/blackborder/CMakeLists.txt @@ -0,0 +1,23 @@ + +# Define the current source locations +SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/blackborder) +SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/blackborder) + +SET(Blackborder_HEADERS + ${CURRENT_HEADER_DIR}/BlackBorderDetector.h + ${CURRENT_HEADER_DIR}/BlackBorderProcessor.h +) + +SET(Blackborder_SOURCES + ${CURRENT_SOURCE_DIR}/BlackBorderDetector.cpp + ${CURRENT_SOURCE_DIR}/BlackBorderProcessor.cpp +) + +add_library(blackborder + ${Blackborder_HEADERS} + ${Blackborder_SOURCES} +) + +target_link_libraries(blackborder + hyperion-utils +) diff --git a/libsrc/hyperion/CMakeLists.txt b/libsrc/hyperion/CMakeLists.txt index 738af8c0..8f6a227d 100644 --- a/libsrc/hyperion/CMakeLists.txt +++ b/libsrc/hyperion/CMakeLists.txt @@ -17,9 +17,6 @@ SET(Hyperion_HEADERS ${CURRENT_HEADER_DIR}/LedString.h ${CURRENT_HEADER_DIR}/PriorityMuxer.h - ${CURRENT_HEADER_DIR}/BlackBorderDetector.h - ${CURRENT_HEADER_DIR}/BlackBorderProcessor.h - ${CURRENT_SOURCE_DIR}/MultiColorTransform.h ) @@ -30,8 +27,6 @@ SET(Hyperion_SOURCES ${CURRENT_SOURCE_DIR}/LedString.cpp ${CURRENT_SOURCE_DIR}/PriorityMuxer.cpp - ${CURRENT_SOURCE_DIR}/BlackBorderDetector.cpp - ${CURRENT_SOURCE_DIR}/BlackBorderProcessor.cpp ${CURRENT_SOURCE_DIR}/ImageToLedsMap.cpp ${CURRENT_SOURCE_DIR}/MultiColorTransform.cpp ${CURRENT_SOURCE_DIR}/LinearColorSmoothing.cpp @@ -54,6 +49,7 @@ add_library(hyperion ) target_link_libraries(hyperion + blackborder hyperion-utils leddevice effectengine diff --git a/libsrc/hyperion/ImageProcessor.cpp b/libsrc/hyperion/ImageProcessor.cpp index cd39dd1e..66b02e74 100644 --- a/libsrc/hyperion/ImageProcessor.cpp +++ b/libsrc/hyperion/ImageProcessor.cpp @@ -2,7 +2,9 @@ // Hyperion includes #include #include -#include + +// Blacborder includes +#include using namespace hyperion; diff --git a/test/TestBlackBorderDetector.cpp b/test/TestBlackBorderDetector.cpp index 1d91079f..018cebf0 100644 --- a/test/TestBlackBorderDetector.cpp +++ b/test/TestBlackBorderDetector.cpp @@ -3,9 +3,11 @@ #include // Hyperion includes -#include #include +// Blackborder includes +#include + using namespace hyperion; ColorRgb randomColor() diff --git a/test/TestBlackBorderProcessor.cpp b/test/TestBlackBorderProcessor.cpp index e0eef0d2..4aceaa81 100644 --- a/test/TestBlackBorderProcessor.cpp +++ b/test/TestBlackBorderProcessor.cpp @@ -8,8 +8,8 @@ #include #include -// Local-Hyperion includes -#include "hyperion/BlackBorderProcessor.h" +// Blackborder includes +#include "blackborder/BlackBorderProcessor.h" using namespace hyperion;