root / ImageMagick / trunk / magick / cache-private.h

Revision 12591, 4.1 kB (checked in by cristy, 2 weeks ago)
Line 
1/*
2  Copyright 1999-2008 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.
6  obtain a copy of the License at
7 
8    http://www.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#if defined(__cplusplus) || defined(c_plusplus)
22extern "C" {
23#endif
24
25#include <time.h>
26#include "magick/semaphore.h"
27
28typedef enum
29{
30  UndefinedCache,
31  MemoryCache,
32  MapCache,
33  DiskCache
34} CacheType;
35
36typedef void
37  *Cache;
38
39typedef const IndexPacket
40  *(*AcquireIndexesFromHandler)(const Image *);
41
42typedef IndexPacket
43  *(*GetIndexesFromHandler)(const Image *);
44
45typedef MagickBooleanType
46  (*SyncPixelHandler)(Image *);
47
48typedef const PixelPacket
49  *(*AcquirePixelHandler)(const Image *,const VirtualPixelMethod,const long,
50    const long,const unsigned long,const unsigned long,ExceptionInfo *);
51
52typedef PixelPacket
53  (*AcquireOnePixelFromHandler)(const Image *,const VirtualPixelMethod,
54    const long,const long,ExceptionInfo *);
55
56typedef PixelPacket
57  (*GetOnePixelFromHandler)(Image *,const long,const long);
58
59typedef PixelPacket
60  *(*GetPixelHandler)(Image *,const long,const long,const unsigned long,
61    const unsigned long);
62
63typedef PixelPacket
64  *(*GetPixelsFromHandler)(const Image *);
65
66typedef PixelPacket
67  *(*SetPixelHandler)(Image *,const long,const long,const unsigned long,
68    const unsigned long);
69
70typedef void
71  (*DestroyPixelHandler)(Image *);
72
73typedef struct _CacheMethods
74{
75  AcquireIndexesFromHandler
76    acquire_indexes_from_handler;
77
78  AcquireOnePixelFromHandler
79    acquire_one_pixel_from_handler;
80
81  AcquirePixelHandler
82    acquire_pixel_handler;
83
84  DestroyPixelHandler
85    destroy_pixel_handler;
86
87  GetIndexesFromHandler
88    get_indexes_from_handler;
89
90  GetOnePixelFromHandler
91    get_one_pixel_from_handler;
92
93  GetPixelHandler
94    get_pixel_handler;
95
96  GetPixelsFromHandler
97    get_pixels_from_handler;
98
99  SetPixelHandler
100    set_pixel_handler;
101
102  SyncPixelHandler
103    sync_pixel_handler;
104} CacheMethods;
105
106typedef struct _NexusInfo
107   NexusInfo;
108
109typedef struct _CacheInfo
110{
111  NexusInfo
112    *nexus_info;
113
114  unsigned long
115    number_views;
116
117  ClassType
118    storage_class;
119
120  ColorspaceType
121    colorspace;
122
123  volatile CacheType
124    type;
125
126  MagickBooleanType
127    mapped;
128
129  unsigned long
130    columns,
131    rows;
132
133  MagickOffsetType
134    offset;
135
136  MagickSizeType
137    length;
138
139  PixelPacket
140    *pixels;
141
142  IndexPacket
143    *indexes;
144
145  VirtualPixelMethod
146    virtual_pixel_method;
147
148  PixelPacket
149    virtual_pixel;
150
151  int
152    file;
153
154  MagickSizeType
155    serial_number;
156
157  char
158    filename[MaxTextExtent],
159    cache_filename[MaxTextExtent];
160
161  CacheMethods
162    methods;
163
164  MagickBooleanType
165    debug;
166
167  unsigned long
168    thread;
169
170  volatile long
171    reference_count;
172
173  SemaphoreInfo
174    *semaphore,
175    *nexus_semaphore,
176    *disk_semaphore;
177
178  unsigned long
179    signature;
180} CacheInfo;
181
182extern MagickExport Cache
183  DestroyCacheInfo(Cache),
184  ReferenceCache(Cache);
185
186extern MagickExport ClassType
187  GetCacheClass(const Cache);
188
189extern MagickExport ColorspaceType
190  GetCacheColorspace(const Cache);
191
192extern MagickExport const IndexPacket
193  *AcquireNexusIndexes(const Cache,const unsigned long);
194
195extern MagickExport IndexPacket
196  *GetNexusIndexes(const Cache,const unsigned long);
197
198extern MagickExport MagickBooleanType
199  GetCacheInfo(Cache *);
200
201extern MagickExport PixelPacket
202  *GetNexusPixels(const Cache,const unsigned long);
203
204extern MagickExport unsigned long
205  GetNexus(Cache);
206
207extern MagickExport void
208  CloneCacheMethods(Cache,const Cache),
209  DestroyCacheNexus(Cache,const unsigned long),
210  GetCacheMethods(CacheMethods *),
211  SetCacheMethods(Cache,CacheMethods *);
212
213#if defined(__cplusplus) || defined(c_plusplus)
214}
215#endif
216
217#endif
Note: See TracBrowser for help on using the browser.