コード例 #1
0
        /// <summary>
        /// Writes a <see cref="IccLut16TagDataEntry"/>
        /// </summary>
        /// <param name="value">The entry to write</param>
        /// <returns>The number of bytes written</returns>
        public int WriteLut16TagDataEntry(IccLut16TagDataEntry value)
        {
            int count = this.WriteByte((byte)value.InputValues.Length);

            count += this.WriteByte((byte)value.OutputValues.Length);
            count += this.WriteByte(value.ClutValues.GridPointCount[0]);
            count += this.WriteEmpty(1);

            count += this.WriteMatrix(value.Matrix, false);

            count += this.WriteUInt16((ushort)value.InputValues[0].Values.Length);
            count += this.WriteUInt16((ushort)value.OutputValues[0].Values.Length);

            foreach (IccLut lut in value.InputValues)
            {
                count += this.WriteLut16(lut);
            }

            count += this.WriteClut16(value.ClutValues);

            foreach (IccLut lut in value.OutputValues)
            {
                count += this.WriteLut16(lut);
            }

            return(count);
        }
コード例 #2
0
        internal void ReadLut16TagDataEntry(byte[] data, IccLut16TagDataEntry expected)
        {
            IccDataReader reader = CreateReader(data);

            IccLut16TagDataEntry output = reader.ReadLut16TagDataEntry();

            Assert.Equal(expected, output);
        }
コード例 #3
0
        internal void WriteLut16TagDataEntry(byte[] expected, IccLut16TagDataEntry data)
        {
            IccDataWriter writer = CreateWriter();

            writer.WriteLut16TagDataEntry(data);
            byte[] output = writer.GetData();

            Assert.Equal(expected, output);
        }