internal ProfileDescription(int idx, ICCHeader header) { //Device manufacturer signature (4 bytes) DeviceManufacturer = Helper.GetUInt32(idx); //Device model signature (4 bytes) DeviceModel = Helper.GetUInt32(idx + 4); //Device attributes (8 bytes) DeviceAttributes = new DeviceAttribute(idx + 8); //Device technology information (4 bytes) TechnologyInformation = (TagSignature)Helper.GetUInt32(idx + 16); //Displayable description of device manufacturer (profile's deviceMfgDescTag) DeviceManufacturerInfo = new multiLocalizedUnicodeTagDataEntry(idx + 20, header.DeviceManufacturer == 0 ? true : false); //Displayable description of device model (profile's deviceModelDescTag) DeviceModelInfo = new multiLocalizedUnicodeTagDataEntry(DeviceManufacturerInfo.end, header.DeviceModel == 0 ? true : false); end = DeviceModelInfo.end; }
private void ReadHeader() { try { Header = new ICCHeader((byte[])DataBytes.Clone()); } catch (Exception ex) { throw new CorruptProfileException("Profile is corrupt", ex); } }
private static TagDataEntry GetEntry(TypeSignature type, int idx, ICCHeader header) { switch (type) { case TypeSignature.chromaticity: return new chromaticityTagDataEntry(idx); case TypeSignature.colorantOrder: return new colorantOrderTagDataEntry(idx); case TypeSignature.colorantTable: return new colorantTableTagDataEntry(idx); case TypeSignature.curve: return new curveTagDataEntry(idx); case TypeSignature.data: return new dataTagDataEntry(idx); case TypeSignature.dateTime: return new dateTimeTagDataEntry(idx); case TypeSignature.lut16: return new lut16TagDataEntry(idx); case TypeSignature.lut8: return new lut8TagDataEntry(idx); case TypeSignature.lutAToB: return new lutAToBTagDataEntry(idx); case TypeSignature.lutBToA: return new lutBToATagDataEntry(idx); case TypeSignature.measurement: return new measurementTagDataEntry(idx); case TypeSignature.multiLocalizedUnicode: return new multiLocalizedUnicodeTagDataEntry(idx, false); case TypeSignature.multiProcessElements: return new multiProcessElementsTagDataEntry(idx); case TypeSignature.namedColor2: return new namedColor2TagDataEntry(idx); case TypeSignature.parametricCurve: return new parametricCurveTagDataEntry(idx); case TypeSignature.profileSequenceDesc: return new profileSequenceDescTagDataEntry(idx, header); case TypeSignature.profileSequenceIdentifier: return new profileSequenceIdentifierTagDataEntry(idx); case TypeSignature.responseCurveSet16: return new responseCurveSet16TagDataEntry(idx); case TypeSignature.s15Fixed16Array: return new s15Fixed16ArrayTagDataEntry(idx); case TypeSignature.signature: return new signatureTagDataEntry(idx); case TypeSignature.text: return new textTagDataEntry(idx); case TypeSignature.u16Fixed16Array: return new u16Fixed16ArrayTagDataEntry(idx); case TypeSignature.uInt16Array: return new uInt16ArrayTagDataEntry(idx); case TypeSignature.uInt32Array: return new uInt32ArrayTagDataEntry(idx); case TypeSignature.uInt64Array: return new uInt64ArrayTagDataEntry(idx); case TypeSignature.uInt8Array: return new uInt8ArrayTagDataEntry(idx); case TypeSignature.viewingConditions: return new viewingConditionsTagDataEntry(idx); case TypeSignature.XYZ: return new XYZTagDataEntry(idx); default: return new TagDataEntry(); } }
public static TagDataEntry CreateEntry(TagTableEntry entry, ICCHeader header) { size = (int)entry.DataSize; //Tag signature (byte position 0 to 3) (4 to 7 are zero) TypeSignature t = (TypeSignature)Helper.GetUInt32((int)entry.Offset); return GetEntry(t, (int)entry.Offset + 8, header); }
internal profileSequenceDescTagDataEntry(int idx, ICCHeader header) { //Count value specifying number of description structures in the array (4 bytes) DescriptionCount = (int)Helper.GetUInt32(idx); //Profile description structures Descriptions = new ProfileDescription[DescriptionCount]; int end = idx + 4; for (int i = 0; i < DescriptionCount; i++) { Descriptions[i] = new ProfileDescription(end, header); end = Descriptions[i].end; } }