Skip to content

Commit

Permalink
Use transform
Browse files Browse the repository at this point in the history
Rather than manually
writing out each entry,
use std::transform
  • Loading branch information
simmplecoder committed Jun 25, 2020
1 parent 7862bb9 commit 55c3b65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/boost/gil/image_processing/diffusion.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ void anisotropic_diffusion(const InputView& input, const OutputView& output, uns
minus(result(x - 1, y), current), // west
minus(result(x + 1, y), current) // east
};
std::array<pixel_type, 4> diffusivity{g(nabla[0]), g(nabla[1]), g(nabla[2]),
g(nabla[3])};
std::array<pixel_type, 4> diffusivity;
std::transform(nabla.begin(), nabla.end(), diffusivity.begin(), g);
std::array<pixel_type, 4> product;
std::transform(nabla.begin(), nabla.end(), diffusivity.begin(), product.begin(),
multiply);
Expand Down

0 comments on commit 55c3b65

Please sign in to comment.