Lines Matching refs:Icc
476 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*)hProfile; in cmsGetProfileIOhandler() local
478 if (Icc == NULL) return NULL; in cmsGetProfileIOhandler()
479 return Icc->IOhandler; in cmsGetProfileIOhandler()
494 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) _cmsMallocZero(ContextID, sizeof(_cmsICCPROFILE)); in cmsCreateProfilePlaceholder() local
495 if (Icc == NULL) return NULL; in cmsCreateProfilePlaceholder()
497 Icc ->ContextID = ContextID; in cmsCreateProfilePlaceholder()
500 Icc -> TagCount = 0; in cmsCreateProfilePlaceholder()
503 Icc ->Version = 0x02100000; in cmsCreateProfilePlaceholder()
506 memmove(&Icc ->Created, gmtime(&now), sizeof(Icc ->Created)); in cmsCreateProfilePlaceholder()
509 Icc ->UsrMutex = _cmsCreateMutex(ContextID); in cmsCreateProfilePlaceholder()
512 return (cmsHPROFILE) Icc; in cmsCreateProfilePlaceholder()
517 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetProfileContextID() local
519 if (Icc == NULL) return NULL; in cmsGetProfileContextID()
520 return Icc -> ContextID; in cmsGetProfileContextID()
527 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetTagCount() local
528 if (Icc == NULL) return -1; in cmsGetTagCount()
530 return Icc->TagCount; in cmsGetTagCount()
536 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetTagSignature() local
538 if (n > Icc->TagCount) return (cmsTagSignature) 0; // Mark as not available in cmsGetTagSignature()
541 return Icc ->TagNames[n]; in cmsGetTagSignature()
561 int _cmsSearchTag(_cmsICCPROFILE* Icc, cmsTagSignature sig, cmsBool lFollowLinks) in _cmsSearchTag() argument
569 n = SearchOneTag(Icc, sig); in _cmsSearchTag()
577 LinkedSig = Icc ->TagLinked[n]; in _cmsSearchTag()
600 void _cmsDeleteTagByPos(_cmsICCPROFILE* Icc, int i) in _cmsDeleteTagByPos() argument
602 _cmsAssert(Icc != NULL); in _cmsDeleteTagByPos()
606 if (Icc -> TagPtrs[i] != NULL) { in _cmsDeleteTagByPos()
609 if (Icc ->TagSaveAsRaw[i]) { in _cmsDeleteTagByPos()
610 _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]); in _cmsDeleteTagByPos()
613 cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i]; in _cmsDeleteTagByPos()
618 … LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameter in _cmsDeleteTagByPos()
619 LocalTypeHandler.ICCVersion = Icc ->Version; in _cmsDeleteTagByPos()
620 LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc -> TagPtrs[i]); in _cmsDeleteTagByPos()
621 Icc ->TagPtrs[i] = NULL; in _cmsDeleteTagByPos()
631 cmsBool _cmsNewTag(_cmsICCPROFILE* Icc, cmsTagSignature sig, int* NewPos) in _cmsNewTag() argument
636 i = _cmsSearchTag(Icc, sig, FALSE); in _cmsNewTag()
640 _cmsDeleteTagByPos(Icc, i); in _cmsNewTag()
647 if (Icc -> TagCount >= MAX_TABLE_TAG) { in _cmsNewTag()
648 cmsSignalError(Icc ->ContextID, cmsERROR_RANGE, "Too many tags (%d)", MAX_TABLE_TAG); in _cmsNewTag()
652 *NewPos = Icc ->TagCount; in _cmsNewTag()
653 Icc -> TagCount++; in _cmsNewTag()
663 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) (void*) hProfile; in cmsIsTag() local
664 return _cmsSearchTag(Icc, sig, FALSE) >= 0; in cmsIsTag()
695 cmsBool _cmsReadHeader(_cmsICCPROFILE* Icc) in _cmsReadHeader() argument
701 cmsIOHANDLER* io = Icc ->IOhandler; in _cmsReadHeader()
712 … cmsSignalError(Icc ->ContextID, cmsERROR_BAD_SIGNATURE, "not an ICC profile, invalid signature"); in _cmsReadHeader()
717 Icc -> DeviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Header.deviceClass); in _cmsReadHeader()
718 Icc -> ColorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Header.colorSpace); in _cmsReadHeader()
719 Icc -> PCS = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Header.pcs); in _cmsReadHeader()
721 Icc -> RenderingIntent = _cmsAdjustEndianess32(Header.renderingIntent); in _cmsReadHeader()
722 Icc -> flags = _cmsAdjustEndianess32(Header.flags); in _cmsReadHeader()
723 Icc -> manufacturer = _cmsAdjustEndianess32(Header.manufacturer); in _cmsReadHeader()
724 Icc -> model = _cmsAdjustEndianess32(Header.model); in _cmsReadHeader()
725 Icc -> creator = _cmsAdjustEndianess32(Header.creator); in _cmsReadHeader()
727 _cmsAdjustEndianess64(&Icc -> attributes, &Header.attributes); in _cmsReadHeader()
728 Icc -> Version = _cmsAdjustEndianess32(_validatedVersion(Header.version)); in _cmsReadHeader()
734 if (HeaderSize >= Icc ->IOhandler ->ReportedSize) in _cmsReadHeader()
735 HeaderSize = Icc ->IOhandler ->ReportedSize; in _cmsReadHeader()
739 _cmsDecodeDateTimeNumber(&Header.date, &Icc ->Created); in _cmsReadHeader()
742 memmove(Icc ->ProfileID.ID32, Header.profileID.ID32, 16); in _cmsReadHeader()
749 cmsSignalError(Icc ->ContextID, cmsERROR_RANGE, "Too many tags (%d)", TagCount); in _cmsReadHeader()
755 Icc -> TagCount = 0; in _cmsReadHeader()
767 Icc -> TagNames[Icc ->TagCount] = Tag.sig; in _cmsReadHeader()
768 Icc -> TagOffsets[Icc ->TagCount] = Tag.offset; in _cmsReadHeader()
769 Icc -> TagSizes[Icc ->TagCount] = Tag.size; in _cmsReadHeader()
772 for (j=0; j < Icc ->TagCount; j++) { in _cmsReadHeader()
774 if ((Icc ->TagOffsets[j] == Tag.offset) && in _cmsReadHeader()
775 (Icc ->TagSizes[j] == Tag.size) && in _cmsReadHeader()
776 (Icc ->TagNames[j] == Tag.sig)) { in _cmsReadHeader()
778 Icc ->TagLinked[Icc ->TagCount] = Icc ->TagNames[j]; in _cmsReadHeader()
783 Icc ->TagCount++; in _cmsReadHeader()
790 cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace) in _cmsWriteHeader() argument
799 Header.version = _cmsAdjustEndianess32(Icc ->Version); in _cmsWriteHeader()
801 Header.deviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Icc -> DeviceClass); in _cmsWriteHeader()
802 Header.colorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> ColorSpace); in _cmsWriteHeader()
803 Header.pcs = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> PCS); in _cmsWriteHeader()
806 _cmsEncodeDateTimeNumber(&Header.date, &Icc ->Created); in _cmsWriteHeader()
816 Header.flags = _cmsAdjustEndianess32(Icc -> flags); in _cmsWriteHeader()
817 Header.manufacturer = _cmsAdjustEndianess32(Icc -> manufacturer); in _cmsWriteHeader()
818 Header.model = _cmsAdjustEndianess32(Icc -> model); in _cmsWriteHeader()
820 _cmsAdjustEndianess64(&Header.attributes, &Icc -> attributes); in _cmsWriteHeader()
823 Header.renderingIntent = _cmsAdjustEndianess32(Icc -> RenderingIntent); in _cmsWriteHeader()
836 memmove(&Header.profileID, &Icc ->ProfileID, 16); in _cmsWriteHeader()
839 if (!Icc -> IOhandler->Write(Icc->IOhandler, sizeof(cmsICCHeader), &Header)) return FALSE; in _cmsWriteHeader()
844 for (i=0; i < Icc -> TagCount; i++) { in _cmsWriteHeader()
845 if (Icc ->TagNames[i] != (cmsTagSignature) 0) in _cmsWriteHeader()
850 if (!_cmsWriteUInt32Number(Icc ->IOhandler, Count)) return FALSE; in _cmsWriteHeader()
852 for (i=0; i < Icc -> TagCount; i++) { in _cmsWriteHeader()
854 if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue; // It is just a placeholder in _cmsWriteHeader()
856 Tag.sig = (cmsTagSignature) _cmsAdjustEndianess32((cmsInt32Number) Icc -> TagNames[i]); in _cmsWriteHeader()
857 Tag.offset = _cmsAdjustEndianess32((cmsInt32Number) Icc -> TagOffsets[i]); in _cmsWriteHeader()
858 Tag.size = _cmsAdjustEndianess32((cmsInt32Number) Icc -> TagSizes[i]); in _cmsWriteHeader()
860 if (!Icc ->IOhandler -> Write(Icc-> IOhandler, sizeof(cmsTagEntry), &Tag)) return FALSE; in _cmsWriteHeader()
871 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderRenderingIntent() local
872 return Icc -> RenderingIntent; in cmsGetHeaderRenderingIntent()
877 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderRenderingIntent() local
878 Icc -> RenderingIntent = RenderingIntent; in cmsSetHeaderRenderingIntent()
883 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderFlags() local
884 return (cmsUInt32Number) Icc -> flags; in cmsGetHeaderFlags()
889 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderFlags() local
890 Icc -> flags = (cmsUInt32Number) Flags; in cmsSetHeaderFlags()
895 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderManufacturer() local
896 return Icc ->manufacturer; in cmsGetHeaderManufacturer()
901 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderManufacturer() local
902 Icc -> manufacturer = manufacturer; in cmsSetHeaderManufacturer()
907 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderCreator() local
908 return Icc ->creator; in cmsGetHeaderCreator()
913 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderModel() local
914 return Icc ->model; in cmsGetHeaderModel()
919 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderModel() local
920 Icc -> model = model; in cmsSetHeaderModel()
925 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderAttributes() local
926 memmove(Flags, &Icc -> attributes, sizeof(cmsUInt64Number)); in cmsGetHeaderAttributes()
931 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderAttributes() local
932 memmove(&Icc -> attributes, &Flags, sizeof(cmsUInt64Number)); in cmsSetHeaderAttributes()
937 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderProfileID() local
938 memmove(ProfileID, Icc ->ProfileID.ID8, 16); in cmsGetHeaderProfileID()
943 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderProfileID() local
944 memmove(&Icc -> ProfileID, ProfileID, 16); in cmsSetHeaderProfileID()
949 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderCreationDateTime() local
950 memmove(Dest, &Icc ->Created, sizeof(struct tm)); in cmsGetHeaderCreationDateTime()
956 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetPCS() local
957 return Icc -> PCS; in cmsGetPCS()
962 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetPCS() local
963 Icc -> PCS = pcs; in cmsSetPCS()
968 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetColorSpace() local
969 return Icc -> ColorSpace; in cmsGetColorSpace()
974 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetColorSpace() local
975 Icc -> ColorSpace = sig; in cmsSetColorSpace()
980 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetDeviceClass() local
981 return Icc -> DeviceClass; in cmsGetDeviceClass()
986 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetDeviceClass() local
987 Icc -> DeviceClass = sig; in cmsSetDeviceClass()
992 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetEncodedICCversion() local
993 return Icc -> Version; in cmsGetEncodedICCversion()
998 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetEncodedICCversion() local
999 Icc -> Version = Version; in cmsSetEncodedICCversion()
1025 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetProfileVersion() local
1029 Icc -> Version = BaseToBase((cmsUInt32Number) floor(Version * 100.0 + 0.5), 10, 16) << 16; in cmsSetProfileVersion()
1034 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetProfileVersion() local
1035 cmsUInt32Number n = Icc -> Version >> 16; in cmsGetProfileVersion()
1189 cmsBool SaveTags(_cmsICCPROFILE* Icc, _cmsICCPROFILE* FileOrig) in SaveTags() argument
1194 cmsIOHANDLER* io = Icc ->IOhandler; in SaveTags()
1199 cmsFloat64Number Version = cmsGetProfileVersion((cmsHPROFILE) Icc); in SaveTags()
1202 for (i=0; i < Icc -> TagCount; i++) { in SaveTags()
1204 if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue; in SaveTags()
1207 if (Icc ->TagLinked[i] != (cmsTagSignature) 0) continue; in SaveTags()
1209 Icc -> TagOffsets[i] = Begin = io ->UsedSpace; in SaveTags()
1211 Data = (cmsUInt8Number*) Icc -> TagPtrs[i]; in SaveTags()
1217 if (FileOrig != NULL && Icc -> TagOffsets[i]) { in SaveTags()
1225 Mem = _cmsMalloc(Icc ->ContextID, TagSize); in SaveTags()
1230 _cmsFree(Icc ->ContextID, Mem); in SaveTags()
1232 Icc -> TagSizes[i] = (io ->UsedSpace - Begin); in SaveTags()
1245 if (Icc ->TagSaveAsRaw[i]) { in SaveTags()
1247 if (io -> Write(io, Icc ->TagSizes[i], Data) != 1) return FALSE; in SaveTags()
1252 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, Icc -> TagNames[i]); in SaveTags()
1264 TypeHandler = _cmsGetTagTypeHandler(Icc->ContextID, Type); in SaveTags()
1267 …cmsSignalError(Icc ->ContextID, cmsERROR_INTERNAL, "(Internal) no handler for tag %x", Icc -> TagN… in SaveTags()
1276 LocalTypeHandler.ContextID = Icc ->ContextID; in SaveTags()
1277 LocalTypeHandler.ICCVersion = Icc ->Version; in SaveTags()
1283 cmsSignalError(Icc ->ContextID, cmsERROR_WRITE, "Couldn't write type '%s'", String); in SaveTags()
1289 Icc -> TagSizes[i] = (io ->UsedSpace - Begin); in SaveTags()
1303 cmsBool SetLinks( _cmsICCPROFILE* Icc) in SetLinks() argument
1307 for (i=0; i < Icc -> TagCount; i++) { in SetLinks()
1309 cmsTagSignature lnk = Icc ->TagLinked[i]; in SetLinks()
1312 int j = _cmsSearchTag(Icc, lnk, FALSE); in SetLinks()
1315 Icc ->TagOffsets[i] = Icc ->TagOffsets[j]; in SetLinks()
1316 Icc ->TagSizes[i] = Icc ->TagSizes[j]; in SetLinks()
1330 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSaveProfileToIOhandler() local
1338 if (!_cmsLockMutex(Icc->ContextID, Icc->UsrMutex)) return 0; in cmsSaveProfileToIOhandler()
1339 memmove(&Keep, Icc, sizeof(_cmsICCPROFILE)); in cmsSaveProfileToIOhandler()
1342 PrevIO = Icc ->IOhandler = cmsOpenIOhandlerFromNULL(ContextID); in cmsSaveProfileToIOhandler()
1344 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex); in cmsSaveProfileToIOhandler()
1350 if (!_cmsWriteHeader(Icc, 0)) goto Error; in cmsSaveProfileToIOhandler()
1351 if (!SaveTags(Icc, &Keep)) goto Error; in cmsSaveProfileToIOhandler()
1359 Icc ->IOhandler = io; in cmsSaveProfileToIOhandler()
1360 if (!SetLinks(Icc)) goto Error; in cmsSaveProfileToIOhandler()
1361 if (!_cmsWriteHeader(Icc, UsedSpace)) goto Error; in cmsSaveProfileToIOhandler()
1362 if (!SaveTags(Icc, &Keep)) goto Error; in cmsSaveProfileToIOhandler()
1365 memmove(Icc, &Keep, sizeof(_cmsICCPROFILE)); in cmsSaveProfileToIOhandler()
1369 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex); in cmsSaveProfileToIOhandler()
1376 memmove(Icc, &Keep, sizeof(_cmsICCPROFILE)); in cmsSaveProfileToIOhandler()
1377 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex); in cmsSaveProfileToIOhandler()
1454 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsCloseProfile() local
1458 if (!Icc) return FALSE; in cmsCloseProfile()
1461 if (Icc ->IsWrite) { in cmsCloseProfile()
1463 Icc ->IsWrite = FALSE; // Assure no further writting in cmsCloseProfile()
1464 rc &= cmsSaveProfileToFile(hProfile, Icc ->IOhandler->PhysicalFile); in cmsCloseProfile()
1467 for (i=0; i < Icc -> TagCount; i++) { in cmsCloseProfile()
1469 if (Icc -> TagPtrs[i]) { in cmsCloseProfile()
1471 cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i]; in cmsCloseProfile()
1476 … LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameters in cmsCloseProfile()
1477 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsCloseProfile()
1478 LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc -> TagPtrs[i]); in cmsCloseProfile()
1481 _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]); in cmsCloseProfile()
1485 if (Icc ->IOhandler != NULL) { in cmsCloseProfile()
1486 rc &= cmsCloseIOhandler(Icc->IOhandler); in cmsCloseProfile()
1489 _cmsDestroyMutex(Icc->ContextID, Icc->UsrMutex); in cmsCloseProfile()
1491 _cmsFree(Icc ->ContextID, Icc); // Free placeholder memory in cmsCloseProfile()
1521 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsReadTag() local
1522 cmsIOHANDLER* io = Icc ->IOhandler; in cmsReadTag()
1531 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return NULL; in cmsReadTag()
1533 n = _cmsSearchTag(Icc, sig, TRUE); in cmsReadTag()
1538 if (Icc -> TagPtrs[n]) { in cmsReadTag()
1540 if (Icc->TagTypeHandlers[n] == NULL) goto Error; in cmsReadTag()
1543 BaseType = Icc->TagTypeHandlers[n]->Signature; in cmsReadTag()
1546 TagDescriptor = _cmsGetTagDescriptor(Icc->ContextID, sig); in cmsReadTag()
1551 if (Icc ->TagSaveAsRaw[n]) goto Error; // We don't support read raw tags as cooked in cmsReadTag()
1553 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadTag()
1554 return Icc -> TagPtrs[n]; in cmsReadTag()
1558 Offset = Icc -> TagOffsets[n]; in cmsReadTag()
1559 TagSize = Icc -> TagSizes[n]; in cmsReadTag()
1566 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig); in cmsReadTag()
1574 …cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown tag type '%s' found.", String… in cmsReadTag()
1587 TypeHandler = _cmsGetTagTypeHandler(Icc ->ContextID, BaseType); in cmsReadTag()
1593 Icc -> TagTypeHandlers[n] = TypeHandler; in cmsReadTag()
1595 LocalTypeHandler.ContextID = Icc ->ContextID; in cmsReadTag()
1596 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsReadTag()
1597 Icc -> TagPtrs[n] = LocalTypeHandler.ReadPtr(&LocalTypeHandler, io, &ElemCount, TagSize); in cmsReadTag()
1601 if (Icc -> TagPtrs[n] == NULL) { in cmsReadTag()
1606 cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "Corrupted tag '%s'", String); in cmsReadTag()
1617 …cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "'%s' Inconsistent number of items: … in cmsReadTag()
1623 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadTag()
1624 return Icc -> TagPtrs[n]; in cmsReadTag()
1629 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadTag()
1637 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in _cmsGetTagTrueType() local
1642 n = _cmsSearchTag(Icc, sig, TRUE); in _cmsGetTagTrueType()
1646 TypeHandler = Icc -> TagTypeHandlers[n]; in _cmsGetTagTrueType()
1655 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsWriteTag() local
1664 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE; in cmsWriteTag()
1670 i = _cmsSearchTag(Icc, sig, FALSE); in cmsWriteTag()
1674 _cmsDeleteTagByPos(Icc, i); in cmsWriteTag()
1675 Icc ->TagNames[i] = (cmsTagSignature) 0; in cmsWriteTag()
1676 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteTag()
1683 if (!_cmsNewTag(Icc, sig, &i)) goto Error; in cmsWriteTag()
1686 Icc ->TagSaveAsRaw[i] = FALSE; in cmsWriteTag()
1689 Icc ->TagLinked[i] = (cmsTagSignature) 0; in cmsWriteTag()
1692 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig); in cmsWriteTag()
1694 cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported tag '%x'", sig); in cmsWriteTag()
1722 …cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", … in cmsWriteTag()
1727 TypeHandler = _cmsGetTagTypeHandler(Icc->ContextID, Type); in cmsWriteTag()
1733 …cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", … in cmsWriteTag()
1739 Icc ->TagTypeHandlers[i] = TypeHandler; in cmsWriteTag()
1740 Icc ->TagNames[i] = sig; in cmsWriteTag()
1741 Icc ->TagSizes[i] = 0; in cmsWriteTag()
1742 Icc ->TagOffsets[i] = 0; in cmsWriteTag()
1745 LocalTypeHandler.ContextID = Icc ->ContextID; in cmsWriteTag()
1746 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsWriteTag()
1747 …Icc ->TagPtrs[i] = LocalTypeHandler.DupPtr(&LocalTypeHandler, data, TagDescriptor ->Ele… in cmsWriteTag()
1749 if (Icc ->TagPtrs[i] == NULL) { in cmsWriteTag()
1753 …cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "Malformed struct in type '%s' for t… in cmsWriteTag()
1758 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteTag()
1762 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteTag()
1775 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsReadRawTag() local
1785 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0; in cmsReadRawTag()
1788 i = _cmsSearchTag(Icc, sig, TRUE); in cmsReadRawTag()
1792 if (Icc -> TagPtrs[i] == NULL) { in cmsReadRawTag()
1795 Offset = Icc ->TagOffsets[i]; in cmsReadRawTag()
1796 TagSize = Icc ->TagSizes[i]; in cmsReadRawTag()
1804 if (!Icc ->IOhandler ->Seek(Icc ->IOhandler, Offset)) goto Error; in cmsReadRawTag()
1805 if (!Icc ->IOhandler ->Read(Icc ->IOhandler, data, 1, TagSize)) goto Error; in cmsReadRawTag()
1807 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1811 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1812 return Icc ->TagSizes[i]; in cmsReadRawTag()
1817 if (Icc ->TagSaveAsRaw[i]) { in cmsReadRawTag()
1821 TagSize = Icc ->TagSizes[i]; in cmsReadRawTag()
1825 memmove(data, Icc ->TagPtrs[i], TagSize); in cmsReadRawTag()
1827 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1831 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1832 return Icc ->TagSizes[i]; in cmsReadRawTag()
1838 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1840 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0; in cmsReadRawTag()
1854 TypeHandler = Icc ->TagTypeHandlers[i]; in cmsReadRawTag()
1855 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig); in cmsReadRawTag()
1865 LocalTypeHandler.ContextID = Icc ->ContextID; in cmsReadRawTag()
1866 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsReadRawTag()
1882 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1886 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1896 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsWriteRawTag() local
1899 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0; in cmsWriteRawTag()
1901 if (!_cmsNewTag(Icc, sig, &i)) { in cmsWriteRawTag()
1902 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteRawTag()
1907 Icc ->TagSaveAsRaw[i] = TRUE; in cmsWriteRawTag()
1908 Icc ->TagNames[i] = sig; in cmsWriteRawTag()
1909 Icc ->TagLinked[i] = (cmsTagSignature) 0; in cmsWriteRawTag()
1912 Icc ->TagPtrs[i] = _cmsDupMem(Icc ->ContextID, data, Size); in cmsWriteRawTag()
1913 Icc ->TagSizes[i] = Size; in cmsWriteRawTag()
1915 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteRawTag()
1917 if (Icc->TagPtrs[i] == NULL) { in cmsWriteRawTag()
1918 Icc->TagNames[i] = (cmsTagSignature) 0; in cmsWriteRawTag()
1927 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsLinkTag() local
1930 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE; in cmsLinkTag()
1932 if (!_cmsNewTag(Icc, sig, &i)) { in cmsLinkTag()
1933 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsLinkTag()
1938 Icc ->TagSaveAsRaw[i] = FALSE; in cmsLinkTag()
1939 Icc ->TagNames[i] = sig; in cmsLinkTag()
1940 Icc ->TagLinked[i] = dest; in cmsLinkTag()
1942 Icc ->TagPtrs[i] = NULL; in cmsLinkTag()
1943 Icc ->TagSizes[i] = 0; in cmsLinkTag()
1944 Icc ->TagOffsets[i] = 0; in cmsLinkTag()
1946 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsLinkTag()
1954 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsTagLinkedTo() local
1958 i = _cmsSearchTag(Icc, sig, FALSE); in cmsTagLinkedTo()
1961 return Icc -> TagLinked[i]; in cmsTagLinkedTo()