int[] tmpPixels = new int[destW * srcH]; // temporary buffer for the
// horizontal resampling
// step
// variables to perform additive blending
int argb; // color extracted from source
int a, r, g, b; // separate channels of the color
int count; // number of pixels sampled for calculating the average
// the resampling will be separated into 2 steps for simplicity
// the first step will keep the same height and just stretch the
// picture horizontally
// the second step will take the intermediate result and stretch it
// vertically
// horizontal resampling
for (int y = 0; y < srcH; ++y)
{
for (int destX = 0; destX < destW; ++destX)
{
count = 0;
a = 0;
r = 0;
b = 0;
g = 0; // initialize color blending vars
int srcX = (destX * ratioW) >> FP_SHIFT; // calculate
// beginning of
// sample
int srcX2 = ((destX + 1) * ratioW) >> FP_SHIFT; // calculate
// end of
&