6internal static class CaptureInformation
8 public static Metadata ToMetadata(Types.peak_icv_capture_information captureInfo)
11 MergeWithMetadata(captureInfo, metadata);
15 public static void MergeWithMetadata(Types.peak_icv_capture_information captureInfo,
Metadata metadata)
21 new PointU(captureInfo.region_of_interest.x, captureInfo.region_of_interest.y),
22 new Size(captureInfo.region_of_interest.width, captureInfo.region_of_interest.height)));
25 .exposure_time_sequence));
30 public static Types.peak_icv_capture_information FromMetadata(
Metadata metadata,
Size imageSize)
37 return FromMetadata(metadata);
40 public static Types.peak_icv_capture_information FromMetadata(
Metadata metadata)
42 var captureInfo =
new Types.peak_icv_capture_information();
43 captureInfo.binning_factor.x = 1;
44 captureInfo.binning_factor.y = 1;
45 captureInfo.relative_timestamp = 0;
49 captureInfo.binning_factor.x = binningHorizontal;
54 captureInfo.binning_factor.y = binningVertical;
59 captureInfo.relative_timestamp = timestamp;
64 captureInfo.region_of_interest.x = roi.X;
65 captureInfo.region_of_interest.y = roi.Y;
66 captureInfo.region_of_interest.width = roi.Width;
67 captureInfo.region_of_interest.height = roi.Height;
71 captureInfo.region_of_interest.x = 0;
72 captureInfo.region_of_interest.y = 0;
73 captureInfo.region_of_interest.width = 0;
74 captureInfo.region_of_interest.height = 0;
79 captureInfo.exposure_time = exposureTime;
83 captureInfo.exposure_time = 0;
88 if (exposureTimeSequence !=
null && exposureTimeSequence.Count > 4)
90 throw new NotSupportedException(
91 "Exposure time sequence has to be smaller than or equal to 4.");
94 var paddedExposureTimeSequence =
new double[4];
95 exposureTimeSequence?.CopyTo(paddedExposureTimeSequence, 0);
97 captureInfo.exposure_time_sequence = paddedExposureTimeSequence;
101 captureInfo.exposure_time_sequence =
new double[4];
106 captureInfo.gain = gain;
110 captureInfo.gain = 0;
115 if (gainSequence !=
null && gainSequence.Count > 4)
117 throw new NotSupportedException(
118 "Gain sequence has to be smaller than or equal to 4.");
121 var paddedGainSequence =
new double[4];
122 gainSequence?.CopyTo(paddedGainSequence, 0);
124 captureInfo.gain_sequence = paddedGainSequence;
128 captureInfo.gain_sequence =
new double[4];