Commit fc8d97ce authored by Committed by Victor Poughon
PERF: Avoid allocation induced by VLV pixels
The `DifferenceImageFilter` is often used on `VectorImage`s, in particular when doing `compare-image`. Creating new `VariableLengthVector` pixels at each iteration, or casting them will automatically end up in construction and destruction of VLV pixels, and thus allocation and liberation of heap memory. This is not efficient. This commit aims at minimizing the number of allocation by factorizing out everything that can be (pixel size, typical max value, typical zero value). Resetting value is done by assignment, which has the good property of not inducing any allocation on VLV variables.
Showing with 64 additions and 49 deletions