Re: [Boost-bugs] [Boost C++ Libraries] #2211: Can not create image of Regular type

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #2211: Can not create image of Regular type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-08-19 09:24:43


#2211: Can not create image of Regular type
-----------------------------------+----------------------------------------
  Reporter: john.femiani_at_[hidden] | Owner: hljin
      Type: Bugs | Status: new
 Milestone: Boost 1.36.0 | Component: GIL
   Version: Boost 1.36.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------

Comment(by anonymous):

 Replying to [comment:1 john.femiani_at_[hidden]]:

>
> 1. A regular type (like a single-chennel pixel) can be considered
 planer or interleaved. When the image type is planar, GIL tends to use the
 `num_channels` metafunction (valid only for !PixelBased), so it is easier
 just to say Regular types are '''not''' planar.
>

 In order to make this clear, I suggest the following additional patch, to
 be applied after the first:

 {{{
 #!patch

 Index: image.hpp
 ===================================================================
 --- image.hpp (revision 48190)
 +++ image.hpp (working copy)
 @@ -48,6 +48,8 @@
 ////////////////////////////////////////////////////////////////////////////////////////

 -template <typename Pixel, bool IsPlanar, typename
 Alloc=std::allocator<unsigned char> >
 +template <typename Pixel,
 + bool IsPlanar=false,
 + typename Alloc=std::allocator<unsigned char> >
  class image {
  public:
      typedef typename Alloc::template rebind<unsigned char>::other
 allocator_type;

 }}}

 This provides a default value for the !IsPlanar template argument, so it
 can b left out if the image is a single channel pixel, so it does not
 create semantic 'noise'.

 For example:

 {{{
 #!cpp

  gil::image<int> the_img(100,100);
  gil::image<int>::view_t the_view = view(img);
  //NOTE: Why arent views constructible from images?

 }}}
 --John

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2211#comment:2>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:58 UTC