root / ImageMagick / branches / ImageMagick-6.3.5 / magick / cache-private.h

Revision 7647, 4.1 kB (checked in by cristy, 15 months ago)
Line 
1/*
2  Copyright 1999-2007 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 NexusInfo;
107
108typedef struct _CacheInfo
109{
110  unsigned long
111    id;
112
113  NexusInfo
114    *nexus_info;
115
116  unsigned long
117    number_views;
118
119  ClassType
120    storage_class;
121
122  ColorspaceType
123    colorspace;
124
125  CacheType
126    type;
127
128  MagickBooleanType
129    mapped;
130
131  unsigned long
132    columns,
133    rows;
134
135  MagickOffsetType
136    offset;
137
138  MagickSizeType
139    length;
140
141  PixelPacket
142    *pixels;
143
144  IndexPacket
145    *indexes;
146
147  VirtualPixelMethod
148    virtual_pixel_method;
149
150  PixelPacket
151    virtual_pixel;
152
153  int
154    file;
155
156  MagickSizeType
157    serial_number;
158
159  char
160    filename[MaxTextExtent],
161    cache_filename[MaxTextExtent];
162
163  CacheMethods
164    methods;
165
166  MagickBooleanType
167    debug;
168
169  unsigned long
170    thread;
171
172  long
173    reference_count;
174
175  SemaphoreInfo
176    *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.