Commit 6e97bf05 authored by Cédric Traizet's avatar Cédric Traizet

ENH: factorize the GetPixel method outside of the loop

parent 631d08fc
......@@ -285,9 +285,10 @@ template<typename T> struct MaxInEachChannel
for (auto idx = 0u; idx < in.Size(); idx++)
{
auto pixel = in.GetPixel(idx);
for(auto band = 0u; band < out.Size();++band)
{
if(in.GetPixel(idx)[band] < out[band])
if(pixel[band] < out[band])
out[band] = in.GetPixel(idx)[band];
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment