C++ (Qt)float temp = ((float) pixel.red * num_frames + new_pixel.red) / (num_frames + 1);pixel.red = int (temp + 0.5f);