Some basic STL-style algorithms when applied to image views. More...
#include <cassert>
#include <cstddef>
#include <cstring>
#include <algorithm>
#include <iterator>
#include <memory>
#include <typeinfo>
#include <boost/config.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/or.hpp>
#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.
Classes | |
struct | planar_pixel_iterator< ChannelPtr, ColorSpace > |
An iterator over planar pixels. Models HomogeneousColorBaseConcept, PixelIteratorConcept, HomogeneousPixelBasedConcept, MemoryBasedIteratorConcept, HasDynamicXStepTypeConcept. More... | |
class | memory_based_step_iterator< Iterator > |
MEMORY-BASED STEP ITERATOR. More... | |
class | memory_based_2d_locator< StepIterator > |
Memory-based pixel locator. Models: PixelLocatorConcept,HasDynamicXStepTypeConcept,HasDynamicYStepTypeConcept,HasTransposedTypeConceptThe class takes a step iterator as a parameter. The step iterator provides navigation along the vertical axis while its base iterator provides horizontal navigation. More... | |
struct | binary_operation_obj< Derived, Result > |
A generic binary operation on viewsUse 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< I, O > |
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... | |
Namespaces | |
boost | |
Pixel 2D LOCATOR. | |
Functions | |
template<typename T , typename Cs > | |
BOOST_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 > | |
BOOST_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 > | |
BOOST_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 > | |
BOOST_FORCEINLINE DstIterator | copy_with_2d_iterators (SrcIterator first, SrcIterator last, DstIterator dst) |
template<typename IL , typename OL > | |
BOOST_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 > | |
BOOST_FORCEINLINE void | copy_pixels (const View1 &src, const View2 &dst) |
std::copy for image views | |
template<typename V1 , typename V2 , typename CC > | |
BOOST_FORCEINLINE void | copy_and_convert_pixels (const V1 &src, const V2 &dst, CC cc) |
template<typename View1 , typename View2 > | |
BOOST_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 More... | |
template<typename It , typename P > | |
BOOST_FORCEINLINE void | fill_aux (It first, It last, const P &p, mpl::true_) |
std::fill for planar iterators | |
template<typename It , typename P > | |
BOOST_FORCEINLINE void | fill_aux (It first, It last, const P &p, mpl::false_) |
std::fill for interleaved iterators | |
template<typename View , typename Value > | |
BOOST_FORCEINLINE void | fill_pixels (const View &img_view, const Value &val) |
std::fill for image views | |
template<typename It > | |
BOOST_FORCEINLINE void | destruct_range_impl (It first, It last, typename enable_if< mpl::and_< is_pointer< It >, mpl::not_< boost::has_trivial_destructor< typename std::iterator_traits< It >::value_type > > > >::type *=0) |
template<typename It > | |
BOOST_FORCEINLINE void | destruct_range_impl (It, It, typename enable_if< mpl::or_< mpl::not_< is_pointer< It > >, boost::has_trivial_destructor< typename std::iterator_traits< It >::value_type > > >::type *=0) |
template<typename It > | |
BOOST_FORCEINLINE void | destruct_range (It first, It last) |
template<typename It > | |
BOOST_FORCEINLINE void | destruct_aux (It first, It last, mpl::true_) |
destruct for planar iterators | |
template<typename It > | |
BOOST_FORCEINLINE void | destruct_aux (It first, It last, mpl::false_) |
destruct for interleaved iterators | |
template<typename View > | |
BOOST_FORCEINLINE void | destruct_pixels (const View &img_view) |
Invokes the in-place destructor on every pixel of the view. | |
template<typename It , typename P > | |
BOOST_FORCEINLINE void | uninitialized_fill_aux (It first, It last, const P &p, mpl::true_) |
template<typename It , typename P > | |
BOOST_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 > | |
BOOST_FORCEINLINE void | default_construct_range_impl (It first, It last, mpl::true_) |
template<typename It > | |
BOOST_FORCEINLINE void | default_construct_range_impl (It, It, mpl::false_) |
template<typename It > | |
BOOST_FORCEINLINE void | default_construct_range (It first, It last) |
template<typename It > | |
BOOST_FORCEINLINE void | default_construct_aux (It first, It last, mpl::true_) |
uninitialized_default_construct for planar iterators | |
template<typename It > | |
BOOST_FORCEINLINE void | default_construct_aux (It first, It last, mpl::false_) |
uninitialized_default_construct for interleaved iterators | |
template<typename View , bool B> | |
BOOST_FORCEINLINE void | default_construct_pixels_impl (const View &img_view, boost::enable_if< is_same< mpl::bool_< B >, mpl::false_ > > *=0) |
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 > | |
BOOST_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 > | |
BOOST_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 > | |
F | for_each_pixel (const V &img, F fun) |
template<typename View , typename F > | |
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 > | |
BOOST_FORCEINLINE bool | equal_n (I1 i1, std::ptrdiff_t n, I2 i2) |
template<typename Loc1 , typename Loc2 > | |
BOOST_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 More... | |
template<typename View1 , typename View2 > | |
BOOST_FORCEINLINE bool | equal_pixels (const View1 &v1, const View2 &v2) |
std::equal for image views | |
template<typename View1 , typename View2 , typename F > | |
BOOST_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 > | |
BOOST_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 > | |
BOOST_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 > | |
BOOST_FORCEINLINE F | transform_pixel_positions (const View1 &src1, const View2 &src2, const View3 &dst, F fun) |
transform_pixel_positions with two sources | |
Some basic STL-style algorithms when applied to image views.