Opened 14 years ago

Last modified 7 months ago

#29196 assigned defect

boost-gil-numeric @1.0 (devel), gil examples which come with the boost package fail to compile

Reported by: macdev@… Owned by: sanchom (Sancho McCann)
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: cooljeanius (Eric Gallager)
Port: boost-gil-numeric

Description

Dear maintainer of boost-gil-numeric,

the gil examples which come with the boost package failed to compile on my system. Problems are caused by 2 lines in file /opt/local/include/boost/gil/extension/numeric/sampler.hpp

The functions iround() and ifloor() are defined to return point2<std::ptrdiff_t> which is a long int on my system. That causes problems with related template definitions.

You might want to conference the prototye definitions to be found in file /opt/local/include/boost/gil/utilities.hpp

I created a diff:

===========================================================

--- old_sampler.hpp	2011-04-18 12:58:09.000000000 +0200
+++ new_sampler.hpp	2011-04-18 12:57:08.000000000 +0200
@@ -45,7 +45,7 @@
 

 template <typename DstP, typename SrcView, typename F>

 bool sample(nearest_neighbor_sampler, const SrcView& src, const point2<F>& p, DstP& result) {

-    point2<int> center(iround(p));

+    point2<std::ptrdiff_t> center(iround(p));

     if (center.x>=0 && center.y>=0 && center.x<src.width() && center.y<src.height()) {

         result=src(center.x,center.y);

         return true;

@@ -101,7 +101,7 @@
 template <typename DstP, typename SrcView, typename F>

 bool sample(bilinear_sampler, const SrcView& src, const point2<F>& p, DstP& result) {

     typedef typename SrcView::value_type SrcP;

-    point2<int> p0(ifloor(p)); // the closest integer coordinate top left from p

+    point2<std::ptrdiff_t> p0(ifloor(p)); // the closest integer coordinate top left from p

     point2<F> frac(p.x-p0.x, p.y-p0.y);

     if (p0.x < 0 || p0.y < 0 || p0.x>=src.width() || p0.y>=src.height()) return false;


===========================================================
Best regards, macdev

Change History (4)

comment:1 Changed 14 years ago by macdev@…

The gil examples refered to are those from boost @1.46.1 (devel).

comment:2 Changed 14 years ago by mf2k (Frank Schima)

Cc: sanchom@… added
Priority: Not setNormal

In the future, don't forget to Cc the port maintainer. Also, please attach your diff to the ticket. furthermore, if you really want to help get this implemented, attach the unified diff for the portfile too.

comment:3 Changed 8 years ago by jmroot (Joshua Root)

Cc: sanchom@… removed
Owner: changed from macports-tickets@… to sanchom@…
Status: newassigned

comment:4 Changed 7 months ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.