Mercurial > hgrepos > Python2 > PyMuPDF
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mupdf-source/thirdparty/lcms2/plugins/threaded/src/threaded_internal.h Mon Sep 15 11:43:07 2025 +0200 @@ -0,0 +1,79 @@ +//--------------------------------------------------------------------------------- +// +// Little Color Management System, multithreaded extensions +// Copyright (c) 1998-2023 Marti Maria Saguer, all rights reserved +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. +// +//--------------------------------------------------------------------------------- + +#ifndef _THREADED_INTERNAL_H +#define _THREADED_INTERNAL_H + +#include "lcms2_threaded.h" + +// This plugin requires lcms 2.14 or greater +#define REQUIRED_LCMS_VERSION 2140 + +// Unused parameter warning suppression +#define UNUSED_PARAMETER(x) ((void)x) + +// For testbed +#define CMSCHECKPOINT CMSAPI + +// The specification for "inline" is section 6.7.4 of the C99 standard (ISO/IEC 9899:1999). +// unfortunately VisualC++ does not conform that +#if defined(_MSC_VER) || defined(__BORLANDC__) +# define cmsINLINE __inline +#else +# define cmsINLINE static inline +#endif + +// Holds all parameters for a threadable transform fragment +typedef struct { + + struct _cmstransform_struct* CMMcargo; + + const void* InputBuffer; + void* OutputBuffer; + + cmsUInt32Number PixelsPerLine; + cmsUInt32Number LineCount; + const cmsStride* Stride; + +} _cmsWorkSlice; + +// Count the number of threads needed for this job +cmsUInt32Number _cmsThrCountSlices(struct _cmstransform_struct* CMMcargo, cmsInt32Number MaxWorkers, + cmsUInt32Number PixelsPerLine, cmsUInt32Number LineCount, + cmsStride* Stride); + +// Split work following several expert rules +cmsBool _cmsThrSplitWork(const _cmsWorkSlice* master, cmsInt32Number nslices, _cmsWorkSlice slices[]); + +// Thread primitives +cmsHANDLE _cmsThrCreateWorker(cmsContext ContextID, _cmsTransform2Fn worker, _cmsWorkSlice* param); +void _cmsThrJoinWorker(cmsContext ContextID, cmsHANDLE hWorker); +cmsInt32Number _cmsThrIdealThreadCount(void); + +// The scheduler +void _cmsThrScheduler(struct _cmstransform_struct* CMMcargo, + const void* InputBuffer, + void* OutputBuffer, + cmsUInt32Number PixelsPerLine, + cmsUInt32Number LineCount, + const cmsStride* Stride); +#endif + +
