42#include <visp3/core/vpConfig.h>
44#if defined(VISP_HAVE_CATCH2) && (VISP_HAVE_DATASET_VERSION >= 0x030600)
45#define CATCH_CONFIG_RUNNER
50#include <visp3/core/vpEndian.h>
51#include <visp3/core/vpIoTools.h>
52#include <visp3/io/vpImageIo.h>
56#ifdef VISP_LITTLE_ENDIAN
58 float epsilon = std::numeric_limits<float>::epsilon())
60 for (
unsigned int i = 0; i < I1.
getHeight(); i++) {
61 for (
unsigned int j = 0; j < I1.
getWidth(); j++) {
70 float epsilon = std::numeric_limits<float>::epsilon())
72 for (
unsigned int i = 0; i < I1.
getHeight(); i++) {
73 for (
unsigned int j = 0; j < I1.
getWidth(); j++) {
81TEST_CASE(
"EXR image read",
"[exr_image_io]")
85#ifdef VISP_LITTLE_ENDIAN
97 const std::string imgPath =
104 checkColorImages(I_ref, I);
109 const std::string imgPath =
116 checkColorImages(I_ref, I, 0.00097656f);
122 const std::string imgPathRef =
132 const std::string imgPath =
139 checkGrayImages(I_ref, I);
144 const std::string imgPath =
151 checkGrayImages(I_ref, I, 0.00097656f);
157TEST_CASE(
"EXR image write",
"[exr_image_io]")
159#ifdef VISP_LITTLE_ENDIAN
161 std::string directory_filename_tmp = tmp_dir +
"/testIoEXR_" +
vpTime::getDateTime(
"%Y-%m-%d_%H.%M.%S");
167 const std::string imgPath =
182 checkColorImages(I, I_write);
187 const std::string imgPath =
202 checkGrayImages(I, I_write);
210int main(
int argc,
char *argv[])
212 Catch::Session session;
215 session.applyCommandLine(argc, argv);
217 int numFailed = session.run();
225int 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")