#include // Get index for any table indexed by [width*(i : height) + (j : width)], but a // : dim_long, b : dim_large #define im_index(a, b) (vertical ? (width * a + b) : (width * b + a)) bool nearly_equal(float a, float b); std::pair operator+(std::pair& p1, std::pair& p2); void operator+=(std::pair& p1, std::pair& p2); bool does_seam_remove_mask(std::vector> energy, int width, int height, int nbChannels, std::vector opt_seam, bool vertical); std::vector> mask_energy(std::vector energy, int width, int height, unsigned char* mask); // Unfortunately, std::cout << (std::pair<>) does not work and can't be rewritten std::string str_of_e(std::pair energy); std::string str_of_e(float energy); namespace limits { struct max_energy { template operator T() { return std::numeric_limits::max(); } operator std::pair() { return {3, std::numeric_limits::max()}; } }; }