- Divide the source image rectangular ROI (or the whole image, if there is no ROI) into equal rectangles, each rectangle corresponding to some pixel in the destination image. Note that each source pixel is represented by a 1x1 square.
- Compute a weighted sum of source pixel values for all pixels that are in the rectangle or have a non-zero intersection with the rectangle. If a source pixel is fully contained in the rectangle, the value of that pixel is taken with weight 1. If the rectangle and the square of the source pixel have an intersection of areaa< 1, that pixel's value is taken with weighta.FigureSupersampling Weightsshows the corresponding weight value for each source pixel intersecting with the rectangle.
- To compute the pixel value in the destination image, divide this weighted sum by the ratio of the source and destination rectangle areasS/SrcS= 1/DstxFactor*yFactor.HerexFactor, andyFactorare the parameters of the functions that specify the factors by which thexandydimensions of the source image ROI are changed.