| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | #ifndef _MAGICKCORE_CACHE_PRIVATE_H |
|---|
| 19 | #define _MAGICKCORE_CACHE_PRIVATE_H |
|---|
| 20 | |
|---|
| 21 | #if defined(__cplusplus) || defined(c_plusplus) |
|---|
| 22 | extern "C" { |
|---|
| 23 | #endif |
|---|
| 24 | |
|---|
| 25 | #include <time.h> |
|---|
| 26 | #include "magick/semaphore.h" |
|---|
| 27 | |
|---|
| 28 | typedef enum |
|---|
| 29 | { |
|---|
| 30 | UndefinedCache, |
|---|
| 31 | MemoryCache, |
|---|
| 32 | MapCache, |
|---|
| 33 | DiskCache |
|---|
| 34 | } CacheType; |
|---|
| 35 | |
|---|
| 36 | typedef void |
|---|
| 37 | *Cache; |
|---|
| 38 | |
|---|
| 39 | typedef const IndexPacket |
|---|
| 40 | *(*AcquireIndexesFromHandler)(const Image *); |
|---|
| 41 | |
|---|
| 42 | typedef IndexPacket |
|---|
| 43 | *(*GetIndexesFromHandler)(const Image *); |
|---|
| 44 | |
|---|
| 45 | typedef MagickBooleanType |
|---|
| 46 | (*SyncPixelHandler)(Image *); |
|---|
| 47 | |
|---|
| 48 | typedef const PixelPacket |
|---|
| 49 | *(*AcquirePixelHandler)(const Image *,const VirtualPixelMethod,const long, |
|---|
| 50 | const long,const unsigned long,const unsigned long,ExceptionInfo *); |
|---|
| 51 | |
|---|
| 52 | typedef PixelPacket |
|---|
| 53 | (*AcquireOnePixelFromHandler)(const Image *,const VirtualPixelMethod, |
|---|
| 54 | const long,const long,ExceptionInfo *); |
|---|
| 55 | |
|---|
| 56 | typedef PixelPacket |
|---|
| 57 | (*GetOnePixelFromHandler)(Image *,const long,const long); |
|---|
| 58 | |
|---|
| 59 | typedef PixelPacket |
|---|
| 60 | *(*GetPixelHandler)(Image *,const long,const long,const unsigned long, |
|---|
| 61 | const unsigned long); |
|---|
| 62 | |
|---|
| 63 | typedef PixelPacket |
|---|
| 64 | *(*GetPixelsFromHandler)(const Image *); |
|---|
| 65 | |
|---|
| 66 | typedef PixelPacket |
|---|
| 67 | *(*SetPixelHandler)(Image *,const long,const long,const unsigned long, |
|---|
| 68 | const unsigned long); |
|---|
| 69 | |
|---|
| 70 | typedef void |
|---|
| 71 | (*DestroyPixelHandler)(Image *); |
|---|
| 72 | |
|---|
| 73 | typedef 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 | |
|---|
| 106 | typedef struct _NexusInfo |
|---|
| 107 | NexusInfo; |
|---|
| 108 | |
|---|
| 109 | typedef 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 | |
|---|
| 182 | extern MagickExport Cache |
|---|
| 183 | DestroyCacheInfo(Cache), |
|---|
| 184 | ReferenceCache(Cache); |
|---|
| 185 | |
|---|
| 186 | extern MagickExport ClassType |
|---|
| 187 | GetCacheClass(const Cache); |
|---|
| 188 | |
|---|
| 189 | extern MagickExport ColorspaceType |
|---|
| 190 | GetCacheColorspace(const Cache); |
|---|
| 191 | |
|---|
| 192 | extern MagickExport const IndexPacket |
|---|
| 193 | *AcquireNexusIndexes(const Cache,const unsigned long); |
|---|
| 194 | |
|---|
| 195 | extern MagickExport IndexPacket |
|---|
| 196 | *GetNexusIndexes(const Cache,const unsigned long); |
|---|
| 197 | |
|---|
| 198 | extern MagickExport MagickBooleanType |
|---|
| 199 | GetCacheInfo(Cache *); |
|---|
| 200 | |
|---|
| 201 | extern MagickExport PixelPacket |
|---|
| 202 | *GetNexusPixels(const Cache,const unsigned long); |
|---|
| 203 | |
|---|
| 204 | extern MagickExport unsigned long |
|---|
| 205 | GetNexus(Cache); |
|---|
| 206 | |
|---|
| 207 | extern 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 |
|---|