예제 #1
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     Value.Load(buffer);
 }
예제 #2
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     Value = System.Text.Encoding.ASCII.GetString(buffer.ReadBytes((int)Table.ElementSize - 8));
 }
예제 #3
0
 internal void Load(Bytes.Buffer buffer)
 {
     SettingId = (ICCDeviceSettingsIds)buffer.ReadUnsignedInt();
     Size      = buffer.ReadUnsignedInt();
     Count     = buffer.ReadUnsignedInt();
     Values    = new ICCDeviceSettingValue[Count];
     for (int i = 0; i < Count; i++)
     {
         var settingValue = (ICCDeviceSettingValue)null;
         if (SettingId == ICCDeviceSettingsIds.Resolution)
         {
             settingValue = new ICCDeviceSettingResolutiuon();
         }
         if (SettingId == ICCDeviceSettingsIds.MediaType)
         {
             settingValue = new ICCDeviceSettingMediaType();
         }
         if (SettingId == ICCDeviceSettingsIds.Halftone)
         {
             settingValue = new ICCDeviceSettingHalftone();
         }
         settingValue.Load(buffer);
         Values[i] = settingValue;
     }
 }
예제 #4
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     Illuminant.Load(buffer);
     Surround.Load(buffer);
     MeasurmentType = buffer.ReadUnsignedInt();
 }
예제 #5
0
        public override void Load(Bytes.Buffer buffer)
        {
            buffer.Seek(Table.Offset);
            buffer.ReadUnsignedInt();
            buffer.ReadUnsignedInt();
            var count = (int)Table.ElementSize - 8;

            Value = buffer.ReadBytes(count);
        }
 public void Load(Bytes.Buffer buffer)
 {
     DeviceManufacturer = buffer.ReadUnsignedInt();
     DeviceModel        = buffer.ReadUnsignedInt();
     DeviceAttributes.Load(buffer);
     DeviceTechnology        = buffer.ReadUnsignedInt();
     ManufacturerDescription = System.Text.Encoding.ASCII.GetString(buffer.ReadNullTermitaded());
     ModelDescription        = System.Text.Encoding.ASCII.GetString(buffer.ReadNullTermitaded());
 }
예제 #7
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     DataFlag  = buffer.ReadUnsignedInt();
     ByteValue = new byte[Table.ElementSize - 12];
     if (DataFlag == 0x00000000)
     {
         StringValue = System.Text.Encoding.ASCII.GetString(ByteValue);
     }
 }
예제 #8
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     VendorSpecificFlag = buffer.ReadUnsignedInt();
     Count = buffer.ReadUnsignedInt();
     Prefix = System.Text.Encoding.ASCII.GetString(buffer.ReadNullTermitaded());
     Suffix = System.Text.Encoding.ASCII.GetString(buffer.ReadNullTermitaded());
     FirstColor = System.Text.Encoding.ASCII.GetString(buffer.ReadNullTermitaded());
     //....color coordinates. Color space of data
 }
예제 #9
0
 internal void Load(Bytes.Buffer buffer)
 {
     Size      = buffer.ReadUnsignedInt();
     Count     = buffer.ReadUnsignedInt();
     Setttings = new ICCDeviceSetting[Count];
     for (int i = 0; i < Count; i++)
     {
         var setting = new ICCDeviceSetting();
         setting.Load(buffer);
         Setttings[i] = setting;
     }
 }
예제 #10
0
        public override void Load(Bytes.Buffer buffer)
        {
            buffer.Seek(Table.Offset);
            buffer.ReadUnsignedInt();
            buffer.ReadUnsignedInt();
            var count = (Table.ElementSize - 8) / 4;

            Value = new float[count];
            for (int i = 0; i < count; i++)
            {
                Value[i] = buffer.ReadFixed32();
            }
        }
예제 #11
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     Flag             = (ICCScreeningFlag)buffer.ReadUnsignedInt();
     NumberOfChannels = buffer.ReadUnsignedInt();
     Channels         = new ICCScreeningChannel[NumberOfChannels];
     for (int i = 0; i < NumberOfChannels; i++)
     {
         Channels[i].Load(buffer);
     }
 }
예제 #12
0
 internal void Load(Bytes.Buffer buffer)
 {
     PlatformId           = (ICCPrimaryPlatformSignatures)buffer.ReadUnsignedInt();
     Size                 = buffer.ReadUnsignedInt();
     Count                = buffer.ReadUnsignedInt();
     SetttingCombinations = new ICCDeviceSettingsCombination[Count];
     for (int i = 0; i < Count; i++)
     {
         var setting = new ICCDeviceSettingsCombination();
         setting.Load(buffer);
         SetttingCombinations[i] = setting;
     }
 }
예제 #13
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     Count = buffer.ReadUnsignedInt();
     for (int i = 0; i < Count; i++)
     {
         var structure = new ICCProfileDescriptionStructure();
         structure.Load(buffer);
         Structures.Add(structure);
     }
 }
예제 #14
0
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     Count           = buffer.ReadUnsignedInt();
     Description     = System.Text.Encoding.ASCII.GetString(buffer.ReadBytes((int)Count));
     UnicodeCode     = buffer.ReadUnsignedInt();
     UnicodeCount    = buffer.ReadUnsignedInt();
     ScriptcodeCode  = buffer.ReadUnsignedShort();
     ScriptcodeCount = (byte)buffer.ReadByte();
     MacDescription  = System.Text.Encoding.ASCII.GetString(buffer.ReadBytes(67));
 }
예제 #15
0
 public void Load(Bytes.Buffer buffer, ushort numberOfChannels)
 {
     MesurementUnit = (ICCCurveMeasurementEncodings)buffer.ReadUnsignedInt();
     Counts         = new uint[numberOfChannels];
     Measurments    = new ICCXYZNumber[numberOfChannels];
     Responces      = new ICCResponse16Number[numberOfChannels];
     for (int i = 0; i < numberOfChannels; i++)
     {
         Counts[i] = buffer.ReadUnsignedInt();
     }
     for (int i = 0; i < numberOfChannels; i++)
     {
         Measurments[i].Load(buffer);
     }
     for (int i = 0; i < numberOfChannels; i++)
     {
         Responces[i].Load(buffer);
     }
 }
 public override void Load(Bytes.Buffer buffer)
 {
     buffer.Seek(Table.Offset);
     buffer.ReadUnsignedInt();
     buffer.ReadUnsignedInt();
     NumberOfChannels = buffer.ReadUnsignedShort();
     CountTypes       = buffer.ReadUnsignedShort();
     Offsets          = new uint[CountTypes];
     for (int i = 0; i < CountTypes; i++)
     {
         Offsets[i] = buffer.ReadUnsignedInt();
     }
     for (int i = 0; i < CountTypes; i++)
     {
         var structure = new ICCCurveStructure();
         structure.Load(buffer, NumberOfChannels);
         Structures.Add(structure);
     }
 }
예제 #17
0
        public override void Load(Bytes.Buffer buffer)
        {
            buffer.Seek(Table.Offset);
            buffer.ReadUnsignedInt();
            buffer.ReadUnsignedInt();

            CountUCRCurves = buffer.ReadUnsignedInt();
            UCRCurves      = new ushort[CountUCRCurves];
            for (int i = 0; i < CountUCRCurves; i++)
            {
                UCRCurves[i] = buffer.ReadUnsignedShort();
            }

            CountBGCurves = buffer.ReadUnsignedInt();
            BGCurves      = new ushort[CountBGCurves];
            for (int i = 0; i < CountBGCurves; i++)
            {
                BGCurves[i] = buffer.ReadUnsignedShort();
            }

            Charactes = System.Text.Encoding.ASCII.GetString(buffer.ReadNullTermitaded());
        }
예제 #18
0
        public static ICCProfile Load(byte[] data)
        {
            var profile = new ICCProfile();
            var header  = new ICCHeader();
            var buffer  = new Bytes.Buffer(data);

            header.ProfileSize                  = buffer.ReadUnsignedInt();
            header.CMMTypeSignature             = buffer.ReadUnsignedInt();
            header.ProfileVersionNumber.Major   = (byte)buffer.ReadByte();
            header.ProfileVersionNumber.Minor   = (byte)buffer.ReadByte();
            header.ProfileVersionNumber.Reserv1 = (byte)buffer.ReadByte();
            header.ProfileVersionNumber.Reserv2 = (byte)buffer.ReadByte();
            header.ProfileDeviceClassSignature  = (ICCProfileDeviceSignatures)buffer.ReadUnsignedInt();
            header.ColorSpaceOfData             = (ICCColorSpaceSignatures)buffer.ReadUnsignedInt();
            header.ProfileConnectionSpace       = (ICCColorSpaceSignatures)buffer.ReadUnsignedInt();
            header.DateCreated.Load(buffer);
            header.acsp = buffer.ReadUnsignedInt();
            header.PrimaryPlatformSignature = (ICCPrimaryPlatformSignatures)buffer.ReadUnsignedInt();
            header.Flags = (ICCProfileFlags)buffer.ReadUnsignedInt();
            header.DeviceManufacturer = buffer.ReadUnsignedInt();
            header.DeviceModel        = buffer.ReadUnsignedInt();
            header.DeviceAttributes.Load(buffer);
            header.RenderingIntent.Intents  = buffer.ReadUnsignedShort();
            header.RenderingIntent.Reserved = buffer.ReadUnsignedShort();
            header.XYZ.Load(buffer);
            header.ProfileCreatorSignature = buffer.ReadUnsignedInt();
            header.FutureUse = new byte[44];
            buffer.Read(header.FutureUse);
            profile.Header = header;
            var tagCount = buffer.ReadUnsignedInt();

            for (int i = 0; i < tagCount; i++)
            {
                var tag = new ICCTagTable();
                tag.Signature               = (ICCTagTypes)buffer.ReadUnsignedInt();
                tag.Offset                  = buffer.ReadUnsignedInt();
                tag.ElementSize             = buffer.ReadUnsignedInt();
                profile.Tags[tag.Signature] = tag;
            }
            foreach (var tagTable in profile.Tags.Values)
            {
                buffer.Seek(tagTable.Offset);
                var key = buffer.ReadUnsignedInt();
                if (Types.TryGetValue(key, out var type))
                {
                    tagTable.Tag         = (ICCTag)Activator.CreateInstance(type, tagTable);
                    tagTable.Tag.Profile = profile;
                    tagTable.Tag.Load(buffer);
                }
            }
            return(profile);
        }
 public void Load(Bytes.Buffer buffer)
 {
     Value = (ICCDeviceSettingsHalftone)buffer.ReadUnsignedInt();
 }
예제 #20
0
 public void Load(Bytes.Buffer buffer)
 {
     Frequency   = buffer.ReadFixed32();
     ScreenAngle = buffer.ReadFixed32();
     SpotShape   = (ICCScreeningSpotEncodings)buffer.ReadUnsignedInt();
 }
예제 #21
0
 public void Load(Bytes.Buffer buffer)
 {
     Value = (ICCDeviceSettingMediaTypes)buffer.ReadUnsignedInt();
 }