I think about something like this:
```
#ifdef BORDER_CONSTANT
        if (NEED_EXTRAPOLATION(src_x, src_cols))
        {
            for (int y = y0, y1 = min(y0 + rowsPerWI, dst_rows); y < y1; ++y, dst_index += dst_step)
                storepix(scalar, dstptr + dst_index);
            return;
        }
#endif
        EXTRAPOLATE(src_x, src_cols)
```