Index: libs/gil/example/interleaved_ptr.hpp =================================================================== --- libs/gil/example/interleaved_ptr.hpp (revision 83084) +++ libs/gil/example/interleaved_ptr.hpp (working copy) @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -11,7 +11,7 @@ /*************************************************************************************************/ //////////////////////////////////////////////////////////////////////////////////////// -/// \file +/// \file /// \brief Example on how to create a pixel iterator /// \author Lubomir Bourdev and Hailin Jin \n /// Adobe Systems Incorporated @@ -28,12 +28,11 @@ #include "interleaved_ref.hpp" namespace boost { namespace gil { - ///////////////////////////////////////////////////////////////////////// /// /// A model of an interleaved pixel iterator. Contains an iterator to the first channel of the current pixel /// -/// Models: +/// Models: /// MutablePixelIteratorConcept /// PixelIteratorConcept /// boost_concepts::RandomAccessTraversalConcept @@ -82,7 +81,7 @@ // Channels accessor (not required by any concept) const ChannelPtr& channels() const { return _channels; } ChannelPtr& channels() { return _channels; } - + // Not required by concepts but useful static const std::size_t num_channels = mpl::size::value; private: @@ -92,9 +91,9 @@ void increment() { _channels+=num_channels; } void decrement() { _channels-=num_channels; } - void advance(ptrdiff_t d) { _channels+=num_channels*d; } + void advance(std::ptrdiff_t d) { _channels+=num_channels*d; } - ptrdiff_t distance_to(const interleaved_ptr& it) const { return (it._channels-_channels)/num_channels; } + std::ptrdiff_t distance_to(const interleaved_ptr& it) const { return (it._channels-_channels)/num_channels; } bool equal(const interleaved_ptr& it) const { return _channels==it._channels; } reference dereference() const { return reference(_channels); } @@ -110,12 +109,12 @@ // GIL's planar reference and iterator ("planar_pixel_reference" and "planar_pixel_iterator") which share the class "pixel" as the value_type. The // class "pixel" is also the value type for interleaved pixel references. Here we are dealing with channels, not pixels, but the principles still apply. template -struct const_iterator_type > { +struct const_iterator_type > { private: typedef typename std::iterator_traits::reference channel_ref_t; typedef typename channel_traits::const_pointer channel_const_ptr_t; public: - typedef interleaved_ptr type; + typedef interleaved_ptr type; }; template @@ -157,18 +156,18 @@ ///////////////////////////// template -inline std::ptrdiff_t memunit_step(const interleaved_ptr&) { +inline std::ptrdiff_t memunit_step(const interleaved_ptr&) { return sizeof(typename std::iterator_traits::value_type)* // size of each channel in bytes interleaved_ptr::num_channels; // times the number of channels } template -inline std::ptrdiff_t memunit_distance(const interleaved_ptr& p1, const interleaved_ptr& p2) { - return memunit_distance(p1.channels(),p2.channels()); +inline std::ptrdiff_t memunit_distance(const interleaved_ptr& p1, const interleaved_ptr& p2) { + return memunit_distance(p1.channels(),p2.channels()); } template -inline void memunit_advance(interleaved_ptr& p, std::ptrdiff_t diff) { +inline void memunit_advance(interleaved_ptr& p, std::ptrdiff_t diff) { memunit_advance(p.channels(), diff); } @@ -194,7 +193,6 @@ struct dynamic_x_step_type > { typedef memory_based_step_iterator > type; }; - } } // namespace boost::gil -#endif +#endif \ No newline at end of file Index: libs/gil/example/mandelbrot.cpp =================================================================== --- libs/gil/example/mandelbrot.cpp (revision 83084) +++ libs/gil/example/mandelbrot.cpp (working copy) @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -24,7 +24,7 @@ // Models a Unary Function template // Models PixelValueConcept struct mandelbrot_fn { - typedef point2 point_t; + typedef point2 point_t; typedef mandelbrot_fn const_t; typedef P value_type; @@ -79,5 +79,4 @@ jpeg_write_view("out-mandelbrot.jpg",mandel); return 0; -} - +} \ No newline at end of file Index: libs/gil/io/test/bmp_old_test.cpp =================================================================== --- libs/gil/io/test/bmp_old_test.cpp (revision 83084) +++ libs/gil/io/test/bmp_old_test.cpp (working copy) @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( old_read_dimensions_test ) { - point2< ptrdiff_t > dim = bmp_read_dimensions( bmp_filename ); + point2< std::ptrdiff_t > dim = bmp_read_dimensions( bmp_filename ); BOOST_CHECK_EQUAL( dim.x, 1000 ); BOOST_CHECK_EQUAL( dim.y, 600 ); Index: libs/gil/io/test/jpeg_old_test.cpp =================================================================== --- libs/gil/io/test/jpeg_old_test.cpp (revision 83084) +++ libs/gil/io/test/jpeg_old_test.cpp (working copy) @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( old_read_dimensions_test ) { - point2< ptrdiff_t > dim = jpeg_read_dimensions( jpeg_filename ); + point2< std::ptrdiff_t > dim = jpeg_read_dimensions( jpeg_filename ); BOOST_CHECK_EQUAL( dim.x, 1000 ); BOOST_CHECK_EQUAL( dim.y, 600 ); Index: libs/gil/io/test/mandel_view.hpp =================================================================== --- libs/gil/io/test/mandel_view.hpp (revision 83084) +++ libs/gil/io/test/mandel_view.hpp (working copy) @@ -10,7 +10,7 @@ // Models a Unary Function template // Models PixelValueConcept struct mandelbrot_fn { - typedef point2 point_t; + typedef point2 point_t; typedef mandelbrot_fn const_t; typedef P value_type; @@ -27,8 +27,8 @@ mandelbrot_fn() {} mandelbrot_fn(const point_t& sz, const value_type& in_color, const value_type& out_color) : _in_color(in_color), _out_color(out_color), _img_size(sz) {} - ptrdiff_t width() { return _img_size.x; } - ptrdiff_t height() { return _img_size.y; } + std::ptrdiff_t width() { return _img_size.x; } + std::ptrdiff_t height() { return _img_size.y; } result_type operator()(const point_t& p) const { // normalize the coords to (-2..1, -1.5..1.5) Index: libs/gil/io/test/png_old_test.cpp =================================================================== --- libs/gil/io/test/png_old_test.cpp (revision 83084) +++ libs/gil/io/test/png_old_test.cpp (working copy) @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( old_read_dimensions_test ) { - point2< ptrdiff_t > dim = png_read_dimensions( png_filename ); + point2< std::ptrdiff_t > dim = png_read_dimensions( png_filename ); BOOST_CHECK_EQUAL( dim.x, 1000 ); BOOST_CHECK_EQUAL( dim.y, 600 ); Index: libs/gil/io/test/pnm_old_test.cpp =================================================================== --- libs/gil/io/test/pnm_old_test.cpp (revision 83084) +++ libs/gil/io/test/pnm_old_test.cpp (working copy) @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( old_read_dimensions_test ) { { - point2< ptrdiff_t > dim = pnm_read_dimensions( pnm_filename ); + point2< std::ptrdiff_t > dim = pnm_read_dimensions( pnm_filename ); BOOST_CHECK_EQUAL( dim.x, 256 ); BOOST_CHECK_EQUAL( dim.y, 256 ); Index: libs/gil/io/test/targa_old_test.cpp =================================================================== --- libs/gil/io/test/targa_old_test.cpp (revision 83084) +++ libs/gil/io/test/targa_old_test.cpp (working copy) @@ -17,7 +17,7 @@ BOOST_AUTO_TEST_CASE( old_read_dimensions_test ) { - point2< ptrdiff_t > dim = targa_read_dimensions( targa_filename ); + point2< std::ptrdiff_t > dim = targa_read_dimensions( targa_filename ); BOOST_CHECK_EQUAL( dim.x, 124 ); BOOST_CHECK_EQUAL( dim.y, 124 ); Index: libs/gil/io/test/tiff_old_test.cpp =================================================================== --- libs/gil/io/test/tiff_old_test.cpp (revision 83084) +++ libs/gil/io/test/tiff_old_test.cpp (working copy) @@ -24,7 +24,7 @@ BOOST_AUTO_TEST_CASE( old_read_dimensions_test ) { - point2< ptrdiff_t > dim = tiff_read_dimensions( tiff_filename ); + point2< std::ptrdiff_t > dim = tiff_read_dimensions( tiff_filename ); BOOST_CHECK_EQUAL( dim.x, 1000 ); BOOST_CHECK_EQUAL( dim.y, 600 ); Index: libs/gil/test/image.cpp =================================================================== --- libs/gil/test/image.cpp (revision 83084) +++ libs/gil/test/image.cpp (working copy) @@ -1,13 +1,13 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). See http://opensource.adobe.com/gil for most recent version including documentation. */ -// image_test.cpp : +// image_test.cpp : // #ifdef _MSC_VER @@ -34,7 +34,6 @@ extern rgb8c_planar_view_t sample_view; void error_if(bool condition); - // When BOOST_GIL_GENERATE_REFERENCE_DATA is defined, the reference data is generated and saved. // When it is undefined, regression tests are checked against it //#define BOOST_GIL_GENERATE_REFERENCE_DATA @@ -71,7 +70,7 @@ struct my_color_converter { template - void operator()(const SrcP& src,DstP& dst) const { + void operator()(const SrcP& src,DstP& dst) const { typedef typename color_space_type::type src_cs_t; typedef typename color_space_type::type dst_cs_t; my_color_converter_impl()(src,dst); @@ -144,7 +143,6 @@ template struct view_is_homogeneous : public pixel_is_homogeneous {}; - //////////////////////////////////////////////////// /// /// Tests image view transformations and algorithms @@ -177,7 +175,6 @@ template void image_all_test(const string& prefix); }; - // testing image iterators, clone, fill, locators, color convert template void image_test::basic_test(const string& prefix) { @@ -246,7 +243,6 @@ check_view(hist_view,prefix+"histogram"); } - template void image_test::view_transformations_test(const View& img_view, const string& prefix) { check_view(img_view,prefix+"original"); @@ -260,7 +256,7 @@ check_view(rotated90ccw_view(img_view),prefix+"90ccw"); check_view(flipped_up_down_view(img_view),prefix+"flipped_ud"); check_view(flipped_left_right_view(img_view),prefix+"flipped_lr"); - check_view(subsampled_view(img_view,typename View::point_t(2,1)),prefix+"subsampled"); + check_view(subsampled_view(img_view,typename View::point_t(2,1)),prefix+"subsampled"); check_view(kth_channel_view<0>(img_view),prefix+"0th_k_channel"); homogeneous_view_transformations_test(img_view, prefix, view_is_homogeneous()); } @@ -270,7 +266,6 @@ check_view(nth_channel_view(img_view,0),prefix+"0th_n_channel"); } - void image_test::virtual_view_test() { typedef mandelbrot_fn deref_t; typedef deref_t::point_t point_t; @@ -320,7 +315,7 @@ check_view(view(any_img), "dynamic_"); check_view(flipped_left_right_view(view(any_img)), "dynamic_fliplr"); check_view(flipped_up_down_view(view(any_img)), "dynamic_flipud"); - + any_image_t::view_t subimageView=subimage_view(view(any_img),0,0,10,15); check_view(subimageView, "dynamic_subimage"); @@ -353,7 +348,7 @@ image_all_test("bgr121_"); // TODO: Remove? - view_transformations_test(subsampled_view(sample_view,point2(1,2)),"subsampled_"); + view_transformations_test(subsampled_view(sample_view,point2(1,2)),"subsampled_"); view_transformations_test(color_converted_view(sample_view),"color_converted_"); virtual_view_test(); @@ -363,8 +358,6 @@ finalize(); } - - //////////////////////////////////////////////////// /// /// Performs or generates image tests using checksums @@ -394,7 +387,7 @@ // Load the checksums from the reference file and create the start image void checksum_image_test::initialize() { - string crc_name; + string crc_name; boost::crc_32_type::value_type crc_result; fstream checksum_ref(_filename,ios::in); while (true) { @@ -449,7 +442,6 @@ checksum_ref.close(); } - //////////////////////////////////////////////////// /// /// Performs or generates image tests using image I/O @@ -499,13 +491,6 @@ }; #endif - - - - - - - void static_checks() { gil_function_requires >(); @@ -559,7 +544,6 @@ typedef image_test_t image_mgr_t; #endif - void test_image(const char* ref_checksum) { image_mgr_t mgr(ref_checksum); @@ -568,7 +552,6 @@ } int main(int argc, char* argv[]) { - const char* local_name = "gil_reference_checksums.txt"; const char* name_from_status = "../libs/gil/test/gil_reference_checksums.txt"; @@ -586,5 +569,4 @@ } return 0; -} - +} \ No newline at end of file Index: libs/gil/test/pixel_iterator.cpp =================================================================== --- libs/gil/test/pixel_iterator.cpp (revision 83084) +++ libs/gil/test/pixel_iterator.cpp (working copy) @@ -1,6 +1,6 @@ /* Copyright 2005-2007 Adobe Systems Incorporated - + Use, modification and distribution are subject to the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt). @@ -55,8 +55,8 @@ boost::function_requires >(); // TEST dynamic_step_t - BOOST_STATIC_ASSERT(( boost::is_same::type>::value )); - BOOST_STATIC_ASSERT(( boost::is_same::type>::value )); + BOOST_STATIC_ASSERT(( boost::is_same::type>::value )); + BOOST_STATIC_ASSERT(( boost::is_same::type>::value )); BOOST_STATIC_ASSERT(( boost::is_same::type,gray8c_ptr_t>::value )); @@ -76,7 +76,6 @@ typedef dynamic_x_step_type::type rgb2gray_step_ptr; BOOST_STATIC_ASSERT(( boost::is_same< rgb2gray_step_ptr, dereference_iterator_adaptor >::value)); - make_step_iterator(rgb2gray_ptr(),2); typedef dereference_iterator_adaptor rgb2gray_step_ptr1; @@ -97,13 +96,13 @@ typedef bit_aligned_pixel_iterator bgr232_ptr_t; // BGR232 pixel value. It is a packed_pixel of size 1 byte. (The last bit is unused) - typedef std::iterator_traits::value_type bgr232_pixel_t; + typedef std::iterator_traits::value_type bgr232_pixel_t; BOOST_STATIC_ASSERT((sizeof(bgr232_pixel_t)==1)); bgr232_pixel_t red(0,0,3); // = 0RRGGGBB, = 01100000 // a buffer of 7 bytes fits exactly 8 BGR232 pixels. - unsigned char pix_buffer[7]; + unsigned char pix_buffer[7]; std::fill(pix_buffer,pix_buffer+7,0); bgr232_ptr_t pix_it(&pix_buffer[0],0); // start at bit 0 of the first pixel for (int i=0; i<8; ++i) { @@ -127,7 +126,7 @@ buf[2] = 219; iterator_t it( &buf[0], 0 ); - + ref_t p1 = *it; it++; ref_t p2 = *it; it++; ref_t p3 = *it; it++; @@ -168,7 +167,6 @@ template inline void ignore_unused_variable_warning(const T&){} void test_pixel_iterator() { - rgb8_pixel_t rgb8(1,2,3); rgba8_pixel_t rgba8; @@ -200,7 +198,7 @@ stepIt++; rgb8_step_ptr_t stepIt2=stepIt+10; stepIt2=stepIt; - + rgb8_step_ptr_t stepIt3(&rgb8,5); rgb8_pixel_t& ref1=stepIt3[5]; @@ -214,9 +212,8 @@ ++rgb8StepIt; rgb8_ref_t reff=*rgb8StepIt; ignore_unused_variable_warning(reff); rgb8StepIt+=10; - ptrdiff_t dst=rgb8StepIt2-rgb8StepIt; ignore_unused_variable_warning(dst); + std::ptrdiff_t dst=rgb8StepIt2-rgb8StepIt; ignore_unused_variable_warning(dst); - rgb8_pixel_t val1=ref1; rgb8_ptr_t ptr=&ref1; @@ -255,10 +252,8 @@ // *pix_img_it_c=rgb8_pixel_t(1,2,3); // error: assigning though const iterator typedef iterator_from_2d::difference_type dif_t; dif_t dt=0; - ptrdiff_t tdt=dt; ignore_unused_variable_warning(tdt); + std::ptrdiff_t tdt=dt; ignore_unused_variable_warning(tdt); - - // memory_based_step_iterator stepIt3Err=stepIt+10; // error: non-const from const iterator memory_based_2d_locator xy_locator(ptr,27); @@ -279,7 +274,6 @@ rgb8c_planar_ptr_t cp(&rgb8); rgb8_planar_ptr_t p(&rgb8); // get_color(p,red_t()) = get_color(cp,green_t()); // does not compile - cannot assign a non-const pointer to a const pointer. Otherwise you will be able to modify the value through it. - } // xy_locator.y()++; @@ -287,8 +281,8 @@ // // values, references, pointers // color spaces (rgb,cmyk,gray) - // channel ordering (bgr vs rgb) - // planar vs interleaved + // channel ordering (bgr vs rgb) + // planar vs interleaved // Pixel POINTERS // typedef const iterator_traits::pointer RGB8ConstPtr; @@ -300,7 +294,6 @@ RGB8ConstPtr rgb8_const_ptr=NULL; ignore_unused_variable_warning(rgb8_const_ptr); rgb8_ptr_t rgb8ptr=&rgb8; - rgb8=bgr8_pixel_t(30,20,10); rgb8_planar_ptr_t rgb8_pptr=&rgb8; ++rgb8_pptr; @@ -313,7 +306,6 @@ rgb8_pptr=&rgb8; - // rgb8_const_planar_ptr=&rgb16p; // error: incompatible bit depth // iterator_traits::pointer cmyk8_ptr_t=&rgb8; // error: incompatible pointer type @@ -324,12 +316,11 @@ rgb8_ref_t rgb8ref_2=*rgb8ptr; ignore_unused_variable_warning(rgb8ref_2); assert(rgb8ref_2==rgb8); // RGB8Ref rgb8ref_2_err=*rgb8_const_planar_ptr; // error: non-const reference from const pointer - + rgb8_planar_ref_t rgb8planarref_3=*rgb8_pptr; // planar reference from planar pointer assert(rgb8planarref_3==rgb8); // RGB8Ref rgb8ref_3=*rgb8_planar_ptr_t; // error: non-planar reference from planar pointer - const rgb8_pixel_t crgb8=rgb8; *rgb8_pptr=rgb8; *rgb8_pptr=crgb8; @@ -342,5 +333,4 @@ int main(int argc, char* argv[]) { test_pixel_iterator(); return 0; -} - +} \ No newline at end of file