Skip to content
  • Luc Hermitte's avatar
    PERF: Avoid allocation induced by VLV pixels · fc8d97ce
    Luc Hermitte authored and Victor Poughon's avatar Victor Poughon committed
    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.
    fc8d97ce