New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #29196 (new defect)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: macdev@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.2
Keywords: Cc: sanchom@…
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

comment:1 Changed 2 years ago by macdev@…

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

comment:2 Changed 2 years ago by macsforever2000@…

  • Priority changed from Not set to Normal
  • Cc sanchom@… added

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.

Note: See TracTickets for help on using tickets.