MagickCore  7.0.3
cache-private.h
Go to the documentation of this file.
1 /*
2  Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
3  dedicated to making software imaging solutions freely available.
4 
5  You may not use this file except in compliance with the License. You may
6  obtain a copy of the License at
7 
8  https://imagemagick.org/script/license.php
9 
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.
15 
16  MagickCore cache private methods.
17 */
18 #ifndef MAGICKCORE_CACHE_PRIVATE_H
19 #define MAGICKCORE_CACHE_PRIVATE_H
20 
21 #include "MagickCore/cache.h"
24 #include "MagickCore/pixel.h"
25 #include "MagickCore/random_.h"
27 #include "MagickCore/semaphore.h"
28 
29 #if defined(__cplusplus) || defined(c_plusplus)
30 extern "C" {
31 #endif
32 
33 typedef void
35 
36 typedef MagickBooleanType
37  (*GetOneAuthenticPixelFromHandler)(Image *,const ssize_t,const ssize_t,
40  const ssize_t,const ssize_t,Quantum *,ExceptionInfo *),
42 
43 typedef const Quantum
44  *(*GetVirtualPixelHandler)(const Image *,const VirtualPixelMethod,
45  const ssize_t,const ssize_t,const size_t,const size_t,ExceptionInfo *),
46  *(*GetVirtualPixelsHandler)(const Image *);
47 
48 typedef const void
49  *(*GetVirtualMetacontentFromHandler)(const Image *);
50 
51 typedef Quantum
52  *(*GetAuthenticPixelsHandler)(Image *,const ssize_t,const ssize_t,
53  const size_t,const size_t,ExceptionInfo *);
54 
55 typedef Quantum
56  *(*GetAuthenticPixelsFromHandler)(const Image *);
57 
58 typedef Quantum
59  *(*QueueAuthenticPixelsHandler)(Image *,const ssize_t,const ssize_t,
60  const size_t,const size_t,ExceptionInfo *);
61 
62 typedef void
63  (*DestroyPixelHandler)(Image *);
64 
65 typedef void
66  *(*GetAuthenticMetacontentFromHandler)(const Image *);
67 
68 typedef struct _CacheMethods
69 {
72 
75 
78 
81 
84 
87 
90 
93 
96 
99 
102 } CacheMethods;
103 
104 typedef struct _NexusInfo
105 {
108 
111 
114 
115  Quantum
117  *pixels;
118 
121 
122  void
124 
125  size_t
127 
128  struct _NexusInfo
129  *virtual_nexus;
130 } NexusInfo;
131 
132 typedef struct _CacheInfo
133 {
134  ClassType
136 
139 
140  PixelTrait
142 
145 
146  size_t
148  rows;
149 
150  size_t
153 
156 
157  CacheType
159 
160  MapMode
162  disk_mode;
163 
166 
169 
172 
173  VirtualPixelMethod
175 
176  PixelInfo
178 
179  size_t
181 
182  NexusInfo
184 
185  Quantum
187 
188  void
190 
191  int
193 
194  char
197 
200 
201  RandomInfo
203 
204  void
206 
209  debug;
210 
212  id;
213 
214  ssize_t
216 
220 
221  time_t
223 
224  size_t
226 
229 
232 
235  height_limit;
236 } CacheInfo;
237 
238 extern MagickPrivate Cache
239  AcquirePixelCache(const size_t),
240  ClonePixelCache(const Cache),
243 
246 
249 
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 *,
255 
256 extern MagickPrivate const void
257  *GetVirtualMetacontentFromNexus(const Cache,NexusInfo *magick_restrict);
258 
260  CacheComponentGenesis(void),
261  SyncAuthenticPixelCacheNexus(Image *,NexusInfo *magick_restrict,
264 
266  GetPixelCacheNexusExtent(const Cache,NexusInfo *magick_restrict);
267 
269  **AcquirePixelCacheNexus(const size_t),
270  **DestroyPixelCacheNexus(NexusInfo **,const size_t);
271 
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;
278 
279 extern MagickPrivate size_t
280  GetPixelCacheChannels(const Cache);
281 
282 extern MagickPrivate VirtualPixelMethod
283  GetPixelCacheVirtualMethod(const Image *),
284  SetPixelCacheVirtualMethod(Image *,const VirtualPixelMethod,ExceptionInfo *);
285 
286 extern MagickPrivate void
288  ClonePixelCacheMethods(Cache,const Cache),
289  GetPixelCacheTileSize(const Image *,size_t *,size_t *),
292  ResetPixelCacheEpoch(void),
293  ResetPixelCacheChannels(Image *),
294  SetPixelCacheMethods(Cache,CacheMethods *);
295 
296 #if defined(MAGICKCORE_OPENCL_SUPPORT)
297 extern MagickPrivate cl_mem
298  GetAuthenticOpenCLBuffer(const Image *,MagickCLDevice,ExceptionInfo *);
299 
300 extern MagickPrivate void
301  SyncAuthenticOpenCLBuffer(const Image *);
302 #endif
303 
304 #if defined(__cplusplus) || defined(c_plusplus)
305 }
306 #endif
307 
308 #endif
#define magick_restrict
Definition: MagickCore.h:41
MagickPrivate Cache DestroyPixelCache(Cache)
SemaphoreInfo * file_semaphore
struct _CacheMethods CacheMethods
MagickSizeType length
struct _MagickCLDevice * MagickCLDevice
Definition: opencl.h:44
GetVirtualPixelsHandler get_virtual_pixels_handler
Definition: cache-private.h:74
MagickOffsetType offset
size_t signature
void *(* GetAuthenticMetacontentFromHandler)(const Image *)
Definition: cache-private.h:66
void * metacontent
MagickPrivate MagickBooleanType CacheComponentGenesis(void)
MagickPrivate Quantum * GetAuthenticPixelCacheNexus(Image *, const ssize_t, const ssize_t, const size_t, const size_t, NexusInfo *, ExceptionInfo *) magick_hot_spot
GetVirtualPixelHandler get_virtual_pixel_handler
Definition: cache-private.h:71
MagickPrivate void GetPixelCacheMethods(CacheMethods *)
MapMode mode
MagickPrivate void GetPixelCacheTileSize(const Image *, size_t *, size_t *)
SyncAuthenticPixelsHandler sync_authentic_pixels_handler
Definition: cache-private.h:98
MagickPrivate MagickBooleanType SyncImagePixelCache(Image *, ExceptionInfo *)
Definition: cache.c:5491
VirtualPixelMethod
Definition: cache-view.h:27
char cache_filename[MagickPathExtent]
MagickPrivate Cache ReferencePixelCache(Cache)
Definition: cache.c:4736
PixelInfo virtual_pixel_color
MagickThreadType id
MagickBooleanType authentic_pixel_cache
MagickBooleanType debug
GetOneVirtualPixelFromHandler get_one_virtual_pixel_from_handler
Definition: cache-private.h:80
MagickCLCacheInfo opencl
MagickPrivate VirtualPixelMethod GetPixelCacheVirtualMethod(const Image *)
struct _CacheInfo CacheInfo
void * MagickCLCacheInfo
MagickPrivate NexusInfo ** DestroyPixelCacheNexus(NexusInfo **, const size_t)
Definition: cache.c:1101
MagickPrivate Cache ClonePixelCache(const Cache)
ssize_t MagickOffsetType
Definition: magick-type.h:129
MagickBooleanType mapped
Definition: image.h:151
MagickBooleanType synchronize
MagickPrivate const void * GetVirtualMetacontentFromNexus(const Cache, NexusInfo *magick_restrict)
size_t number_channels
RandomInfo * random_info
GetAuthenticPixelsHandler get_authentic_pixels_handler
Definition: cache-private.h:83
Quantum * pixels
MagickPrivate ClassType GetPixelCacheStorageClass(const Cache)
Definition: cache.c:2346
struct _NexusInfo NexusInfo
MagickBooleanType
Definition: magick-type.h:158
MagickPrivate void ClonePixelCacheMethods(Cache, const Cache)
ClassType
Definition: magick-type.h:151
pid_t MagickThreadType
Definition: thread_.h:34
void * server_info
time_t timestamp
GetAuthenticPixelsFromHandler get_authentic_pixels_from_handler
Definition: cache-private.h:92
Quantum *(* GetAuthenticPixelsHandler)(Image *, const ssize_t, const ssize_t, const size_t, const size_t, ExceptionInfo *)
Definition: cache-private.h:52
PixelChannelMap channel_map[MaxPixelChannels]
CacheMethods methods
QueueAuthenticPixelsHandler queue_authentic_pixels_handler
Definition: cache-private.h:95
RectangleInfo region
size_t MagickSizeType
Definition: magick-type.h:130
#define MagickPathExtent
struct _NexusInfo * virtual_nexus
DestroyPixelHandler destroy_pixel_handler
MagickBooleanType composite_mask
MagickPrivate const Quantum * GetVirtualPixelCacheNexus(const Image *, const VirtualPixelMethod, const ssize_t, const ssize_t, const size_t, const size_t, NexusInfo *, ExceptionInfo *) magick_hot_spot
CacheType type
MagickPrivate void ResetCacheAnonymousMemory(void)
Quantum * pixels
MagickPrivate const Quantum * GetVirtualPixelsNexus(const Cache, NexusInfo *magick_restrict)
SemaphoreInfo * semaphore
MagickBooleanType(*)(* GetOneVirtualPixelFromHandler)(const Image *, const VirtualPixelMethod, const ssize_t, const ssize_t, Quantum *, ExceptionInfo *)
Definition: cache-private.h:39
ColorspaceType colorspace
void * metacontent
MagickBooleanType mapped
MagickPrivate void CacheComponentTerminus(void)
const Quantum *(*)*(* GetVirtualPixelsHandler)(const Image *)
Definition: cache-private.h:46
GetVirtualMetacontentFromHandler get_virtual_metacontent_from_handler
Definition: cache-private.h:77
size_t signature
ChannelType
Definition: pixel.h:33
GetAuthenticMetacontentFromHandler get_authentic_metacontent_from_handler
Definition: cache-private.h:86
MagickPrivate MagickSizeType GetPixelCacheNexusExtent(const Cache, NexusInfo *magick_restrict)
Quantum * cache
size_t metacontent_extent
VirtualPixelMethod virtual_pixel_method
const Quantum *(* GetVirtualPixelHandler)(const Image *, const VirtualPixelMethod, const ssize_t, const ssize_t, const size_t, const size_t, ExceptionInfo *)
Definition: cache-private.h:44
MagickPrivate Quantum * QueueAuthenticPixelCacheNexus(Image *, const ssize_t, const ssize_t, const size_t, const size_t, const MagickBooleanType, NexusInfo *, ExceptionInfo *) magick_hot_spot
Definition: cache.c:4138
size_t number_threads
size_t columns
PixelTrait alpha_trait
MagickPrivate size_t GetPixelCacheChannels(const Cache)
MagickBooleanType(* GetOneAuthenticPixelFromHandler)(Image *, const ssize_t, const ssize_t, Quantum *, ExceptionInfo *)
Definition: cache-private.h:37
MagickSizeType length
MagickSizeType height_limit
unsigned short Quantum
Definition: magick-type.h:82
MagickPrivate void ResetPixelCacheChannels(Image *)
MagickPrivate ColorspaceType GetPixelCacheColorspace(const Cache)
Definition: cache.c:2140
char filename[MagickPathExtent]
ClassType storage_class
CacheType
Definition: cache.h:27
MagickPrivate VirtualPixelMethod SetPixelCacheVirtualMethod(Image *, const VirtualPixelMethod, ExceptionInfo *)
Definition: cache.c:5191
NexusInfo ** nexus_info
GetOneAuthenticPixelFromHandler get_one_authentic_pixel_from_handler
Definition: cache-private.h:89
MagickPrivate NexusInfo ** AcquirePixelCacheNexus(const size_t)
MapMode
Definition: blob.h:28
ColorspaceType
Definition: colorspace.h:25
MagickSizeType width_limit
MagickBooleanType(*)(*)(* SyncAuthenticPixelsHandler)(Image *, ExceptionInfo *)
Definition: cache-private.h:41
MagickPrivate void ResetPixelCacheEpoch(void)
#define MaxPixelChannels
Definition: pixel.h:27
MagickPrivate MagickBooleanType SyncAuthenticPixelCacheNexus(Image *, NexusInfo *magick_restrict, ExceptionInfo *) magick_hot_spot
#define MagickPrivate
void * Cache
Definition: cache-private.h:34
const void *(* GetVirtualMetacontentFromHandler)(const Image *)
Definition: cache-private.h:49
MagickExport MagickBooleanType magick_hot_spot
Definition: cache-view.h:88
void(* DestroyPixelHandler)(Image *)
Definition: cache-private.h:63
ChannelType channels
PixelTrait
Definition: pixel.h:134
Quantum *(* QueueAuthenticPixelsHandler)(Image *, const ssize_t, const ssize_t, const size_t, const size_t, ExceptionInfo *)
Definition: cache-private.h:59
MapMode disk_mode
MagickPrivate void SetPixelCacheMethods(Cache, CacheMethods *)
Definition: cache.c:4855
Quantum *(* GetAuthenticPixelsFromHandler)(const Image *)
Definition: cache-private.h:56
MagickPrivate Cache AcquirePixelCache(const size_t)
ssize_t reference_count