Fix the code of extract_a_sub_image, conversion warnings

This commit is contained in:
Laurent Rineau 2019-09-04 10:22:27 +02:00
parent eaef60dcfc
commit dc4e41c13e
3 changed files with 9 additions and 9 deletions

View File

@ -23,12 +23,12 @@ int main(int argc, char **argv) {
assert(ymax < image->ydim); assert(ymax < image->ydim);
assert(zmax < image->zdim); assert(zmax < image->zdim);
const int new_xdim = xmax + 1 - xmin; const auto new_xdim = xmax + 1 - xmin;
const int new_ydim = ymax + 1 - ymin; const auto new_ydim = ymax + 1 - ymin;
const int new_zdim = zmax + 1 - zmin; const auto new_zdim = zmax + 1 - zmin;
auto *new_image = ::_createImage(new_xdim, new_ydim, new_zdim, image->vx, auto *new_image = ::_createImage(new_xdim, new_ydim, new_zdim, 1,
image->vx, image->vx, image->vz, image->wdim, image->vx, image->vy, image->vz, image->wdim,
image->wordKind, image->sign); image->wordKind, image->sign);
const auto* const data = static_cast<char*>(image->data); const auto* const data = static_cast<char*>(image->data);
auto* new_data = static_cast<char*>(new_image->data); auto* new_data = static_cast<char*>(new_image->data);

View File

@ -319,8 +319,8 @@ CGAL_IMAGEIO_EXPORT void _freeImage(_image *im);
@param w image word size in bytes @param w image word size in bytes
@param wk image word kind @param wk image word kind
@param sgn image word sign */ @param sgn image word sign */
CGAL_IMAGEIO_EXPORT _image *_createImage(int x, int y, int z, int v, CGAL_IMAGEIO_EXPORT _image *_createImage(std::size_t x, std::size_t y, std::size_t z, std::size_t v,
float vx, float vy, float vz, int w, double vx, double vy, double vz, std::size_t w,
WORD_KIND wk, SIGN sgn); WORD_KIND wk, SIGN sgn);

View File

@ -623,8 +623,8 @@ _image *_initImage() {
} }
CGAL_INLINE_FUNCTION CGAL_INLINE_FUNCTION
_image *_createImage(int x, int y, int z, int v, _image *_createImage(std::size_t x, std::size_t y, std::size_t z, std::size_t v,
float vx, float vy, float vz, int w, double vx, double vy, double vz, std::size_t w,
WORD_KIND wk, SIGN sgn) WORD_KIND wk, SIGN sgn)
{ {
_image *im; _image *im;