public static ICCTagData ReadTagData(byte[] iccData, ICCTag tag, ICCHeader header)
        {
            dataSize = tag.Size;
            TypeSignature tagType =
                (TypeSignature)HighEndianReader.GetUint32(iccData, (int)tag.Offset, IsLittleEndian);

            return(ReadTagData(tagType, iccData, (int)tag.Offset + 8, header));
        }
示例#2
0
 public void Read(byte[] iccData)
 {
     TagCount = HighEndianReader.GetUint32(iccData, TagOffset, isLittleEndian);
     Tags     = new List <ICCTag>((int)TagCount);
     for (int i = 0; i < TagCount; i++)
     {
         int    startIndex = TagOffset + 4 + i * 12;
         uint   sig        = HighEndianReader.GetUint32(iccData, startIndex, isLittleEndian);
         uint   offset     = HighEndianReader.GetUint32(iccData, startIndex + 4, isLittleEndian);
         uint   size       = HighEndianReader.GetUint32(iccData, startIndex + 8, isLittleEndian);
         ICCTag tag        = new ICCTag(sig, offset, size);
         Tags.Add(tag);
     }
 }
示例#3
0
        public void Read(byte[] iccProfileBytes)
        {
            bool isLittleEndian = BitConverter.IsLittleEndian;

            ProfileSize          = HighEndianReader.GetUint32(iccProfileBytes, 0, isLittleEndian);
            CMMType              = HighEndianReader.GetASCII(iccProfileBytes, 4, 4);
            ProfileVersionNumber = new DataStruct.VersionNumber(iccProfileBytes[8], iccProfileBytes[9]);
            ProfileClass         =
                (ProfileClassName)HighEndianReader.GetUint32(iccProfileBytes, 12, isLittleEndian);
            DataColorspace =
                (ColorSpaceType)HighEndianReader.GetUint32(iccProfileBytes, 16, isLittleEndian);
            //PCS field (bytes 20 to 23)
            PCS = (ColorSpaceType)HighEndianReader.GetUint32(iccProfileBytes, 20, isLittleEndian);
            //Date and time field (bytes 24 to 35)
            CreationDate = HighEndianReader.GetDateTime(iccProfileBytes, 24, isLittleEndian);
            //Profile file signature field (bytes 36 to 39)
            Magic = HighEndianReader.GetASCII(iccProfileBytes, 36, 4);
            //Primary platform field (bytes 40 to 43)
            PrimaryPlatformSignature =
                (EnumConst.PrimaryPlatformName)
                HighEndianReader.GetUint32(iccProfileBytes, 40, isLittleEndian);
            ProfileFlags = new DataStruct.ProfileFlag(iccProfileBytes[44], iccProfileBytes[44 + 1],
                                                      iccProfileBytes[44 + 2], iccProfileBytes[44 + 3]);
            //Device manufacturer field (bytes 48 to 51)
            DeviceManufacturer =
                (TagSignature)
                HighEndianReader.GetUint32(iccProfileBytes, 48, isLittleEndian);
            //Device model field (bytes 52 to 55)
            DeviceModel =
                (TagSignature)
                HighEndianReader.GetUint32(iccProfileBytes, 52, isLittleEndian);
            //Device attributes field (bytes 56 to 63)
            DeviceAttributes = new DeviceAttribute(iccProfileBytes, 56);
            //Rendering intent field (bytes 64 to 67) (66 and 67 are zero)
            RenderingIntent =
                (EnumConst.RenderingIntentName)
                HighEndianReader.GetUint32(iccProfileBytes, 64, isLittleEndian);
            //PCS illuminant field (Bytes 68 to 79)
            PCSIlluminant = new XYZNumber(iccProfileBytes, 68, isLittleEndian);
            //Profile creator field (bytes 80 to 83)
            ProfileCreatorSignature = HighEndianReader.GetUint32(iccProfileBytes, 80, isLittleEndian);
            //Profile ID field (bytes 84 to 99)
            ProfileID = HighEndianReader.GetString(iccProfileBytes, 84, 16);
        }