Exemplo n.º 1
0
        internal void ReadLut16(byte[] data, IccLut expected, int count)
        {
            IccDataReader reader = CreateReader(data);

            IccLut output = reader.ReadLut16(count);

            Assert.Equal(expected, output);
        }
Exemplo n.º 2
0
        internal void ReadLut8(byte[] data, IccLut expected)
        {
            IccDataReader reader = this.CreateReader(data);

            IccLut output = reader.ReadLut8();

            Assert.Equal(expected, output);
        }
Exemplo n.º 3
0
        internal void WriteLut16(byte[] expected, IccLut data, int count)
        {
            IccDataWriter writer = this.CreateWriter();

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

            Assert.Equal(expected, output);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Writes an 16bit lookup table
        /// </summary>
        /// <param name="value">The LUT to write</param>
        /// <returns>The number of bytes written</returns>
        public int WriteLut16(IccLut value)
        {
            foreach (float item in value.Values)
            {
                this.WriteUInt16((ushort)Numerics.Clamp((item * ushort.MaxValue) + 0.5F, 0, ushort.MaxValue));
            }

            return(value.Values.Length * 2);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Writes an 8bit lookup table
        /// </summary>
        /// <param name="value">The LUT to write</param>
        /// <returns>The number of bytes written</returns>
        public int WriteLut8(IccLut value)
        {
            foreach (float item in value.Values)
            {
                this.WriteByte((byte)Numerics.Clamp((item * byte.MaxValue) + 0.5F, 0, byte.MaxValue));
            }

            return(value.Values.Length);
        }
Exemplo n.º 6
0
        internal void WriteLut8(byte[] expected, IccLut data)
        {
            IccDataWriter writer = CreateWriter();

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

            Assert.Equal(expected, output);
        }