static void RaiseFrameReceivedEvent() { var lightEstimation = new LightEstimationData(); float data = 0F; if (cameraSubsystem.TryGetAverageBrightness(ref data)) { lightEstimation.averageBrightness = data; } if (cameraSubsystem.TryGetAverageColorTemperature(ref data)) { lightEstimation.averageColorTemperature = data; } Color colorCorrection; if (cameraSubsystem.TryGetColorCorrection(out colorCorrection)) { lightEstimation.colorCorrection = colorCorrection; } float?timestampSeconds = null; Int64 timestampNs = 0; if (cameraSubsystem.TryGetTimestamp(ref timestampNs)) { timestampSeconds = timestampNs * 1e-9F; } s_CameraFrameReceived(new ARCameraFrameEventArgs(lightEstimation, timestampSeconds)); }
/// <summary> /// Constructs an <see cref="ARCameraFrameEventArgs" />. /// </summary> /// <param name="lightEstimation">The <see cref="LightEstimationData" /> for the frame.</param> /// <param name="time">The time, in seconds, for the frame.</param> public ARCameraFrameEventArgs(LightEstimationData lightEstimation, float?time) { this.lightEstimation = lightEstimation; this.time = time; }