def apply_antialiasing(kernel, kernel_width, scale_factor,
                                 antialiasing):
    """
    Antialiasing is "stretching" the field of view according to the scale
    factor (only for downscaling). This is produces the low-pass filtering. 
    This requires modifying both the interpolation (stretching the 1d
    function and multiplying by the scale-factor) and the window size.
    """
    if scale_factor >= 1.0 or not antialiasing:
        return kernel, kernel_width
    cur_kernel = (lambda arg: scale_factor *
                         kernel(scale_factor * arg))
    cur_kernel_width = kernel_width / scale_factor
    return cur_kernel, cur_kernel_width