public static void GetRgssOffsets(VectorR2[] samplesArray, int sampleCount, int quality) { if (sampleCount < 1) { throw new ArgumentOutOfRangeException("sampleCount", "sampleCount must be [0, int.MaxValue]"); } if (sampleCount != quality * quality) { throw new ArgumentOutOfRangeException("sampleCount != (quality * quality)"); } if (sampleCount == 1) { samplesArray[0] = new VectorR2(0.0, 0.0); } else { for (int i = 0; i < sampleCount; ++i) { double y = (i + 1d) / (sampleCount + 1d); double x = y * quality; x -= (int)x; samplesArray[i] = new VectorR2((double)((double)x - 0.5d), (double)((double)y - 0.5d)); } } }
public static VectorR2[] GetRgssOffsets(int quality) { int sampleCount = quality * quality; VectorR2[] samplesArray = new VectorR2[sampleCount]; GetRgssOffsets(samplesArray, sampleCount, quality); return(samplesArray); }