mirror of https://github.com/CGAL/cgal
better _readImage_raw()
This commit is contained in:
parent
25be975789
commit
dc3c7a5c1c
|
|
@ -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'.<br>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -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}" )
|
||||
|
|
|
|||
Loading…
Reference in New Issue