Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Re: Image_3 from a std::vector

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Re: Image_3 from a std::vector


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Re: Image_3 from a std::vector
  • Date: Thu, 12 Apr 2012 22:35:04 +0200
  • Organization: GeometryFactory

Le jeudi 12 avril 2012 13:19:20 slaughter a écrit :
> What do you mean by this: "If 'image' is a default initialized Image_3
> object".
>
> I am creating my Image_3 as:
> CGAL::Image_3 im;
>
> The set_data command as you suggested is causing a Segmentation fault.

You are right. I forgot that the _image struct must be initialized.

Use that:

CGAL::Image_3 image(_createImage(xdim, ydim, zdim, 1,
vx, vy, vz,
1, WK_FIXED, SGN_UNSIGNED));
ImageIO_free(image.data());
image.set_data(&data[0]);

The last three parameters, 1, WK_FIXED, and SGN_UNSIGNED depends on the
value_type of your vector.

--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/



Archive powered by MHonArc 2.6.16.

Top of Page