using System; using System.Runtime.InteropServices; using NvAPIWrapper.Native.Helpers; using NvAPIWrapper.Native.Interfaces; namespace NvAPIWrapper.Native.GPU.Structures { /// /// Holds information regarding a piecewise linear RGB control method /// [StructLayout(LayoutKind.Sequential, Pack = 8)] public struct IlluminationZoneControlDataPiecewiseLinearRGB : IInitializable { private const int NumberColorEndPoints = 2; [MarshalAs(UnmanagedType.ByValArray, SizeConst = NumberColorEndPoints)] internal IlluminationZoneControlDataManualRGBParameters[] _EndPoints; internal IlluminationZoneControlDataPiecewiseLinear _PiecewiseLinearData; /// /// Creates a new instance of . /// /// The list of RGB piecewise function endpoints. /// The piecewise function settings. public IlluminationZoneControlDataPiecewiseLinearRGB( IlluminationZoneControlDataManualRGBParameters[] endPoints, IlluminationZoneControlDataPiecewiseLinear piecewiseLinearData) { if (endPoints?.Length != NumberColorEndPoints) { throw new ArgumentOutOfRangeException(nameof(endPoints)); } this = typeof(IlluminationZoneControlDataPiecewiseLinearRGB) .Instantiate(); _PiecewiseLinearData = piecewiseLinearData; Array.Copy(endPoints, 0, _EndPoints, 0, endPoints.Length); } /// /// Gets the piecewise function settings /// public IlluminationZoneControlDataPiecewiseLinear PiecewiseLinearData { get => _PiecewiseLinearData; } /// /// Gets the list of RGB function endpoints /// public IlluminationZoneControlDataManualRGBParameters[] EndPoints { get => _EndPoints; } } }