//public MultiLocalizedUnicodeTag(bool isPlaceHolder) //{ // IsPlaceHolder = isPlaceHolder; //} public override void GetTagData(byte[] iccData, int index, ICCHeader header) { if (!IsPlaceHolder) { //Number of records (4 bytes) RecordCount = (int)HighEndianReader.GetUint32(iccData, index, IsLittleEndian); //Record size (has to be 12 as for V4.3) (4 bytes) RecordSize = (int)HighEndianReader.GetUint32(iccData, index + 4, IsLittleEndian); //Records LanguageCode = new string[RecordCount]; CountryCode = new string[RecordCount]; StringLength = new int[RecordCount]; StringOffset = new int[RecordCount]; //int end = idx + 8 + RecordCount * RecordSize; int c = 0; for (int i = 0; i < RecordCount; i++) { int dataEntryPoint = index + 8 + RecordSize * i; LanguageCode[i] = HighEndianReader.GetASCII(iccData, dataEntryPoint, 2); //Country Code (2 bytes) CountryCode[i] = HighEndianReader.GetASCII(iccData, dataEntryPoint + 2, 2); //Record string length (4 bytes) StringLength[i] = (int)HighEndianReader.GetUint32(iccData, dataEntryPoint + 4, IsLittleEndian); //Record offset (4 bytes) StringOffset[i] = (int)HighEndianReader.GetUint32(iccData, dataEntryPoint + 8, IsLittleEndian);; } //The strings Text = new LocalizedString[RecordCount]; for (int i = 0; i < RecordCount; i++) { Text[i] = new LocalizedString(LanguageCode[i], CountryCode[i], iccData, index - 8 + StringOffset[i], StringLength[i]); } } }
public override void GetTagData(byte[] iccData, int index, ICCHeader header) { ColorantCount = HighEndianReader.GetUint32(iccData, index, IsLittleEndian); //Number of the colorant to be printed first ColorantData = new ColorantData[ColorantCount]; for (int i = 0; i < ColorantCount; i++) { //Colorant name (32 bytes) int startIndex = index + 4 + i * 38; string name = HighEndianReader.GetASCII(iccData, startIndex, 32); //PCS values (6 bytes (2 bytes each)) ushort pcs1 = HighEndianReader.GetUInt16(iccData, startIndex + 32, IsLittleEndian); ushort pcs2 = HighEndianReader.GetUInt16(iccData, startIndex + 34, IsLittleEndian); ushort pcs3 = HighEndianReader.GetUInt16(iccData, startIndex + 36, IsLittleEndian); } }
public override void GetTagData(byte[] iccData, int index, ICCHeader header) { VendorSpecFlag = iccData.Get(index, index + 4); //VendorSpecFlag = new byte[] { ICCProfile.DataBytes[idx], ICCProfile.DataBytes[idx + 1], ICCProfile.DataBytes[idx + 2], ICCProfile.DataBytes[idx + 3] }; //Count of named colours (4 bytes) NamedColorCount = (int)HighEndianReader.GetUint32(iccData, index + 4, IsLittleEndian); //Number of device coordinates (4 bytes) DeviceCoordinateCount = (int)HighEndianReader.GetUint32(iccData, index + 8, IsLittleEndian); //Prefix for each colour name Prefix = HighEndianReader.GetASCII(iccData, index + 12, 32); //Suffix for each colour name Suffix = HighEndianReader.GetASCII(iccData, index + 44, 32); //Colors NamedColors = new NamedColor[NamedColorCount]; for (int i = 0; i < NamedColorCount; i++) { int dataEntryIndex = index + 76 + (38 + 2 * DeviceCoordinateCount) * i; NamedColors[i] = new NamedColor(iccData, dataEntryIndex, DeviceCoordinateCount, IsLittleEndian);; } }
public NamedColor(byte[] iccData, int index, int deviceCoordinateCount, bool isLittleEndian) { //Root name (32 bytes) ColorRootName = HighEndianReader.GetASCII(iccData, index, 32); //PCS coordinates (6 bytes) (2 bytes each) PCScoordinates = new ushort[3]; PCScoordinates[0] = HighEndianReader.GetUInt16(iccData, index + 32, isLittleEndian); PCScoordinates[1] = HighEndianReader.GetUInt16(iccData, index + 34, isLittleEndian); PCScoordinates[2] = HighEndianReader.GetUInt16(iccData, index + 36, isLittleEndian); //Device coordinates (2 bytes each) if (deviceCoordinateCount > 0) { DeviceCoordinates = new ushort[deviceCoordinateCount]; for (int i = 0; i < 2 * deviceCoordinateCount; i++) { int dataEntryIndex = index + 38 + i * 2;; DeviceCoordinates[i] = HighEndianReader.GetUInt16(iccData, dataEntryIndex, isLittleEndian); } //int end = (idx + 38) + 2 * deviceCoordinateCount; int c = 0; //for (int i = idx + 38; i < end; i++) { DeviceCoordinates[c] = Helper.GetUInt16(i); c++; } } }
public override void GetTagData(byte[] iccData, int index, ICCHeader header) => SignatureData = HighEndianReader.GetASCII(iccData, index, 4);