diff options
author | Marti Maria <marti.maria@littlecms.com> | 2022-06-05 13:07:27 +0200 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2022-06-05 13:07:27 +0200 |
commit | 07c005ca20309432d9a857a3f4c1f4a5f8ff303f (patch) | |
tree | 33dac670aff16a8d24d8317e6fb1e72beac2b286 /include | |
parent | 6ae2e99a3535417ca5c95b602eb61fdd29d294d0 (diff) | |
download | lcms2-07c005ca20309432d9a857a3f4c1f4a5f8ff303f.tar.gz |
A very preliminar new plug-in on multithreaded transforms
This is just the first try to get a new plugin type and a working example. Manuals are still missing. Basically a plug-in of this type adds multicore capabilities. May be used for GPU in future.
Diffstat (limited to 'include')
-rw-r--r-- | include/lcms2.h | 4 | ||||
-rw-r--r-- | include/lcms2_plugin.h | 22 |
2 files changed, 23 insertions, 3 deletions
diff --git a/include/lcms2.h b/include/lcms2.h index 5e0aa33..8e4dd39 100644 --- a/include/lcms2.h +++ b/include/lcms2.h @@ -23,7 +23,7 @@ // //--------------------------------------------------------------------------------- // -// Version 2.13.1 +// Version 2.14 alpha // #ifndef _lcms2_H @@ -81,7 +81,7 @@ extern "C" { #endif // Version/release -#define LCMS_VERSION 2131 +#define LCMS_VERSION 2140 // I will give the chance of redefining basic types for compilers that are not fully C99 compliant #ifndef CMS_BASIC_TYPES_ALREADY_DEFINED diff --git a/include/lcms2_plugin.h b/include/lcms2_plugin.h index 27fdb6a..33540b8 100644 --- a/include/lcms2_plugin.h +++ b/include/lcms2_plugin.h @@ -209,6 +209,7 @@ typedef void* (* _cmsDupUserDataFn)(cmsContext ContextID, const void* Data); #define cmsPluginOptimizationSig 0x6F707448 // 'optH' #define cmsPluginTransformSig 0x7A666D48 // 'xfmH' #define cmsPluginMutexSig 0x6D747A48 // 'mtxH' +#define cmsPluginParalellizationSig 0x70726C48 // 'prlH typedef struct _cmsPluginBaseStruct { @@ -596,7 +597,7 @@ typedef void (* _cmsTransformFn)(struct _cmstransform_struct *CMMcargo, // const void* InputBuffer, void* OutputBuffer, cmsUInt32Number Size, - cmsUInt32Number Stride); // Stride in bytes to the next plana in planar formats + cmsUInt32Number Stride); // Stride in bytes to the next plane in planar formats typedef void (*_cmsTransform2Fn)(struct _cmstransform_struct *CMMcargo, @@ -669,6 +670,25 @@ CMSAPI void CMSEXPORT _cmsDestroyMutex(cmsContext ContextID, void* mtx); CMSAPI cmsBool CMSEXPORT _cmsLockMutex(cmsContext ContextID, void* mtx); CMSAPI void CMSEXPORT _cmsUnlockMutex(cmsContext ContextID, void* mtx); +//---------------------------------------------------------------------------------------------------------- +// Parallelization + +CMSAPI _cmsTransform2Fn CMSEXPORT _cmsGetTransformWorker(struct _cmstransform_struct* CMMcargo); +CMSAPI cmsInt32Number CMSEXPORT _cmsGetTransformMaxWorkers(struct _cmstransform_struct* CMMcargo); +CMSAPI cmsUInt32Number CMSEXPORT _cmsGetTransformWorkerFlags(struct _cmstransform_struct* CMMcargo); + +// Let's plug-in to guess the best number of workers +#define CMS_GUESS_MAX_WORKERS -1 + +typedef struct { + cmsPluginBase base; + + cmsInt32Number MaxWorkers; // Number of starts to do as maximum + cmsUInt32Number WorkerFlags; // Reserved + _cmsTransform2Fn SchedulerFn; // callback to setup functions + +} cmsPluginParalellization; + #ifndef CMS_USE_CPP_API # ifdef __cplusplus |