Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/lcms2/plugins/threaded/src/threaded_internal.h @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 //--------------------------------------------------------------------------------- | |
| 2 // | |
| 3 // Little Color Management System, multithreaded extensions | |
| 4 // Copyright (c) 1998-2023 Marti Maria Saguer, all rights reserved | |
| 5 // | |
| 6 // This program is free software: you can redistribute it and/or modify | |
| 7 // it under the terms of the GNU General Public License as published by | |
| 8 // the Free Software Foundation, either version 3 of the License, or | |
| 9 // (at your option) any later version. | |
| 10 // | |
| 11 // This program is distributed in the hope that it will be useful, | |
| 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 // GNU General Public License for more details. | |
| 15 // | |
| 16 // You should have received a copy of the GNU General Public License | |
| 17 // along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 18 // | |
| 19 //--------------------------------------------------------------------------------- | |
| 20 | |
| 21 #ifndef _THREADED_INTERNAL_H | |
| 22 #define _THREADED_INTERNAL_H | |
| 23 | |
| 24 #include "lcms2_threaded.h" | |
| 25 | |
| 26 // This plugin requires lcms 2.14 or greater | |
| 27 #define REQUIRED_LCMS_VERSION 2140 | |
| 28 | |
| 29 // Unused parameter warning suppression | |
| 30 #define UNUSED_PARAMETER(x) ((void)x) | |
| 31 | |
| 32 // For testbed | |
| 33 #define CMSCHECKPOINT CMSAPI | |
| 34 | |
| 35 // The specification for "inline" is section 6.7.4 of the C99 standard (ISO/IEC 9899:1999). | |
| 36 // unfortunately VisualC++ does not conform that | |
| 37 #if defined(_MSC_VER) || defined(__BORLANDC__) | |
| 38 # define cmsINLINE __inline | |
| 39 #else | |
| 40 # define cmsINLINE static inline | |
| 41 #endif | |
| 42 | |
| 43 // Holds all parameters for a threadable transform fragment | |
| 44 typedef struct { | |
| 45 | |
| 46 struct _cmstransform_struct* CMMcargo; | |
| 47 | |
| 48 const void* InputBuffer; | |
| 49 void* OutputBuffer; | |
| 50 | |
| 51 cmsUInt32Number PixelsPerLine; | |
| 52 cmsUInt32Number LineCount; | |
| 53 const cmsStride* Stride; | |
| 54 | |
| 55 } _cmsWorkSlice; | |
| 56 | |
| 57 // Count the number of threads needed for this job | |
| 58 cmsUInt32Number _cmsThrCountSlices(struct _cmstransform_struct* CMMcargo, cmsInt32Number MaxWorkers, | |
| 59 cmsUInt32Number PixelsPerLine, cmsUInt32Number LineCount, | |
| 60 cmsStride* Stride); | |
| 61 | |
| 62 // Split work following several expert rules | |
| 63 cmsBool _cmsThrSplitWork(const _cmsWorkSlice* master, cmsInt32Number nslices, _cmsWorkSlice slices[]); | |
| 64 | |
| 65 // Thread primitives | |
| 66 cmsHANDLE _cmsThrCreateWorker(cmsContext ContextID, _cmsTransform2Fn worker, _cmsWorkSlice* param); | |
| 67 void _cmsThrJoinWorker(cmsContext ContextID, cmsHANDLE hWorker); | |
| 68 cmsInt32Number _cmsThrIdealThreadCount(void); | |
| 69 | |
| 70 // The scheduler | |
| 71 void _cmsThrScheduler(struct _cmstransform_struct* CMMcargo, | |
| 72 const void* InputBuffer, | |
| 73 void* OutputBuffer, | |
| 74 cmsUInt32Number PixelsPerLine, | |
| 75 cmsUInt32Number LineCount, | |
| 76 const cmsStride* Stride); | |
| 77 #endif | |
| 78 | |
| 79 |
