Image view-equivalents of STL algorithms. More...
Modules | |
copy_pixels | |
std::copy and gil::copy_pixels | |
copy_and_convert_pixels | |
copy_and_convert_pixels | |
fill_pixels | |
std::fill for image views | |
destruct_pixels | |
destruct_pixels | |
uninitialized_fill_pixels | |
uninitialized_fill_pixels | |
default_construct_pixels | |
default_construct_pixels | |
uninitialized_copy_pixels | |
uninitialized_copy_pixels | |
for_each_pixel | |
for_each_pixel | |
for_each_pixel_position | |
adobe::for_each_position for image views (passes locators, instead of pixel references, to the function object) | |
generate_pixels | |
generate_pixels | |
equal_pixels | |
std::equal and gil::equal_pixels for GIL constructs | |
transform_pixels | |
transform_pixels | |
transform_pixel_positions | |
adobe::transform_positions for image views (passes locators, instead of pixel references, to the function object) | |
Classes | |
struct | boost::gil::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. More... | |
Image view-equivalents of STL algorithms.
Image views provide 1D iteration of their pixels via begin()
and end()
methods, which makes it possible to use STL algorithms with them. However, using nested loops over X and Y is in many cases more efficient. The algorithms in this section resemble STL algorithms, but they abstract away the nested loops and take views (as opposed to ranges) as input.
Most algorithms check whether the image views are 1D-traversable. A 1D-traversable image view has no gaps at the end of the rows. In other words, if an x_iterator of that view is advanced past the last pixel in a row it will move to the first pixel of the next row. When image views are 1D-traversable, the algorithms use a single loop and run more efficiently. If one or more of the input views are not 1D-traversable, the algorithms fall-back to an X-loop nested inside a Y-loop.
The algorithms typically delegate the work to their corresponding STL algorithms. For example, copy_pixels
calls std::copy
either for each row, or, when the images are 1D-traversable, once for all pixels.
In addition, overloads are sometimes provided for the STL algorithms. For example, std::copy for planar iterators is overloaded to perform std::copy
for each of the planes. std::copy
over bitwise-copiable pixels results in std::copy over unsigned char, which STL typically implements via memmove
.
As a result copy_pixels
may result in a single call to memmove
for interleaved 1D-traversable views, or one per each plane of planar 1D-traversable views, or one per each row of interleaved non-1D-traversable images, etc.