2 Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License. You may
6 obtain a copy of the License at
8 https://imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore cache private methods.
18 #ifndef MAGICKCORE_CACHE_PRIVATE_H
19 #define MAGICKCORE_CACHE_PRIVATE_H
21 #include "MagickCore/cache.h"
22 #include "MagickCore/distribute-cache.h"
23 #include "MagickCore/opencl-private.h"
24 #include "MagickCore/pixel.h"
25 #include "MagickCore/random_.h"
26 #include "MagickCore/thread-private.h"
27 #include "MagickCore/semaphore.h"
29 #if defined(__cplusplus) || defined(c_plusplus)
36 typedef MagickBooleanType
37 (*GetOneAuthenticPixelFromHandler)(Image *,const ssize_t,const ssize_t,
38 Quantum *,ExceptionInfo *),
39 (*GetOneVirtualPixelFromHandler)(const Image *,const VirtualPixelMethod,
40 const ssize_t,const ssize_t,Quantum *,ExceptionInfo *),
41 (*SyncAuthenticPixelsHandler)(Image *,ExceptionInfo *);
44 *(*GetVirtualPixelHandler)(const Image *,const VirtualPixelMethod,
45 const ssize_t,const ssize_t,const size_t,const size_t,ExceptionInfo *),
46 *(*GetVirtualPixelsHandler)(const Image *);
49 *(*GetVirtualMetacontentFromHandler)(const Image *);
52 *(*GetAuthenticPixelsHandler)(Image *,const ssize_t,const ssize_t,
53 const size_t,const size_t,ExceptionInfo *);
56 *(*GetAuthenticPixelsFromHandler)(const Image *);
59 *(*QueueAuthenticPixelsHandler)(Image *,const ssize_t,const ssize_t,
60 const size_t,const size_t,ExceptionInfo *);
63 (*DestroyPixelHandler)(Image *);
66 *(*GetAuthenticMetacontentFromHandler)(const Image *);
68 typedef struct _CacheMethods
70 GetVirtualPixelHandler
71 get_virtual_pixel_handler;
73 GetVirtualPixelsHandler
74 get_virtual_pixels_handler;
76 GetVirtualMetacontentFromHandler
77 get_virtual_metacontent_from_handler;
79 GetOneVirtualPixelFromHandler
80 get_one_virtual_pixel_from_handler;
82 GetAuthenticPixelsHandler
83 get_authentic_pixels_handler;
85 GetAuthenticMetacontentFromHandler
86 get_authentic_metacontent_from_handler;
88 GetOneAuthenticPixelFromHandler
89 get_one_authentic_pixel_from_handler;
91 GetAuthenticPixelsFromHandler
92 get_authentic_pixels_from_handler;
94 QueueAuthenticPixelsHandler
95 queue_authentic_pixels_handler;
97 SyncAuthenticPixelsHandler
98 sync_authentic_pixels_handler;
101 destroy_pixel_handler;
104 typedef struct _NexusInfo
120 authentic_pixel_cache;
132 typedef struct _CacheInfo
155 channel_map[MaxPixelChannels];
174 virtual_pixel_method;
195 filename[MagickPathExtent],
196 cache_filename[MagickPathExtent];
238 extern MagickPrivate Cache
239 AcquirePixelCache(const size_t),
240 ClonePixelCache(const Cache),
241 DestroyPixelCache(Cache),
242 ReferencePixelCache(Cache);
244 extern MagickPrivate ClassType
245 GetPixelCacheStorageClass(const Cache);
247 extern MagickPrivate ColorspaceType
248 GetPixelCacheColorspace(const Cache);
250 extern MagickPrivate const Quantum
251 *GetVirtualPixelCacheNexus(const Image *,const VirtualPixelMethod,
252 const ssize_t,const ssize_t,const size_t,const size_t,NexusInfo *,
253 ExceptionInfo *) magick_hot_spot,
254 *GetVirtualPixelsNexus(const Cache,NexusInfo *magick_restrict);
256 extern MagickPrivate const void
257 *GetVirtualMetacontentFromNexus(const Cache,NexusInfo *magick_restrict);
259 extern MagickPrivate MagickBooleanType
260 CacheComponentGenesis(void),
261 SyncAuthenticPixelCacheNexus(Image *,NexusInfo *magick_restrict,
262 ExceptionInfo *) magick_hot_spot,
263 SyncImagePixelCache(Image *,ExceptionInfo *);
265 extern MagickPrivate MagickSizeType
266 GetPixelCacheNexusExtent(const Cache,NexusInfo *magick_restrict);
268 extern MagickPrivate NexusInfo
269 **AcquirePixelCacheNexus(const size_t),
270 **DestroyPixelCacheNexus(NexusInfo **,const size_t);
272 extern MagickPrivate Quantum
273 *GetAuthenticPixelCacheNexus(Image *,const ssize_t,const ssize_t,
274 const size_t,const size_t,NexusInfo *,ExceptionInfo *) magick_hot_spot,
275 *QueueAuthenticPixelCacheNexus(Image *,const ssize_t,const ssize_t,
276 const size_t,const size_t,const MagickBooleanType,NexusInfo *,
277 ExceptionInfo *) magick_hot_spot;
279 extern MagickPrivate size_t
280 GetPixelCacheChannels(const Cache);
282 extern MagickPrivate VirtualPixelMethod
283 GetPixelCacheVirtualMethod(const Image *),
284 SetPixelCacheVirtualMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
286 extern MagickPrivate void
287 CacheComponentTerminus(void),
288 ClonePixelCacheMethods(Cache,const Cache),
289 GetPixelCacheTileSize(const Image *,size_t *,size_t *),
290 GetPixelCacheMethods(CacheMethods *),
291 ResetCacheAnonymousMemory(void),
292 ResetPixelCacheEpoch(void),
293 ResetPixelCacheChannels(Image *),
294 SetPixelCacheMethods(Cache,CacheMethods *);
296 #if defined(MAGICKCORE_OPENCL_SUPPORT)
297 extern MagickPrivate cl_mem
298 GetAuthenticOpenCLBuffer(const Image *,MagickCLDevice,ExceptionInfo *);
300 extern MagickPrivate void
301 SyncAuthenticOpenCLBuffer(const Image *);
304 #if defined(__cplusplus) || defined(c_plusplus)