17 #pragma warning(disable : 4244) // for VS-2015
22 #include <CGAL/boost/graph/internal/helpers.h>
23 #include <CGAL/boost/graph/iterator.h>
52 3.14159265358979323846264338327950288419716939937510582097494459;
73 float eps = 216.f / 24389.f;
74 float k = 24389.f / 27.f;
86 r = (float)std::pow((r + 0.055) / 1.055, 2.4);
91 g = (float)std::pow((g + 0.055) / 1.055, 2.4);
96 b = (float)std::pow((b + 0.055) / 1.055, 2.4);
99 X = 0.412424 * r + 0.357579 * g + 0.180464 * b;
100 Y = 0.212656 * r + 0.715158 * g + 0.0721856 * b;
101 Z = 0.0193324 * r + 0.119193 * g + 0.950444 * b;
112 fx = (float)std::pow(xr, (
float)(1.f / 3.f));
114 fx = (k * xr + 16.0) / 116.0;
117 fy = (float)std::pow(yr, (
float)(1.f / 3.f));
119 fy = (k * yr + 16.0) / 116.f;
122 fz = (float)std::pow(zr, (
float)(1.f / 3.f));
124 fz = (k * zr + 16.0) / 116.f;
126 lab[0] = (float)(116.0 * fy - 16.0);
127 lab[1] = (float)(500.0 * (fx - fy));
128 lab[2] = (float)(200.0 * (fy - fz));
145 float eps = 216.f / 24389.f;
146 float k = 24389.f / 27.f;
148 float Xr = 0.964221f;
150 float Zr = 0.825211f;
156 fy = (L + 16.0) / 116.0;
157 fx = (A / 500.0) + fy;
161 float fx_cube = (float)std::pow(fx, (
float)3.0);
162 float fy_cube = (float)std::pow(fy, (
float)3.0);
163 float fz_cube = (float)std::pow(fz, (
float)3.0);
168 xr = (116.0 * fx - 16.0) / k;
178 zr = (116.0 * fz - 16.0) / k;
194 r = 3.24071 * X + -1.53726 * Y + -0.498571 * Z;
195 g = -0.969258 * X + 1.87599 * Y + 0.0415557 * Z;
196 b = 0.0556352 * X + -0.203996 * Y + 1.05707 * Z;
201 rgb[0] = 1.055 * (float)std::pow(r,
float(1.0) / float(2.4)) - 0.055;
206 rgb[1] = 1.055 * (float)std::pow(g,
float(1.0) / float(2.4)) - 0.055;
211 rgb[2] = 1.055 * (float)std::pow(b, (
float(1.0) / float(2.4))) - 0.055;
238 template<
typename Graph >
239 typename boost::graph_traits< Graph >::halfedge_descriptor
241 typename boost::graph_traits< Graph >::halfedge_descriptor h1,
242 typename boost::graph_traits< Graph >::halfedge_descriptor h2,
246 typename boost::graph_traits< Graph >::face_descriptor f =
add_face(g);
247 typename boost::graph_traits< Graph >::edge_descriptor e1 =
add_edge(g);
248 typename boost::graph_traits< Graph >::edge_descriptor e2 =
add_edge(g);
249 typename boost::graph_traits< Graph >::halfedge_descriptor he1 =
251 typename boost::graph_traits< Graph >::halfedge_descriptor he2 =
253 typename boost::graph_traits< Graph >::halfedge_descriptor ohe1 =
255 typename boost::graph_traits< Graph >::halfedge_descriptor ohe2 =
272 CGAL::internal::set_border(he1, g);
273 CGAL::internal::set_border(he2, g);
275 CGAL::Halfedge_around_face_iterator< Graph > hafib, hafie;
276 for(boost::tie(hafib, hafie) = CGAL::halfedges_around_face(ohe1, g);