Normal
  5   ˆl–Ðz¾”*i?u8 ¸®41hß�þB gJ›|²ïóÂƒh¹ÁÀ¿      1
  W   ˆl–Ým_J¥/”Š�vã-Üm•1hß’þDË«6Y@Ð 0H€´ÞÍ_óÃ{‹„„-i[D<†ªoZƒ›Ù«Ä279_‹I|¥Žƒî4ÃVŸÄÃ     ‹      u‘?OÃ0ÅçæS˜Éé@Ø‰"ö2�1¸æ’9q¸;WT¨ßÿI¤R‘Éò½w¾ß=KO ˆÑh–uQœŠÉ�­{e�8øñXÍèØñy†Š£`¦¾NNÆsv¼?Ashèü¤Ù¸éV*OÊzØ‹Ÿb”xìÖ1•VÖ.zêì1>à!\/B+Öƒ(sóªvÊR’‹Ë‚²çq›Äaè³UDÁ)ß\¦Îœï2;EíÒÒª>ø¾¼A(ePîÙQ’Xõ4¨‘ä¾ÔÅè>¼…
¾g‡L×AÚÈÁt¢Œ„®©(š&@MÉ,ÿ,»FñOÏ]ìÉ{È�€ÖÊÍbO[_ô˜³¼þ–„¶FWÇÈÛhaÅ7    6   ˆl–Ðz¾”*i?u8 ¸Ø®2ò˜´o�þB gd�Ö£Ž2KüÿÇƒh¹ÆÅÄ      Normal
  5   	ˆl–Ðz¾”*i?u8 ¸®õ1hß�þB gJ<éevOçÈƒh¹ÇÆÅ      	1
  C   ˆl–Ãa¾”êh¥2 ¸&®6â˜´o�þZ”­,Ü¤’¸Æ ùÉ„l_È_‹I|¥�+ýÿ¹ä³ÈÇ ?÷     //
// Copyright 2005-2007 Adobe Systems Incorporated
//
// Distributed under 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
//
#ifndef BOOST_GIL_IMAGE_HPP
#define BOOST_GIL_IMAGE_HPP

#include <boost/gil/algorithm.hpp>
#include <boost/gil/image_view.hpp>
#include <boost/gil/metafunctions.hpp>
#include <boost/gil/detail/mp11.hpp>

#include <boost/assert.hpp>
#include <boost/core/exchange.hpp>

#include <cstddef>
#include <memory>
#include <utility>
#include <type_traits>

namespace boost { namespace gil {

////////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ImageModel PixelBasedModel
/// \brief container interface over image view. Models ImageConcept, PixelBasedConcept
///
/// A 2D container whose elements are pixels. It is templated over the pixel type, a boolean
/// indicating whether it should be planar, and an optional allocator.
///
/// Note that its element type does not have to be a pixel. \p image can be instantiated with any Regular element,
/// in which case it models the weaker RandomAccess2DImageConcept and does not model PixelBasedConcept
///
/// When recreating an image of the same or smaller size the memory will be reused if possible.
///
////////////////////////////////////////////////////////////////////////////////////////

template< typename Pixel, bool IsPlanar = false, typename Alloc=std::allocator<unsigned char> >
class image
{
public:
#if defined(BOOST_NO_CXX11_ALLOCATOR)
    using allocator_type = typename Alloc::template rebind<unsigned char>::other;
#else
    using allocator_type = typename std::allocator_traits<Alloc>::template rebind_alloc<unsigned char>;
#endif
    using view_t = typename view_type_from_pixel<Pixel, IsPlanar>::type;
    using const_view_t = typename view_t::const_t;
    using point_t = typename view_t::point_t;
    using coord_t = typename view_t::coord_t;
    using value_type = typename view_t::value_type;
    using x_coord_t = coord_t;
    using y_coord_t = coord_t;

    const point_t&          dimensions()            const { return _view.dimensions(); }
    x_coord_t               width()                 const { return _view.width(); }
    y_coord_t               height()                const { return _view.height(); }

    explicit image(std::size_t alignment=0,
                   const Alloc alloc_in = Alloc()) :
        _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in), _allocated_bytes( 0 ) {}

    // Create with dimensions and optional initial value and alignment
    image(const point_t& dimensions,
          std::size_t alignment=0,
          const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
                                          , _allocated_bytes( 0 )
    {
        allocate_and_default_construct(dimensions);
    }

    image(x_coord_t width, y_coord_t height,
          std::size_t alignment=0,
          const Alloc alloc_in = Alloc()) : _memory(nullptr), _align_in_bytes(alignment), _alloc(alloc_in)
                                          , _allocated_bytes( 0 )
    {
        allocate_and_default_construct(point_t(width,height));
    }

    image(const point_t& dimensions,
          const Pixel& p_in,
          std::size_t alignment = 0,
          const Alloc alloc_in = Alloc())  : _