コード例 #1
0
        /// <summary>
        /// Writes a tag data entry
        /// </summary>
        /// <param name="data">The entry to write</param>
        /// <param name="table">The table entry for the written data entry</param>
        /// <returns>The number of bytes written (excluding padding)</returns>
        public int WriteTagDataEntry(IccTagDataEntry data, out IccTagTableEntry table)
        {
            uint offset = (uint)this.dataStream.Position;
            int  count  = this.WriteTagDataEntry(data);

            this.WritePadding();
            table = new IccTagTableEntry(data.TagSignature, offset, (uint)count);
            return(count);
        }
コード例 #2
0
        private IccTagTableEntry[] ReadTagTable(IccDataReader reader)
        {
            reader.SetIndex(128);   // An ICC header is 128 bytes long

            uint tagCount = reader.ReadUInt32();

            IccTagTableEntry[] table = new IccTagTableEntry[tagCount];

            for (int i = 0; i < tagCount; i++)
            {
                uint tagSignature = reader.ReadUInt32();
                uint tagOffset    = reader.ReadUInt32();
                uint tagSize      = reader.ReadUInt32();
                table[i] = new IccTagTableEntry((IccProfileTag)tagSignature, tagOffset, tagSize);
            }

            return(table);
        }