/// <summary>
        /// Reads a <see cref="IccResponseCurve"/>
        /// </summary>
        /// <param name="channelCount">The number of channels</param>
        /// <returns>The read curve</returns>
        public IccResponseCurve ReadResponseCurve(int channelCount)
        {
            var type = (IccCurveMeasurementEncodings)this.ReadUInt32();

            uint[] measurment = new uint[channelCount];
            for (int i = 0; i < channelCount; i++)
            {
                measurment[i] = this.ReadUInt32();
            }

            Vector3[] xyzValues = new Vector3[channelCount];
            for (int i = 0; i < channelCount; i++)
            {
                xyzValues[i] = this.ReadXyzNumber();
            }

            IccResponseNumber[][] response = new IccResponseNumber[channelCount][];
            for (int i = 0; i < channelCount; i++)
            {
                response[i] = new IccResponseNumber[measurment[i]];
                for (uint j = 0; j < measurment[i]; j++)
                {
                    response[i][j] = this.ReadResponseNumber();
                }
            }

            return(new IccResponseCurve(type, xyzValues, response));
        }
Beispiel #2
0
 /// <summary>
 /// Writes a response number
 /// </summary>
 /// <param name="value">The value to write</param>
 /// <returns>the number of bytes written</returns>
 public int WriteResponseNumber(IccResponseNumber value)
 {
     return(this.WriteUInt16(value.DeviceCode)
            + this.WriteFix16(value.MeasurementValue));
 }