40 #include <visp3/core/vpConfig.h>
43 #if defined(VISP_HAVE_CATCH2) && (VISP_HAVE_DATASET_VERSION >= 0x030600) && \
44 defined(HAVE_OPENCV_IMGCODECS) && defined(VISP_HAVE_TINYEXR)
45 #define CATCH_CONFIG_RUNNER
50 #include <visp3/core/vpEndian.h>
51 #include <visp3/core/vpIoTools.h>
52 #include <visp3/io/vpImageIo.h>
54 #ifdef ENABLE_VISP_NAMESPACE
60 #ifdef VISP_LITTLE_ENDIAN
62 float epsilon = std::numeric_limits<float>::epsilon())
64 for (
unsigned int i = 0; i < I1.
getHeight(); i++) {
65 for (
unsigned int j = 0; j < I1.
getWidth(); j++) {
74 float epsilon = std::numeric_limits<float>::epsilon())
76 for (
unsigned int i = 0; i < I1.
getHeight(); i++) {
77 for (
unsigned int j = 0; j < I1.
getWidth(); j++) {
85 TEST_CASE(
"EXR image read",
"[exr_image_io]")
89 #ifdef VISP_LITTLE_ENDIAN
101 const std::string imgPath =
108 checkColorImages(I_ref, I);
113 const std::string imgPath =
120 checkColorImages(I_ref, I, 0.00097656f);
126 const std::string imgPathRef =
136 const std::string imgPath =
143 checkGrayImages(I_ref, I);
148 const std::string imgPath =
155 checkGrayImages(I_ref, I, 0.00097656f);
161 TEST_CASE(
"EXR image write",
"[exr_image_io]")
163 #ifdef VISP_LITTLE_ENDIAN
165 std::string directory_filename_tmp = tmp_dir +
"/testIoEXR_" +
vpTime::getDateTime(
"%Y-%m-%d_%H.%M.%S");
171 const std::string imgPath =
186 checkColorImages(I, I_write);
191 const std::string imgPath =
206 checkGrayImages(I, I_write);
214 int main(
int argc,
char *argv[])
216 Catch::Session session;
219 session.applyCommandLine(argc, argv);
221 int numFailed = session.run();
229 int main() {
return EXIT_SUCCESS; }
static void readPFM_HDR(vpImage< float > &I, const std::string &filename)
static void readEXR(vpImage< float > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
static void writeEXR(const vpImage< float > &I, const std::string &filename, int backend=IO_DEFAULT_BACKEND)
Definition of the vpImage class member functions.
unsigned int getWidth() const
unsigned int getSize() const
unsigned int getHeight() const
static bool equal(double x, double y, double threshold=0.001)
VISP_EXPORT std::string getDateTime(const std::string &format="%Y/%m/%d %H:%M:%S")