cache-private.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2008 ImageMagick Studio LLC, a non-profit organization
00003   dedicated to making software imaging solutions freely available.
00004   
00005   You may not use this file except in compliance with the License.
00006   obtain a copy of the License at
00007   
00008     http://www.imagemagick.org/script/license.php
00009   
00010   Unless required by applicable law or agreed to in writing, software
00011   distributed under the License is distributed on an "AS IS" BASIS,
00012   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013   See the License for the specific language governing permissions and
00014   limitations under the License.
00015 
00016   MagickCore cache private methods.
00017 */
00018 #ifndef _MAGICKCORE_CACHE_PRIVATE_H
00019 #define _MAGICKCORE_CACHE_PRIVATE_H
00020 
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #include <time.h>
00026 #include "magick/semaphore.h"
00027 
00028 typedef enum
00029 {
00030   UndefinedCache,
00031   MemoryCache,
00032   MapCache,
00033   DiskCache
00034 } CacheType;
00035 
00036 typedef void
00037   *Cache;
00038 
00039 typedef const IndexPacket
00040   *(*AcquireIndexesFromHandler)(const Image *);
00041 
00042 typedef IndexPacket
00043   *(*GetIndexesFromHandler)(const Image *);
00044 
00045 typedef MagickBooleanType
00046   (*GetOneVirtualPixelFromHandler)(const Image *,const VirtualPixelMethod,
00047     const long,const long,PixelPacket *,ExceptionInfo *),
00048   (*GetOneAuthenticPixelFromHandler)(Image *,const long,const long,
00049     PixelPacket *,ExceptionInfo *),
00050   (*SyncPixelHandler)(Image *,ExceptionInfo *);
00051 
00052 typedef const PixelPacket
00053   *(*AcquirePixelHandler)(const Image *,const VirtualPixelMethod,const long,
00054     const long,const unsigned long,const unsigned long,ExceptionInfo *),
00055   *(*AcquirePixelsFromHandler)(const Image *);
00056 
00057 typedef PixelPacket
00058   *(*GetPixelHandler)(Image *,const long,const long,const unsigned long,
00059     const unsigned long,ExceptionInfo *);
00060 
00061 typedef PixelPacket
00062   *(*GetPixelsFromHandler)(const Image *);
00063 
00064 typedef PixelPacket
00065   *(*SetPixelHandler)(Image *,const long,const long,const unsigned long,
00066     const unsigned long,ExceptionInfo *);
00067 
00068 typedef void
00069   (*DestroyPixelHandler)(Image *);
00070 
00071 typedef struct _CacheMethods
00072 {
00073   AcquirePixelsFromHandler
00074     acquire_pixels_from_handler;
00075 
00076   AcquireIndexesFromHandler
00077     acquire_indexes_from_handler;
00078 
00079   GetOneVirtualPixelFromHandler
00080     acquire_one_pixel_from_handler;
00081 
00082   AcquirePixelHandler
00083     acquire_pixel_handler;
00084 
00085   DestroyPixelHandler
00086     destroy_pixel_handler;
00087 
00088   GetIndexesFromHandler
00089     get_indexes_from_handler;
00090 
00091   GetOneAuthenticPixelFromHandler
00092     get_one_pixel_from_handler;
00093 
00094   GetPixelHandler
00095     get_pixel_handler;
00096 
00097   GetPixelsFromHandler
00098     get_pixels_from_handler;
00099 
00100   SetPixelHandler
00101     set_pixel_handler;
00102 
00103   SyncPixelHandler
00104     sync_pixel_handler;
00105 } CacheMethods;
00106 
00107 typedef struct _NexusInfo
00108    NexusInfo;
00109 
00110 typedef struct _CacheInfo
00111 {
00112   ClassType
00113     storage_class;
00114 
00115   ColorspaceType
00116     colorspace;
00117 
00118   volatile CacheType
00119     type;
00120 
00121   MagickBooleanType
00122     mapped;
00123 
00124   unsigned long
00125     columns,
00126     rows;
00127 
00128   MagickOffsetType
00129     offset;
00130 
00131   MagickSizeType
00132     length;
00133 
00134   unsigned long
00135     nexuses;
00136 
00137   NexusInfo
00138     **nexus_info;
00139 
00140   PixelPacket
00141     *pixels;
00142 
00143   IndexPacket
00144     *indexes;
00145 
00146   VirtualPixelMethod
00147     virtual_pixel_method;
00148 
00149   PixelPacket
00150     virtual_pixel;
00151 
00152   int
00153     file;
00154 
00155   char
00156     filename[MaxTextExtent],
00157     cache_filename[MaxTextExtent];
00158 
00159   CacheMethods
00160     methods;
00161 
00162   MagickBooleanType
00163     debug;
00164 
00165 #if defined(MAGICKCORE_HAVE_PTHREAD)
00166   pthread_t
00167 #elif defined(__WINDOWS__)
00168   DWORD
00169 #else
00170   pid_t
00171 #endif
00172     id;
00173 
00174   volatile long
00175     reference_count;
00176 
00177   SemaphoreInfo
00178     *semaphore,
00179     *nexus_semaphore,
00180     *disk_semaphore;
00181 
00182   time_t
00183     timestamp;
00184 
00185   unsigned long
00186     signature;
00187 } CacheInfo;
00188 
00189 extern MagickExport Cache
00190   DestroyCacheInfo(Cache),
00191   ReferenceCache(Cache);
00192 
00193 extern MagickExport ClassType
00194   GetCacheClass(const Cache);
00195 
00196 extern MagickExport ColorspaceType
00197   GetCacheColorspace(const Cache);
00198 
00199 extern MagickExport const IndexPacket
00200   *AcquireNexusIndexes(const Cache,NexusInfo *);
00201 
00202 extern MagickExport const PixelPacket
00203   *AcquireCacheNexus(const Image *,const VirtualPixelMethod,const long,
00204     const long,const unsigned long,const unsigned long,NexusInfo *,
00205     ExceptionInfo *),
00206   *AcquireNexusPixels(const Cache,NexusInfo *);
00207 
00208 extern MagickExport IndexPacket
00209   *GetNexusIndexes(const Cache,NexusInfo *);
00210 
00211 extern MagickExport MagickBooleanType
00212   GetCacheInfo(Cache *),
00213   SyncCacheNexus(Image *,NexusInfo *,ExceptionInfo *);
00214 
00215 extern MagickExport MagickSizeType
00216   GetNexusExtent(const Cache,NexusInfo *);
00217 
00218 extern MagickExport NexusInfo
00219   *AcquireNexusInfo(void),
00220   **AcquireNexusInfoThreadSet(const unsigned long),
00221   *DestroyNexusInfo(NexusInfo *),
00222   **DestroyNexusInfoThreadSet(NexusInfo **,const unsigned long);
00223 
00224 extern MagickExport PixelPacket
00225   *GetCacheNexus(Image *,const long,const long,const unsigned long,
00226     const unsigned long,NexusInfo *,ExceptionInfo *),
00227   *GetNexusPixels(const Cache,NexusInfo *),
00228   *SetCacheNexus(Image *,const long,const long,const unsigned long,
00229     const unsigned long,NexusInfo *,ExceptionInfo *);
00230 
00231 extern MagickExport void
00232   CloneCacheMethods(Cache,const Cache),
00233   GetCacheMethods(CacheMethods *),
00234   SetCacheMethods(Cache,CacheMethods *);
00235 
00236 #if defined(__cplusplus) || defined(c_plusplus)
00237 }
00238 #endif
00239 
00240 #endif

Generated on Thu Nov 20 21:54:43 2008 for MagickCore by  doxygen 1.5.7.1