Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58300 - branches/release/libs/gil/test
From: chhenning_at_[hidden]
Date: 2009-12-11 16:40:25


Author: chhenning
Date: 2009-12-11 16:40:24 EST (Fri, 11 Dec 2009)
New Revision: 58300
URL: http://svn.boost.org/trac/boost/changeset/58300

Log:
Updated gil release from boost trunk.
Text files modified:
   branches/release/libs/gil/test/image.cpp | 2
   branches/release/libs/gil/test/performance.cpp | 90 ++++++++++++++++++++--------------------
   branches/release/libs/gil/test/pixel.cpp | 11 ++--
   3 files changed, 51 insertions(+), 52 deletions(-)

Modified: branches/release/libs/gil/test/image.cpp
==============================================================================
--- branches/release/libs/gil/test/image.cpp (original)
+++ branches/release/libs/gil/test/image.cpp 2009-12-11 16:40:24 EST (Fri, 11 Dec 2009)
@@ -572,8 +572,6 @@
     const char* local_name = "gil_reference_checksums.txt";
     const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt";
 
- if (argc > 1)
- local_name = argv[1];
     std::ifstream file_is_there(local_name);
     if (file_is_there) {
         test_image(local_name);

Modified: branches/release/libs/gil/test/performance.cpp
==============================================================================
--- branches/release/libs/gil/test/performance.cpp (original)
+++ branches/release/libs/gil/test/performance.cpp 2009-12-11 16:40:24 EST (Fri, 11 Dec 2009)
@@ -81,9 +81,9 @@
         T* first=(T*)_v.row_begin(0);
         T* last=first+_v.size()*3;
         while(first!=last) {
- first[0]=at_c<0>(_p);
- first[1]=at_c<1>(_p);
- first[2]=at_c<2>(_p);
+ first[0]=boost::gil::at_c<0>(_p);
+ first[1]=boost::gil::at_c<1>(_p);
+ first[2]=boost::gil::at_c<2>(_p);
             first+=3;
         }
     }
@@ -99,9 +99,9 @@
         T1* first=(T1*)_v.row_begin(0);
         T1* last=first+_v.size()*3;
         while(first!=last) {
- first[0]=at_c<2>(_p);
- first[1]=at_c<1>(_p);
- first[2]=at_c<0>(_p);
+ first[0]=boost::gil::at_c<2>(_p);
+ first[1]=boost::gil::at_c<1>(_p);
+ first[2]=boost::gil::at_c<0>(_p);
             first+=3;
         }
     }
@@ -116,12 +116,12 @@
     void operator()() const {
         std::size_t size=_v.size();
         T1* first;
- first=(T1*)at_c<0>(_v.row_begin(0));
- std::fill(first,first+size,at_c<0>(_p));
- first=(T1*)at_c<1>(_v.row_begin(0));
- std::fill(first,first+size,at_c<1>(_p));
- first=(T1*)at_c<2>(_v.row_begin(0));
- std::fill(first,first+size,at_c<2>(_p));
+ first=(T1*)boost::gil::at_c<0>(_v.row_begin(0));
+ std::fill(first,first+size,boost::gil::at_c<0>(_p));
+ first=(T1*)boost::gil::at_c<1>(_v.row_begin(0));
+ std::fill(first,first+size,boost::gil::at_c<1>(_p));
+ first=(T1*)boost::gil::at_c<2>(_v.row_begin(0));
+ std::fill(first,first+size,boost::gil::at_c<2>(_p));
     }
 };
 
@@ -135,12 +135,12 @@
     void operator()() const {
         std::size_t size=_v.size();
         T1* first;
- first=(T1*)at_c<0>(_v.row_begin(0));
- std::fill(first,first+size,at_c<2>(_p));
- first=(T1*)at_c<1>(_v.row_begin(0));
- std::fill(first,first+size,at_c<1>(_p));
- first=(T1*)at_c<2>(_v.row_begin(0));
- std::fill(first,first+size,at_c<1>(_p));
+ first=(T1*)boost::gil::at_c<0>(_v.row_begin(0));
+ std::fill(first,first+size,boost::gil::at_c<2>(_p));
+ first=(T1*)boost::gil::at_c<1>(_v.row_begin(0));
+ std::fill(first,first+size,boost::gil::at_c<1>(_p));
+ first=(T1*)boost::gil::at_c<2>(_v.row_begin(0));
+ std::fill(first,first+size,boost::gil::at_c<1>(_p));
     }
 };
 
@@ -191,9 +191,9 @@
     for_each_nongil_t(const View& v_in,const F& f_in) : _v(v_in), _f(f_in) {}
     void operator()() const {
         T1 *first0, *first1, *first2, *last0;
- first0=(T1*)at_c<0>(_v.row_begin(0));
- first1=(T1*)at_c<1>(_v.row_begin(0));
- first2=(T1*)at_c<2>(_v.row_begin(0));
+ first0=(T1*)boost::gil::at_c<0>(_v.row_begin(0));
+ first1=(T1*)boost::gil::at_c<1>(_v.row_begin(0));
+ first2=(T1*)boost::gil::at_c<2>(_v.row_begin(0));
         last0=first0+_v.size();
         while(first0!=last0) {
             *first0++=0;
@@ -261,12 +261,12 @@
     copy_nongil_t(const View1& v1_in,const View2& v2_in) : _v1(v1_in), _v2(v2_in) {}
     void operator()() const {
         std::size_t size=_v1.size();
- T1* first10=(T1*)at_c<0>(_v1.row_begin(0));
- T1* first11=(T1*)at_c<1>(_v1.row_begin(0));
- T1* first12=(T1*)at_c<2>(_v1.row_begin(0));
- T2* first20=(T2*)at_c<0>(_v2.row_begin(0));
- T2* first21=(T2*)at_c<1>(_v2.row_begin(0));
- T2* first22=(T2*)at_c<2>(_v2.row_begin(0));
+ T1* first10=(T1*)boost::gil::at_c<0>(_v1.row_begin(0));
+ T1* first11=(T1*)boost::gil::at_c<1>(_v1.row_begin(0));
+ T1* first12=(T1*)boost::gil::at_c<2>(_v1.row_begin(0));
+ T2* first20=(T2*)boost::gil::at_c<0>(_v2.row_begin(0));
+ T2* first21=(T2*)boost::gil::at_c<1>(_v2.row_begin(0));
+ T2* first22=(T2*)boost::gil::at_c<2>(_v2.row_begin(0));
         std::copy(first10,first10+size,first20);
         std::copy(first11,first11+size,first21);
         std::copy(first12,first12+size,first22);
@@ -282,9 +282,9 @@
     void operator()() const {
         T1* first=(T1*)_v1.row_begin(0);
         T1* last=first+_v1.size()*3;
- T2* first0=(T2*)at_c<0>(_v2.row_begin(0));
- T2* first1=(T2*)at_c<1>(_v2.row_begin(0));
- T2* first2=(T2*)at_c<2>(_v2.row_begin(0));
+ T2* first0=(T2*)boost::gil::at_c<0>(_v2.row_begin(0));
+ T2* first1=(T2*)boost::gil::at_c<1>(_v2.row_begin(0));
+ T2* first2=(T2*)boost::gil::at_c<2>(_v2.row_begin(0));
         while(first!=last) {
             *first0++=first[0];
             *first1++=first[1];
@@ -303,9 +303,9 @@
     void operator()() const {
         T1* first=(T1*)_v2.row_begin(0);
         T1* last=first+_v2.size()*3;
- T2* first0=(T2*)at_c<0>(_v1.row_begin(0));
- T2* first1=(T2*)at_c<1>(_v1.row_begin(0));
- T2* first2=(T2*)at_c<2>(_v1.row_begin(0));
+ T2* first0=(T2*)boost::gil::at_c<0>(_v1.row_begin(0));
+ T2* first1=(T2*)boost::gil::at_c<1>(_v1.row_begin(0));
+ T2* first2=(T2*)boost::gil::at_c<2>(_v1.row_begin(0));
         while(first!=last) {
             first[0]=*first0++;
             first[1]=*first1++;
@@ -369,12 +369,12 @@
     F _f;
     transform_nongil_t(const View1& v1_in,const View2& v2_in,const F& f_in) : _v1(v1_in),_v2(v2_in),_f(f_in) {}
     void operator()() const {
- T1* first10=(T1*)at_c<0>(_v1.row_begin(0));
- T1* first11=(T1*)at_c<1>(_v1.row_begin(0));
- T1* first12=(T1*)at_c<2>(_v1.row_begin(0));
- T1* first20=(T2*)at_c<0>(_v2.row_begin(0));
- T1* first21=(T2*)at_c<1>(_v2.row_begin(0));
- T1* first22=(T2*)at_c<2>(_v2.row_begin(0));
+ T1* first10=(T1*)boost::gil::at_c<0>(_v1.row_begin(0));
+ T1* first11=(T1*)boost::gil::at_c<1>(_v1.row_begin(0));
+ T1* first12=(T1*)boost::gil::at_c<2>(_v1.row_begin(0));
+ T1* first20=(T2*)boost::gil::at_c<0>(_v2.row_begin(0));
+ T1* first21=(T2*)boost::gil::at_c<1>(_v2.row_begin(0));
+ T1* first22=(T2*)boost::gil::at_c<2>(_v2.row_begin(0));
         T1* last10=first10+_v1.size();
         while(first10!=last10) {
             *first20++=T2(*first12++*0.1f);
@@ -394,9 +394,9 @@
     void operator()() const {
         T1* first1=(T1*)_v1.row_begin(0);
         T1* last1=first1+_v1.size()*3;
- T1* first20=(T2*)at_c<0>(_v2.row_begin(0));
- T1* first21=(T2*)at_c<1>(_v2.row_begin(0));
- T1* first22=(T2*)at_c<2>(_v2.row_begin(0));
+ T1* first20=(T2*)boost::gil::at_c<0>(_v2.row_begin(0));
+ T1* first21=(T2*)boost::gil::at_c<1>(_v2.row_begin(0));
+ T1* first22=(T2*)boost::gil::at_c<2>(_v2.row_begin(0));
         while(first1!=last1) {
             *first20++=T2(first1[2]*0.1f);
             *first21++=T2(first1[1]*0.2f);
@@ -414,9 +414,9 @@
     F _f;
     transform_nongil_t(const View1& v1_in,const View2& v2_in,const F& f_in) : _v1(v1_in),_v2(v2_in),_f(f_in) {}
     void operator()() const {
- T1* first10=(T1*)at_c<0>(_v1.row_begin(0));
- T1* first11=(T1*)at_c<1>(_v1.row_begin(0));
- T1* first12=(T1*)at_c<2>(_v1.row_begin(0));
+ T1* first10=(T1*)boost::gil::at_c<0>(_v1.row_begin(0));
+ T1* first11=(T1*)boost::gil::at_c<1>(_v1.row_begin(0));
+ T1* first12=(T1*)boost::gil::at_c<2>(_v1.row_begin(0));
         T2* first2=(T1*)_v2.row_begin(0);
         T1* last2=first2+_v1.size()*3;
         while(first2!=last2) {

Modified: branches/release/libs/gil/test/pixel.cpp
==============================================================================
--- branches/release/libs/gil/test/pixel.cpp (original)
+++ branches/release/libs/gil/test/pixel.cpp 2009-12-11 16:40:24 EST (Fri, 11 Dec 2009)
@@ -34,8 +34,9 @@
 // Testing pixel references and values, pixel operations, color conversion
 
 using namespace boost::gil;
-using namespace std;
+using std::swap;
 using namespace boost;
+
 void error_if(bool condition);
 
 struct increment {
@@ -63,8 +64,8 @@
 
         // test homogeneous algorithms - fill, max, min
         static const int num_chan = num_channels<typename C2::pixel_t>::value;
- static_fill(C2::_pixel, at_c<0>(C1::_pixel)+1);
- error_if(at_c<0>(C2::_pixel) != at_c<num_chan-1>(C2::_pixel));
+ static_fill(C2::_pixel, gil::at_c<0>(C1::_pixel)+1);
+ error_if(gil::at_c<0>(C2::_pixel) != gil::at_c<num_chan-1>(C2::_pixel));
 
         C2::_pixel = C1::_pixel;
         error_if(static_max(C2::_pixel) != static_max(C1::_pixel));
@@ -107,7 +108,7 @@
         error_if(C1::_pixel!=C2::_pixel);
 
         static_generate(C2::_pixel, set_to_one());
- error_if(at_c<0>(C2::_pixel) != 1);
+ error_if(gil::at_c<0>(C2::_pixel) != 1);
 
         // Test swap if both are mutable and if their value type is the same
         // (We know the second one is mutable)
@@ -313,7 +314,7 @@
     bgr8_pixel_t bgr8(rgb8);
     error_if(bgr8[0] == rgb8[0]);
     error_if(dynamic_at_c(bgr8,0) == dynamic_at_c(rgb8,0));
- error_if(at_c<0>(bgr8) == at_c<0>(rgb8));
+ error_if(gil::at_c<0>(bgr8) == gil::at_c<0>(rgb8));
     error_if(semantic_at_c<0>(bgr8) != semantic_at_c<0>(rgb8));
     error_if(get_color(bgr8,blue_t()) != get_color(rgb8,blue_t()));
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk