Lines Matching refs:Icc
482 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*)hProfile; in cmsGetProfileIOhandler() local
484 if (Icc == NULL) return NULL; in cmsGetProfileIOhandler()
485 return Icc->IOhandler; in cmsGetProfileIOhandler()
500 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) _cmsMallocZero(ContextID, sizeof(_cmsICCPROFILE)); in cmsCreateProfilePlaceholder() local
501 if (Icc == NULL) return NULL; in cmsCreateProfilePlaceholder()
503 Icc ->ContextID = ContextID; in cmsCreateProfilePlaceholder()
506 Icc -> TagCount = 0; in cmsCreateProfilePlaceholder()
509 Icc ->Version = 0x02100000; in cmsCreateProfilePlaceholder()
512 memmove(&Icc ->Created, gmtime(&now), sizeof(Icc ->Created)); in cmsCreateProfilePlaceholder()
515 Icc ->UsrMutex = _cmsCreateMutex(ContextID); in cmsCreateProfilePlaceholder()
518 return (cmsHPROFILE) Icc; in cmsCreateProfilePlaceholder()
523 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetProfileContextID() local
525 if (Icc == NULL) return NULL; in cmsGetProfileContextID()
526 return Icc -> ContextID; in cmsGetProfileContextID()
533 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetTagCount() local
534 if (Icc == NULL) return -1; in cmsGetTagCount()
536 return (cmsInt32Number) Icc->TagCount; in cmsGetTagCount()
542 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetTagSignature() local
544 if (n > Icc->TagCount) return (cmsTagSignature) 0; // Mark as not available in cmsGetTagSignature()
547 return Icc ->TagNames[n]; in cmsGetTagSignature()
567 int _cmsSearchTag(_cmsICCPROFILE* Icc, cmsTagSignature sig, cmsBool lFollowLinks) in _cmsSearchTag() argument
575 n = SearchOneTag(Icc, sig); in _cmsSearchTag()
583 LinkedSig = Icc ->TagLinked[n]; in _cmsSearchTag()
606 void _cmsDeleteTagByPos(_cmsICCPROFILE* Icc, int i) in _cmsDeleteTagByPos() argument
608 _cmsAssert(Icc != NULL); in _cmsDeleteTagByPos()
612 if (Icc -> TagPtrs[i] != NULL) { in _cmsDeleteTagByPos()
615 if (Icc ->TagSaveAsRaw[i]) { in _cmsDeleteTagByPos()
616 _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]); in _cmsDeleteTagByPos()
619 cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i]; in _cmsDeleteTagByPos()
624 … LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameter in _cmsDeleteTagByPos()
625 LocalTypeHandler.ICCVersion = Icc ->Version; in _cmsDeleteTagByPos()
626 LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc -> TagPtrs[i]); in _cmsDeleteTagByPos()
627 Icc ->TagPtrs[i] = NULL; in _cmsDeleteTagByPos()
637 cmsBool _cmsNewTag(_cmsICCPROFILE* Icc, cmsTagSignature sig, int* NewPos) in _cmsNewTag() argument
642 i = _cmsSearchTag(Icc, sig, FALSE); in _cmsNewTag()
646 _cmsDeleteTagByPos(Icc, i); in _cmsNewTag()
653 if (Icc -> TagCount >= MAX_TABLE_TAG) { in _cmsNewTag()
654 cmsSignalError(Icc ->ContextID, cmsERROR_RANGE, "Too many tags (%d)", MAX_TABLE_TAG); in _cmsNewTag()
658 *NewPos = (int) Icc ->TagCount; in _cmsNewTag()
659 Icc -> TagCount++; in _cmsNewTag()
669 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) (void*) hProfile; in cmsIsTag() local
670 return _cmsSearchTag(Icc, sig, FALSE) >= 0; in cmsIsTag()
701 cmsBool _cmsReadHeader(_cmsICCPROFILE* Icc) in _cmsReadHeader() argument
707 cmsIOHANDLER* io = Icc ->IOhandler; in _cmsReadHeader()
718 … cmsSignalError(Icc ->ContextID, cmsERROR_BAD_SIGNATURE, "not an ICC profile, invalid signature"); in _cmsReadHeader()
723 Icc -> DeviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Header.deviceClass); in _cmsReadHeader()
724 Icc -> ColorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Header.colorSpace); in _cmsReadHeader()
725 Icc -> PCS = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Header.pcs); in _cmsReadHeader()
727 Icc -> RenderingIntent = _cmsAdjustEndianess32(Header.renderingIntent); in _cmsReadHeader()
728 Icc -> flags = _cmsAdjustEndianess32(Header.flags); in _cmsReadHeader()
729 Icc -> manufacturer = _cmsAdjustEndianess32(Header.manufacturer); in _cmsReadHeader()
730 Icc -> model = _cmsAdjustEndianess32(Header.model); in _cmsReadHeader()
731 Icc -> creator = _cmsAdjustEndianess32(Header.creator); in _cmsReadHeader()
733 _cmsAdjustEndianess64(&Icc -> attributes, &Header.attributes); in _cmsReadHeader()
734 Icc -> Version = _cmsAdjustEndianess32(_validatedVersion(Header.version)); in _cmsReadHeader()
740 if (HeaderSize >= Icc ->IOhandler ->ReportedSize) in _cmsReadHeader()
741 HeaderSize = Icc ->IOhandler ->ReportedSize; in _cmsReadHeader()
745 _cmsDecodeDateTimeNumber(&Header.date, &Icc ->Created); in _cmsReadHeader()
748 memmove(Icc ->ProfileID.ID32, Header.profileID.ID32, 16); in _cmsReadHeader()
755 cmsSignalError(Icc ->ContextID, cmsERROR_RANGE, "Too many tags (%d)", TagCount); in _cmsReadHeader()
761 Icc -> TagCount = 0; in _cmsReadHeader()
773 Icc -> TagNames[Icc ->TagCount] = Tag.sig; in _cmsReadHeader()
774 Icc -> TagOffsets[Icc ->TagCount] = Tag.offset; in _cmsReadHeader()
775 Icc -> TagSizes[Icc ->TagCount] = Tag.size; in _cmsReadHeader()
778 for (j=0; j < Icc ->TagCount; j++) { in _cmsReadHeader()
780 if ((Icc ->TagOffsets[j] == Tag.offset) && in _cmsReadHeader()
781 (Icc ->TagSizes[j] == Tag.size) && in _cmsReadHeader()
782 (Icc ->TagNames[j] == Tag.sig)) { in _cmsReadHeader()
784 Icc ->TagLinked[Icc ->TagCount] = Icc ->TagNames[j]; in _cmsReadHeader()
789 Icc ->TagCount++; in _cmsReadHeader()
796 cmsBool _cmsWriteHeader(_cmsICCPROFILE* Icc, cmsUInt32Number UsedSpace) in _cmsWriteHeader() argument
805 Header.version = _cmsAdjustEndianess32(Icc ->Version); in _cmsWriteHeader()
807 Header.deviceClass = (cmsProfileClassSignature) _cmsAdjustEndianess32(Icc -> DeviceClass); in _cmsWriteHeader()
808 Header.colorSpace = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> ColorSpace); in _cmsWriteHeader()
809 Header.pcs = (cmsColorSpaceSignature) _cmsAdjustEndianess32(Icc -> PCS); in _cmsWriteHeader()
812 _cmsEncodeDateTimeNumber(&Header.date, &Icc ->Created); in _cmsWriteHeader()
822 Header.flags = _cmsAdjustEndianess32(Icc -> flags); in _cmsWriteHeader()
823 Header.manufacturer = _cmsAdjustEndianess32(Icc -> manufacturer); in _cmsWriteHeader()
824 Header.model = _cmsAdjustEndianess32(Icc -> model); in _cmsWriteHeader()
826 _cmsAdjustEndianess64(&Header.attributes, &Icc -> attributes); in _cmsWriteHeader()
829 Header.renderingIntent = _cmsAdjustEndianess32(Icc -> RenderingIntent); in _cmsWriteHeader()
842 memmove(&Header.profileID, &Icc ->ProfileID, 16); in _cmsWriteHeader()
845 if (!Icc -> IOhandler->Write(Icc->IOhandler, sizeof(cmsICCHeader), &Header)) return FALSE; in _cmsWriteHeader()
851 for (i=0; i < Icc -> TagCount; i++) { in _cmsWriteHeader()
852 if (Icc ->TagNames[i] != (cmsTagSignature) 0) in _cmsWriteHeader()
857 if (!_cmsWriteUInt32Number(Icc ->IOhandler, Count)) return FALSE; in _cmsWriteHeader()
859 for (i=0; i < Icc -> TagCount; i++) { in _cmsWriteHeader()
861 if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue; // It is just a placeholder in _cmsWriteHeader()
863 Tag.sig = (cmsTagSignature) _cmsAdjustEndianess32((cmsUInt32Number) Icc -> TagNames[i]); in _cmsWriteHeader()
864 Tag.offset = _cmsAdjustEndianess32((cmsUInt32Number) Icc -> TagOffsets[i]); in _cmsWriteHeader()
865 Tag.size = _cmsAdjustEndianess32((cmsUInt32Number) Icc -> TagSizes[i]); in _cmsWriteHeader()
867 if (!Icc ->IOhandler -> Write(Icc-> IOhandler, sizeof(cmsTagEntry), &Tag)) return FALSE; in _cmsWriteHeader()
878 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderRenderingIntent() local
879 return Icc -> RenderingIntent; in cmsGetHeaderRenderingIntent()
884 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderRenderingIntent() local
885 Icc -> RenderingIntent = RenderingIntent; in cmsSetHeaderRenderingIntent()
890 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderFlags() local
891 return (cmsUInt32Number) Icc -> flags; in cmsGetHeaderFlags()
896 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderFlags() local
897 Icc -> flags = (cmsUInt32Number) Flags; in cmsSetHeaderFlags()
902 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderManufacturer() local
903 return Icc ->manufacturer; in cmsGetHeaderManufacturer()
908 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderManufacturer() local
909 Icc -> manufacturer = manufacturer; in cmsSetHeaderManufacturer()
914 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderCreator() local
915 return Icc ->creator; in cmsGetHeaderCreator()
920 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderModel() local
921 return Icc ->model; in cmsGetHeaderModel()
926 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderModel() local
927 Icc -> model = model; in cmsSetHeaderModel()
932 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderAttributes() local
933 memmove(Flags, &Icc -> attributes, sizeof(cmsUInt64Number)); in cmsGetHeaderAttributes()
938 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderAttributes() local
939 memmove(&Icc -> attributes, &Flags, sizeof(cmsUInt64Number)); in cmsSetHeaderAttributes()
944 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderProfileID() local
945 memmove(ProfileID, Icc ->ProfileID.ID8, 16); in cmsGetHeaderProfileID()
950 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetHeaderProfileID() local
951 memmove(&Icc -> ProfileID, ProfileID, 16); in cmsSetHeaderProfileID()
956 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetHeaderCreationDateTime() local
957 memmove(Dest, &Icc ->Created, sizeof(struct tm)); in cmsGetHeaderCreationDateTime()
963 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetPCS() local
964 return Icc -> PCS; in cmsGetPCS()
969 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetPCS() local
970 Icc -> PCS = pcs; in cmsSetPCS()
975 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetColorSpace() local
976 return Icc -> ColorSpace; in cmsGetColorSpace()
981 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetColorSpace() local
982 Icc -> ColorSpace = sig; in cmsSetColorSpace()
987 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetDeviceClass() local
988 return Icc -> DeviceClass; in cmsGetDeviceClass()
993 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetDeviceClass() local
994 Icc -> DeviceClass = sig; in cmsSetDeviceClass()
999 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetEncodedICCversion() local
1000 return Icc -> Version; in cmsGetEncodedICCversion()
1005 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetEncodedICCversion() local
1006 Icc -> Version = Version; in cmsSetEncodedICCversion()
1032 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSetProfileVersion() local
1036 Icc -> Version = BaseToBase((cmsUInt32Number) floor(Version * 100.0 + 0.5), 10, 16) << 16; in cmsSetProfileVersion()
1041 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsGetProfileVersion() local
1042 cmsUInt32Number n = Icc -> Version >> 16; in cmsGetProfileVersion()
1196 cmsBool SaveTags(_cmsICCPROFILE* Icc, _cmsICCPROFILE* FileOrig) in SaveTags() argument
1201 cmsIOHANDLER* io = Icc ->IOhandler; in SaveTags()
1206 cmsFloat64Number Version = cmsGetProfileVersion((cmsHPROFILE) Icc); in SaveTags()
1209 for (i=0; i < Icc -> TagCount; i++) { in SaveTags()
1211 if (Icc ->TagNames[i] == (cmsTagSignature) 0) continue; in SaveTags()
1214 if (Icc ->TagLinked[i] != (cmsTagSignature) 0) continue; in SaveTags()
1216 Icc -> TagOffsets[i] = Begin = io ->UsedSpace; in SaveTags()
1218 Data = (cmsUInt8Number*) Icc -> TagPtrs[i]; in SaveTags()
1224 if (FileOrig != NULL && Icc -> TagOffsets[i]) { in SaveTags()
1232 Mem = _cmsMalloc(Icc ->ContextID, TagSize); in SaveTags()
1237 _cmsFree(Icc ->ContextID, Mem); in SaveTags()
1239 Icc -> TagSizes[i] = (io ->UsedSpace - Begin); in SaveTags()
1252 if (Icc ->TagSaveAsRaw[i]) { in SaveTags()
1254 if (io -> Write(io, Icc ->TagSizes[i], Data) != 1) return FALSE; in SaveTags()
1259 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, Icc -> TagNames[i]); in SaveTags()
1271 TypeHandler = _cmsGetTagTypeHandler(Icc->ContextID, Type); in SaveTags()
1274 …cmsSignalError(Icc ->ContextID, cmsERROR_INTERNAL, "(Internal) no handler for tag %x", Icc -> TagN… in SaveTags()
1283 LocalTypeHandler.ContextID = Icc ->ContextID; in SaveTags()
1284 LocalTypeHandler.ICCVersion = Icc ->Version; in SaveTags()
1290 cmsSignalError(Icc ->ContextID, cmsERROR_WRITE, "Couldn't write type '%s'", String); in SaveTags()
1296 Icc -> TagSizes[i] = (io ->UsedSpace - Begin); in SaveTags()
1310 cmsBool SetLinks( _cmsICCPROFILE* Icc) in SetLinks() argument
1314 for (i=0; i < Icc -> TagCount; i++) { in SetLinks()
1316 cmsTagSignature lnk = Icc ->TagLinked[i]; in SetLinks()
1319 int j = _cmsSearchTag(Icc, lnk, FALSE); in SetLinks()
1322 Icc ->TagOffsets[i] = Icc ->TagOffsets[j]; in SetLinks()
1323 Icc ->TagSizes[i] = Icc ->TagSizes[j]; in SetLinks()
1337 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsSaveProfileToIOhandler() local
1345 if (!_cmsLockMutex(Icc->ContextID, Icc->UsrMutex)) return 0; in cmsSaveProfileToIOhandler()
1346 memmove(&Keep, Icc, sizeof(_cmsICCPROFILE)); in cmsSaveProfileToIOhandler()
1349 PrevIO = Icc ->IOhandler = cmsOpenIOhandlerFromNULL(ContextID); in cmsSaveProfileToIOhandler()
1351 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex); in cmsSaveProfileToIOhandler()
1357 if (!_cmsWriteHeader(Icc, 0)) goto Error; in cmsSaveProfileToIOhandler()
1358 if (!SaveTags(Icc, &Keep)) goto Error; in cmsSaveProfileToIOhandler()
1366 Icc ->IOhandler = io; in cmsSaveProfileToIOhandler()
1367 if (!SetLinks(Icc)) goto Error; in cmsSaveProfileToIOhandler()
1368 if (!_cmsWriteHeader(Icc, UsedSpace)) goto Error; in cmsSaveProfileToIOhandler()
1369 if (!SaveTags(Icc, &Keep)) goto Error; in cmsSaveProfileToIOhandler()
1372 memmove(Icc, &Keep, sizeof(_cmsICCPROFILE)); in cmsSaveProfileToIOhandler()
1376 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex); in cmsSaveProfileToIOhandler()
1383 memmove(Icc, &Keep, sizeof(_cmsICCPROFILE)); in cmsSaveProfileToIOhandler()
1384 _cmsUnlockMutex(Icc->ContextID, Icc->UsrMutex); in cmsSaveProfileToIOhandler()
1461 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsCloseProfile() local
1465 if (!Icc) return FALSE; in cmsCloseProfile()
1468 if (Icc ->IsWrite) { in cmsCloseProfile()
1470 Icc ->IsWrite = FALSE; // Assure no further writing in cmsCloseProfile()
1471 rc &= cmsSaveProfileToFile(hProfile, Icc ->IOhandler->PhysicalFile); in cmsCloseProfile()
1474 for (i=0; i < Icc -> TagCount; i++) { in cmsCloseProfile()
1476 if (Icc -> TagPtrs[i]) { in cmsCloseProfile()
1478 cmsTagTypeHandler* TypeHandler = Icc ->TagTypeHandlers[i]; in cmsCloseProfile()
1483 … LocalTypeHandler.ContextID = Icc ->ContextID; // As an additional parameters in cmsCloseProfile()
1484 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsCloseProfile()
1485 LocalTypeHandler.FreePtr(&LocalTypeHandler, Icc -> TagPtrs[i]); in cmsCloseProfile()
1488 _cmsFree(Icc ->ContextID, Icc ->TagPtrs[i]); in cmsCloseProfile()
1492 if (Icc ->IOhandler != NULL) { in cmsCloseProfile()
1493 rc &= cmsCloseIOhandler(Icc->IOhandler); in cmsCloseProfile()
1496 _cmsDestroyMutex(Icc->ContextID, Icc->UsrMutex); in cmsCloseProfile()
1498 _cmsFree(Icc ->ContextID, Icc); // Free placeholder memory in cmsCloseProfile()
1528 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsReadTag() local
1529 cmsIOHANDLER* io = Icc ->IOhandler; in cmsReadTag()
1538 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return NULL; in cmsReadTag()
1540 n = _cmsSearchTag(Icc, sig, TRUE); in cmsReadTag()
1545 if (Icc -> TagPtrs[n]) { in cmsReadTag()
1547 if (Icc->TagTypeHandlers[n] == NULL) goto Error; in cmsReadTag()
1550 BaseType = Icc->TagTypeHandlers[n]->Signature; in cmsReadTag()
1553 TagDescriptor = _cmsGetTagDescriptor(Icc->ContextID, sig); in cmsReadTag()
1558 if (Icc ->TagSaveAsRaw[n]) goto Error; // We don't support read raw tags as cooked in cmsReadTag()
1560 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadTag()
1561 return Icc -> TagPtrs[n]; in cmsReadTag()
1565 Offset = Icc -> TagOffsets[n]; in cmsReadTag()
1566 TagSize = Icc -> TagSizes[n]; in cmsReadTag()
1575 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig); in cmsReadTag()
1583 …cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unknown tag type '%s' found.", String… in cmsReadTag()
1596 TypeHandler = _cmsGetTagTypeHandler(Icc ->ContextID, BaseType); in cmsReadTag()
1602 Icc -> TagTypeHandlers[n] = TypeHandler; in cmsReadTag()
1604 LocalTypeHandler.ContextID = Icc ->ContextID; in cmsReadTag()
1605 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsReadTag()
1606 Icc -> TagPtrs[n] = LocalTypeHandler.ReadPtr(&LocalTypeHandler, io, &ElemCount, TagSize); in cmsReadTag()
1610 if (Icc -> TagPtrs[n] == NULL) { in cmsReadTag()
1615 cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "Corrupted tag '%s'", String); in cmsReadTag()
1626 …cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "'%s' Inconsistent number of items: … in cmsReadTag()
1633 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadTag()
1634 return Icc -> TagPtrs[n]; in cmsReadTag()
1639 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadTag()
1647 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in _cmsGetTagTrueType() local
1652 n = _cmsSearchTag(Icc, sig, TRUE); in _cmsGetTagTrueType()
1656 TypeHandler = Icc -> TagTypeHandlers[n]; in _cmsGetTagTrueType()
1665 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsWriteTag() local
1674 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE; in cmsWriteTag()
1680 i = _cmsSearchTag(Icc, sig, FALSE); in cmsWriteTag()
1684 _cmsDeleteTagByPos(Icc, i); in cmsWriteTag()
1685 Icc ->TagNames[i] = (cmsTagSignature) 0; in cmsWriteTag()
1686 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteTag()
1693 if (!_cmsNewTag(Icc, sig, &i)) goto Error; in cmsWriteTag()
1696 Icc ->TagSaveAsRaw[i] = FALSE; in cmsWriteTag()
1699 Icc ->TagLinked[i] = (cmsTagSignature) 0; in cmsWriteTag()
1702 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig); in cmsWriteTag()
1704 cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported tag '%x'", sig); in cmsWriteTag()
1732 …cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", … in cmsWriteTag()
1737 TypeHandler = _cmsGetTagTypeHandler(Icc->ContextID, Type); in cmsWriteTag()
1743 …cmsSignalError(Icc ->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported type '%s' for tag '%s'", … in cmsWriteTag()
1749 Icc ->TagTypeHandlers[i] = TypeHandler; in cmsWriteTag()
1750 Icc ->TagNames[i] = sig; in cmsWriteTag()
1751 Icc ->TagSizes[i] = 0; in cmsWriteTag()
1752 Icc ->TagOffsets[i] = 0; in cmsWriteTag()
1755 LocalTypeHandler.ContextID = Icc ->ContextID; in cmsWriteTag()
1756 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsWriteTag()
1757 …Icc ->TagPtrs[i] = LocalTypeHandler.DupPtr(&LocalTypeHandler, data, TagDescriptor ->Ele… in cmsWriteTag()
1759 if (Icc ->TagPtrs[i] == NULL) { in cmsWriteTag()
1763 …cmsSignalError(Icc ->ContextID, cmsERROR_CORRUPTION_DETECTED, "Malformed struct in type '%s' for t… in cmsWriteTag()
1768 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteTag()
1772 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteTag()
1785 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsReadRawTag() local
1795 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0; in cmsReadRawTag()
1798 i = _cmsSearchTag(Icc, sig, TRUE); in cmsReadRawTag()
1802 if (Icc -> TagPtrs[i] == NULL) { in cmsReadRawTag()
1805 Offset = Icc ->TagOffsets[i]; in cmsReadRawTag()
1806 TagSize = Icc ->TagSizes[i]; in cmsReadRawTag()
1814 if (!Icc ->IOhandler ->Seek(Icc ->IOhandler, Offset)) goto Error; in cmsReadRawTag()
1815 if (!Icc ->IOhandler ->Read(Icc ->IOhandler, data, 1, TagSize)) goto Error; in cmsReadRawTag()
1817 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1821 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1822 return Icc ->TagSizes[i]; in cmsReadRawTag()
1827 if (Icc ->TagSaveAsRaw[i]) { in cmsReadRawTag()
1831 TagSize = Icc ->TagSizes[i]; in cmsReadRawTag()
1835 memmove(data, Icc ->TagPtrs[i], TagSize); in cmsReadRawTag()
1837 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1841 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1842 return Icc ->TagSizes[i]; in cmsReadRawTag()
1848 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1850 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0; in cmsReadRawTag()
1864 TypeHandler = Icc ->TagTypeHandlers[i]; in cmsReadRawTag()
1865 TagDescriptor = _cmsGetTagDescriptor(Icc-> ContextID, sig); in cmsReadRawTag()
1875 LocalTypeHandler.ContextID = Icc ->ContextID; in cmsReadRawTag()
1876 LocalTypeHandler.ICCVersion = Icc ->Version; in cmsReadRawTag()
1892 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1896 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsReadRawTag()
1906 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsWriteRawTag() local
1909 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return 0; in cmsWriteRawTag()
1911 if (!_cmsNewTag(Icc, sig, &i)) { in cmsWriteRawTag()
1912 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteRawTag()
1917 Icc ->TagSaveAsRaw[i] = TRUE; in cmsWriteRawTag()
1918 Icc ->TagNames[i] = sig; in cmsWriteRawTag()
1919 Icc ->TagLinked[i] = (cmsTagSignature) 0; in cmsWriteRawTag()
1922 Icc ->TagPtrs[i] = _cmsDupMem(Icc ->ContextID, data, Size); in cmsWriteRawTag()
1923 Icc ->TagSizes[i] = Size; in cmsWriteRawTag()
1925 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsWriteRawTag()
1927 if (Icc->TagPtrs[i] == NULL) { in cmsWriteRawTag()
1928 Icc->TagNames[i] = (cmsTagSignature) 0; in cmsWriteRawTag()
1937 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsLinkTag() local
1940 if (!_cmsLockMutex(Icc->ContextID, Icc ->UsrMutex)) return FALSE; in cmsLinkTag()
1942 if (!_cmsNewTag(Icc, sig, &i)) { in cmsLinkTag()
1943 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsLinkTag()
1948 Icc ->TagSaveAsRaw[i] = FALSE; in cmsLinkTag()
1949 Icc ->TagNames[i] = sig; in cmsLinkTag()
1950 Icc ->TagLinked[i] = dest; in cmsLinkTag()
1952 Icc ->TagPtrs[i] = NULL; in cmsLinkTag()
1953 Icc ->TagSizes[i] = 0; in cmsLinkTag()
1954 Icc ->TagOffsets[i] = 0; in cmsLinkTag()
1956 _cmsUnlockMutex(Icc->ContextID, Icc ->UsrMutex); in cmsLinkTag()
1964 _cmsICCPROFILE* Icc = (_cmsICCPROFILE*) hProfile; in cmsTagLinkedTo() local
1968 i = _cmsSearchTag(Icc, sig, FALSE); in cmsTagLinkedTo()
1971 return Icc -> TagLinked[i]; in cmsTagLinkedTo()