コード例 #1
0
        private IccProfileHeader ReadHeader(IccDataReader reader)
        {
            reader.SetIndex(0);

            return(new IccProfileHeader
            {
                Size = reader.ReadUInt32(),
                CmmType = reader.ReadAsciiString(4),
                Version = reader.ReadVersionNumber(),
                Class = (IccProfileClass)reader.ReadUInt32(),
                DataColorSpace = (IccColorSpaceType)reader.ReadUInt32(),
                ProfileConnectionSpace = (IccColorSpaceType)reader.ReadUInt32(),
                CreationDate = reader.ReadDateTime(),
                FileSignature = reader.ReadAsciiString(4),
                PrimaryPlatformSignature = (IccPrimaryPlatformType)reader.ReadUInt32(),
                Flags = (IccProfileFlag)reader.ReadInt32(),
                DeviceManufacturer = reader.ReadUInt32(),
                DeviceModel = reader.ReadUInt32(),
                DeviceAttributes = (IccDeviceAttribute)reader.ReadInt64(),
                RenderingIntent = (IccRenderingIntent)reader.ReadUInt32(),
                PcsIlluminant = reader.ReadXyzNumber(),
                CreatorSignature = reader.ReadAsciiString(4),
                Id = reader.ReadProfileId(),
            });
        }
コード例 #2
0
        public void ReadAsciiString(byte[] textBytes, int length, string expected)
        {
            IccDataReader reader = this.CreateReader(textBytes);

            string output = reader.ReadAsciiString(length);

            Assert.Equal(expected, output);
        }
コード例 #3
0
        public void ReadAsciiStringWithNegativeLengthThrowsArgumentException()
        {
            IccDataReader reader = this.CreateReader(new byte[4]);

            Assert.Throws <ArgumentOutOfRangeException>(() => reader.ReadAsciiString(-1));
        }