The spatial filtering functions read source pixels in a neighbourhood around the corresponding destination pixel being computed. The size of this neighbourhood depends on the size of the filter window. At the edges of the image, source image data will read outside the supplied area. It is the caller's responsibility to ensure that this data is valid, i.e. allocated and set to the appropriate values. The padding functions can be used for this. The row dimension of the source image must be large enough to span also the padding. The destination image is always of the same size as the source image (excluding padding).