algorithm.hpp File Reference


Detailed Description

Some basic STL-style algorithms when applied to image views.

Author:
Lubomir Bourdev and Hailin Jin
Adobe Systems Incorporated
Date:
2005-2008
Last updated on March 12, 2008

#include <cassert>
#include <cstddef>
#include <cstring>
#include <algorithm>
#include <iterator>
#include <memory>
#include <typeinfo>
#include "gil_config.hpp"
#include "gil_concept.hpp"
#include "color_base_algorithm.hpp"
#include "image_view.hpp"
#include "image_view_factory.hpp"
#include "bit_aligned_pixel_iterator.hpp"

Go to the source code of this file.


Namespaces

namespace  boost
namespace  boost::gil
namespace  std
namespace  boost::gil::detail

Classes

struct  binary_operation_obj
 A generic binary operation on views

Use this class as a convenience superclass when defining an operation for any image views. Many operations have different behavior when the two views are compatible. This class checks for compatibility and invokes apply_compatible(V1,V2) or apply_incompatible(V1,V2) of the subclass. You must provide apply_compatible(V1,V2) method in your subclass, but apply_incompatible(V1,V2) is not required and the default throws std::bad_cast. More...

struct  copier_n
struct  copier_n< iterator_from_2d< IL >, O >
 Source range is delimited by image iterators. More...
struct  copier_n< I, iterator_from_2d< OL > >
 Destination range is delimited by image iterators. More...
struct  copier_n< iterator_from_2d< IL >, iterator_from_2d< OL > >
 Both source and destination ranges are delimited by image iterators. More...
struct  std_fill_t
 struct to do std::fill More...
struct  equal_n_fn< const pixel< T, Cs > *, const pixel< T, Cs > * >
struct  equal_n_fn< planar_pixel_iterator< IC, Cs >, planar_pixel_iterator< IC, Cs > >
struct  equal_n_fn< boost::gil::iterator_from_2d< Loc >, I2 >
 Source range is delimited by image iterators. More...
struct  equal_n_fn< I1, boost::gil::iterator_from_2d< Loc > >
 Destination range is delimited by image iterators. More...
struct  equal_n_fn< boost::gil::iterator_from_2d< Loc1 >, boost::gil::iterator_from_2d< Loc2 > >
 Both source and destination ranges are delimited by image iterators. More...

Functions

template<typename T, typename Cs>
GIL_FORCEINLINE
boost::gil::pixel< T, Cs > * 
copy (boost::gil::pixel< T, Cs > *first, boost::gil::pixel< T, Cs > *last, boost::gil::pixel< T, Cs > *dst)
 Copy when both src and dst are interleaved and of the same type can be just memmove.
template<typename T, typename Cs>
GIL_FORCEINLINE
boost::gil::pixel< T, Cs > * 
copy (const boost::gil::pixel< T, Cs > *first, const boost::gil::pixel< T, Cs > *last, boost::gil::pixel< T, Cs > *dst)
 Copy when both src and dst are interleaved and of the same type can be just memmove.
template<typename Cs, typename IC1, typename IC2>
GIL_FORCEINLINE
boost::gil::planar_pixel_iterator
< IC2, Cs > 
copy (boost::gil::planar_pixel_iterator< IC1, Cs > first, boost::gil::planar_pixel_iterator< IC1, Cs > last, boost::gil::planar_pixel_iterator< IC2, Cs > dst)
 Copy when both src and dst are planar pointers is copy for each channel.
template<typename SrcIterator, typename DstIterator>
GIL_FORCEINLINE DstIterator copy_with_2d_iterators (SrcIterator first, SrcIterator last, DstIterator dst)
template<typename IL, typename OL>
GIL_FORCEINLINE
boost::gil::iterator_from_2d
< OL > 
copy1 (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, boost::gil::iterator_from_2d< OL > dst)
 std::copy(I1,I1,I2) with I1 and I2 being a iterator_from_2d
template<typename View1, typename View2>
GIL_FORCEINLINE void copy_pixels (const View1 &src, const View2 &dst)
 std::copy for image views
template<typename V1, typename V2, typename CC>
GIL_FORCEINLINE void copy_and_convert_pixels (const V1 &src, const V2 &dst, CC cc)
template<typename View1, typename View2>
GIL_FORCEINLINE void copy_and_convert_pixels (const View1 &src, const View2 &dst)
template<typename IL, typename V>
void fill (boost::gil::iterator_from_2d< IL > first, boost::gil::iterator_from_2d< IL > last, const V &val)
 std::fill(I,I,V) with I being a iterator_from_2d
template<typename It, typename P>
GIL_FORCEINLINE void fill_aux (It first, It last, const P &p, mpl::true_)
 std::fill for planar iterators
template<typename It, typename P>
GIL_FORCEINLINE void fill_aux (It first, It last, const P &p, mpl::false_)
 std::fill for interleaved iterators
template<typename View, typename Value>
GIL_FORCEINLINE void fill_pixels (const View &img_view, const Value &val)
 std::fill for image views
template<typename It>
GIL_FORCEINLINE void destruct_range_impl (It first, It last, mpl::true_)
template<typename It>
GIL_FORCEINLINE void destruct_range_impl (It first, It last, mpl::false_)
template<typename It>
GIL_FORCEINLINE void destruct_range (It first, It last)
template<typename It>
GIL_FORCEINLINE void destruct_aux (It first, It last, mpl::true_)
 destruct for planar iterators
template<typename It>
GIL_FORCEINLINE void destruct_aux (It first, It last, mpl::false_)
 destruct for interleaved iterators
template<typename View>
GIL_FORCEINLINE void destruct_pixels (const View &img_view)
 Invokes the in-place destructor on every pixel of the view.
template<typename It, typename P>
GIL_FORCEINLINE void uninitialized_fill_aux (It first, It last, const P &p, mpl::true_)
template<typename It, typename P>
GIL_FORCEINLINE void uninitialized_fill_aux (It first, It last, const P &p, mpl::false_)
template<typename View, typename Value>
void uninitialized_fill_pixels (const View &img_view, const Value &val)
 std::uninitialized_fill for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed pixels
template<typename It>
GIL_FORCEINLINE void default_construct_range_impl (It first, It last, mpl::true_)
template<typename It>
GIL_FORCEINLINE void default_construct_range_impl (It first, It last, mpl::false_)
template<typename It>
GIL_FORCEINLINE void default_construct_range (It first, It last)
template<typename It>
GIL_FORCEINLINE void default_construct_aux (It first, It last, mpl::true_)
 uninitialized_default_construct for planar iterators
template<typename It>
GIL_FORCEINLINE void default_construct_aux (It first, It last, mpl::false_)
 uninitialized_default_construct for interleaved iterators
template<typename View>
void default_construct_pixels (const View &img_view)
 Invokes the in-place default constructor on every pixel of the (uninitialized) view. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place default-constructed pixels.
template<typename It1, typename It2>
GIL_FORCEINLINE void uninitialized_copy_aux (It1 first1, It1 last1, It2 first2, mpl::true_)
 std::uninitialized_copy for pairs of planar iterators
template<typename It1, typename It2>
GIL_FORCEINLINE void uninitialized_copy_aux (It1 first1, It1 last1, It2 first2, mpl::false_)
 std::uninitialized_copy for interleaved or mixed iterators
template<typename View1, typename View2>
void uninitialized_copy_pixels (const View1 &view1, const View2 &view2)
 std::uninitialized_copy for image views. Does not support planar heterogeneous views. If an exception is thrown destructs any in-place copy-constructed objects
template<typename V, typename F>
for_each_pixel (const V &img, F fun)
template<typename View, typename F>
for_each_pixel_position (const View &img, F fun)
template<typename View, typename F>
void generate_pixels (const View &v, F fun)
 std::generate for image views
template<typename I1, typename I2>
GIL_FORCEINLINE bool equal_n (I1 i1, std::ptrdiff_t n, I2 i2)
template<typename Loc1, typename Loc2>
GIL_FORCEINLINE bool equal (boost::gil::iterator_from_2d< Loc1 > first, boost::gil::iterator_from_2d< Loc1 > last, boost::gil::iterator_from_2d< Loc2 > first2)
 std::equal(I1,I1,I2) with I1 and I2 being a iterator_from_2d
template<typename View1, typename View2>
GIL_FORCEINLINE bool equal_pixels (const View1 &v1, const View2 &v2)
 std::equal for image views
template<typename View1, typename View2, typename F>
GIL_FORCEINLINE F transform_pixels (const View1 &src, const View2 &dst, F fun)
 std::transform for image views
template<typename View1, typename View2, typename View3, typename F>
GIL_FORCEINLINE F transform_pixels (const View1 &src1, const View2 &src2, const View3 &dst, F fun)
 transform_pixels with two sources
template<typename View1, typename View2, typename F>
GIL_FORCEINLINE F transform_pixel_positions (const View1 &src, const View2 &dst, F fun)
 Like transform_pixels but passes to the function object pixel locators instead of pixel references.
template<typename View1, typename View2, typename View3, typename F>
GIL_FORCEINLINE F transform_pixel_positions (const View1 &src1, const View2 &src2, const View3 &dst, F fun)
 transform_pixel_positions with two sources

Generated on Sat May 2 13:50:15 2009 for Generic Image Library by  doxygen 1.5.6