function resampleNearestInterleaved(
  valueArray, inWidth, inHeight, outWidth, outHeight, samples) {
  const relX = inWidth / outWidth;
  const relY = inHeight / outHeight;

  const newArray = copyNewSize(valueArray, outWidth, outHeight, samples);
  for (let y = 0; y < outHeight; ++y) {
    const cy = Math.min(Math.round(relY * y), inHeight - 1);
    for (let x = 0; x < outWidth; ++x) {
      const cx = Math.min(Math.round(relX * x), inWidth - 1);
      for (let i = 0; i < samples; ++i) {
        const value = valueArray[(cy * inWidth * samples) + (cx * samples) + i];
        newArray[(y * outWidth * samples) + (x * samples) + i] = value;
      }
    }
  }
  return newArray;
}
Resample the pixel interleaved input array using nearest neighbor value selection.
@param {TypedArray} valueArrays The input arrays to resample
@param {number} inWidth The width of the input rasters
@param {number} inHeight The height of the input rasters
@param {number} outWidth The desired width of the output rasters
@param {number} outHeight The desired height of the output rasters
@param {number} samples The number of samples per pixel for pixel
                        interleaved data
@returns {TypedArray} The resampled raster