C++ (Qt)foreach pixel { float value = 0.0f; foreach point { float d = distance(pixel, point); if (d < averageRadius) { value += 1.0f - d / averageRadius; if (value >= 1.0f) break; } } pixel.SetColor(value, 0, 0);}