// STL includes #include #include #include // Utils includes #include #include // Blackborder includes #include "blackborder/BlackBorderProcessor.h" using namespace hyperion; ColorRgb randomColor() { const uint8_t randomRedValue = uint8_t(rand() % (std::numeric_limits::max() + 1)); const uint8_t randomGreenValue = uint8_t(rand() % (std::numeric_limits::max() + 1)); const uint8_t randomBlueValue = uint8_t(rand() % (std::numeric_limits::max() + 1)); return {randomRedValue, randomGreenValue, randomBlueValue}; } Image createImage(unsigned width, unsigned height, unsigned topBorder, unsigned leftBorder) { Image image(width, height); for (unsigned x=0; x noBorderImage = createImage(64, 64, 0, 0); for (unsigned i=0; i<10; ++i) { bool newBorder = processor.process(noBorderImage); if (i == 0) { // Switch to 'no border' should immediate if (!newBorder) { std::cerr << "Failed to detect 'no border' when required" << std::endl; exit(EXIT_FAILURE); } } else { if (newBorder) { std::cerr << "Incorrectly detected new border, when there in none" << std::endl; exit(EXIT_FAILURE); } } } // Verify that the border is indeed if (processor.getCurrentBorder().unknown != false || processor.getCurrentBorder().horizontalSize != 0 || processor.getCurrentBorder().verticalSize != 0) { std::cerr << "Incorrectlty identified 'no border'" << std::endl; exit(EXIT_FAILURE); } int borderSize = 12; Image horzImage = createImage(64, 64, borderSize, 0); for (unsigned i=0; i vertImage = createImage(64, 64, 0, borderSize); for (unsigned i=0; i