Closed DominikDeak closed 2 months ago
Hi, cmsSaveProfileToMem and cmsOpenProfileFromMemTHR is the way to do that and it is very efficient.
Deep copying is sometimes useful when cloning data in multi-threading environments.
Double check if you really want this. The way lcms works allows to open the profile or transform in one thread and reuse the handle on many other threads. Maybe you want to duplicate memory because you are running on different processes, but in this case is better to open the file. Note that only the required parts of the profile are loaded in memory in this case.
The way lcms works allows to open the profile or transform in one thread and reuse the handle on many other threads.
Right, as long I can safely use the same profile handle concurrently across different threads, that should be good enough for our use case.
Thanks for taking the time looking into this.
How feasible is adding a function that is capable of deep copying colour profiles in memory? I see
cmsDupContext()
exists for cloningcmsContext
, perhaps a similar feature could be implemented for profiles as well? For example,cmsDupProfile()
.Deep copying is sometimes useful when cloning data in multi-threading environments. Currently we clone profiles by saving and loading them in memory (via
cmsSaveProfileToMem
andcmsOpenProfileFromMemTHR
), but I'm wondering if there is a more efficient way of doing this?