示例#1
0
        /// <summary>
        /// Creates a new instance of the <see cref="CLUT"/> class
        /// </summary>
        /// <param name="values">The CLUT values</param>
        /// <param name="gridPointCount">The gridpoint count</param>
        /// <param name="type">The data type of this CLUT</param>
        public CLUT(double[][] values, byte[] gridPointCount, CLUTDataType type)
            : this(gridPointCount?.Length ?? 1, values?[0]?.Length ?? 1, gridPointCount, type)
        {
            if (values == null)
            {
                throw new ArgumentNullException(nameof(values));
            }

            Values = values;
            CheckValues();
        }
示例#2
0
        private CLUT(int inChCount, int outChCount, byte[] gridPointCount, CLUTDataType type)
        {
            if (gridPointCount == null)
            {
                throw new ArgumentNullException(nameof(gridPointCount));
            }
            if (!Enum.IsDefined(typeof(CLUTDataType), type))
            {
                throw new ArgumentException($"{nameof(type)} value is not of a defined Enum value");
            }
            if (inChCount < 1 || inChCount > 15)
            {
                throw new ArgumentOutOfRangeException("Input channel count must be in the range of 1-15");
            }
            if (outChCount < 1 || outChCount > 15)
            {
                throw new ArgumentOutOfRangeException("Output channel count must be in the range of 1-15");
            }

            DataType           = type;
            InputChannelCount  = inChCount;
            OutputChannelCount = outChCount;
            GridPointCount     = gridPointCount;
        }