From dc3c7a5c1c862ac4f9029c23cc27cb3a7d50eb8f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 16 Sep 2016 17:07:13 +0200 Subject: [PATCH] better _readImage_raw() --- CGAL_ImageIO/include/CGAL/ImageIO.h | 6 +++++- CGAL_ImageIO/include/CGAL/ImageIO_impl.h | 16 ++++++++++------ Installation/CMakeLists.txt | 5 +++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/CGAL_ImageIO/include/CGAL/ImageIO.h b/CGAL_ImageIO/include/CGAL/ImageIO.h index 29d5c42878c..00179d7793f 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO.h @@ -383,7 +383,11 @@ CGAL_IMAGEIO_EXPORT _image* _readImage_raw(const char *name, const double vx = 1., const double vy = 1., const double vz = 1., - const unsigned int offset = 0); + const unsigned int offset = 0, + const std::size_t wdim = 1, + WORD_KIND wk = WK_FIXED, + SIGN sgned = SGN_UNSIGNED + ); /** Writes given image in file 'name'.
diff --git a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h index ff1b83a4d0e..36a1df30765 100644 --- a/CGAL_ImageIO/include/CGAL/ImageIO_impl.h +++ b/CGAL_ImageIO/include/CGAL/ImageIO_impl.h @@ -717,7 +717,11 @@ _image* _readImage_raw(const char *name, const double vx, const double vy, const double vz, - const unsigned int offset) + const unsigned int offset, + const std::size_t wdim, + WORD_KIND wk, + SIGN sgned + ) { _image *im = NULL; im = (_image *) ImageIO_alloc(sizeof(_image)); @@ -753,10 +757,10 @@ _image* _readImage_raw(const char *name, im->nuser = 0; // word type (unsigned byte) - im->wdim = 1; - im->wordKind = WK_FIXED; + im->wdim = wdim; + im->wordKind = wk; im->vectMode = VM_SCALAR; - im->sign = SGN_UNSIGNED; + im->sign = sgned; im->imageFormat = NULL; // read file @@ -774,12 +778,12 @@ _image* _readImage_raw(const char *name, ImageIO_free(im->data); } // allocate memory - im->data = ImageIO_alloc(rx*ry*rz); + im->data = ImageIO_alloc(rx*ry*rz*wdim); if(im->data == NULL) return NULL; // read - ImageIO_read(im, im->data, rx*ry*rz); + ImageIO_read(im, im->data, rx*ry*rz*wdim); ImageIO_close(im); /* diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 0058828a7e5..814b917604c 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -377,10 +377,11 @@ endif() # CGAL-4.7 : 11.0.1 (Nothing different in CGAL compiled libraries.) # CGAL-4.8 : 11.0.2 (Nothing different in CGAL compiled libraries.) # CGAL-4.9 : 12.0.0 (Change the API/ABI in CGAL_ImageIO, but issue with 4GB images.) +# CGAL-4.1- : 13.0.0 (Change the API/ABI in CGAL_ImageIO.) # ยน) According to http://upstream-tracker.org/versions/cgal.html -set( CGAL_SONAME_VERSION "12" ) -set( CGAL_SOVERSION "12.0.0" ) +set( CGAL_SONAME_VERSION "13" ) +set( CGAL_SOVERSION "13.0.0" ) message( STATUS "CGAL_SONAME_VERSION=${CGAL_SONAME_VERSION}" ) message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" )