cache-private.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2010 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   (*SyncPixelHandler)(Image *);
00047 
00048 typedef const PixelPacket
00049   *(*AcquirePixelHandler)(const Image *,const VirtualPixelMethod,const long,
00050     const long,const unsigned long,const unsigned long,ExceptionInfo *);
00051 
00052 typedef PixelPacket
00053   (*AcquireOnePixelFromHandler)(const Image *,const VirtualPixelMethod,
00054     const long,const long,ExceptionInfo *);
00055 
00056 typedef PixelPacket
00057   (*GetOnePixelFromHandler)(Image *,const long,const long);
00058 
00059 typedef PixelPacket
00060   *(*GetPixelHandler)(Image *,const long,const long,const unsigned long,
00061     const unsigned long);
00062 
00063 typedef PixelPacket
00064   *(*GetPixelsFromHandler)(const Image *);
00065 
00066 typedef PixelPacket
00067   *(*SetPixelHandler)(Image *,const long,const long,const unsigned long,
00068     const unsigned long);
00069 
00070 typedef void
00071   (*DestroyPixelHandler)(Image *);
00072 
00073 typedef struct _CacheMethods
00074 {
00075   AcquireIndexesFromHandler
00076     acquire_indexes_from_handler;
00077 
00078   AcquireOnePixelFromHandler
00079     acquire_one_pixel_from_handler;
00080 
00081   AcquirePixelHandler
00082     acquire_pixel_handler;
00083 
00084   DestroyPixelHandler
00085     destroy_pixel_handler;
00086 
00087   GetIndexesFromHandler
00088     get_indexes_from_handler;
00089 
00090   GetOnePixelFromHandler
00091     get_one_pixel_from_handler;
00092 
00093   GetPixelHandler
00094     get_pixel_handler;
00095 
00096   GetPixelsFromHandler
00097     get_pixels_from_handler;
00098 
00099   SetPixelHandler
00100     set_pixel_handler;
00101 
00102   SyncPixelHandler
00103     sync_pixel_handler;
00104 } CacheMethods;
00105 
00106 typedef struct _NexusInfo NexusInfo;
00107 
00108 typedef struct _CacheInfo
00109 {
00110   unsigned long
00111     id;
00112 
00113   NexusInfo
00114     *nexus_info;
00115 
00116   unsigned long
00117     number_views;
00118 
00119   ClassType
00120     storage_class;
00121 
00122   ColorspaceType
00123     colorspace;
00124 
00125   CacheType
00126     type;
00127 
00128   MagickBooleanType
00129     mapped;
00130 
00131   unsigned long
00132     columns,
00133     rows;
00134 
00135   MagickOffsetType
00136     offset;
00137 
00138   MagickSizeType
00139     length;
00140 
00141   PixelPacket
00142     *pixels;
00143 
00144   IndexPacket
00145     *indexes;
00146 
00147   VirtualPixelMethod
00148     virtual_pixel_method;
00149 
00150   PixelPacket
00151     virtual_pixel;
00152 
00153   int
00154     file;
00155 
00156   MagickSizeType
00157     serial_number;
00158 
00159   char
00160     filename[MaxTextExtent],
00161     cache_filename[MaxTextExtent];
00162 
00163   CacheMethods
00164     methods;
00165 
00166   MagickBooleanType
00167     debug;
00168 
00169   unsigned long
00170     thread;
00171 
00172   long
00173     reference_count;
00174 
00175   SemaphoreInfo
00176     *semaphore;
00177 
00178   unsigned long
00179     signature;
00180 } CacheInfo;
00181 
00182 extern MagickExport Cache
00183   DestroyCacheInfo(Cache),
00184   ReferenceCache(Cache);
00185 
00186 extern MagickExport ClassType
00187   GetCacheClass(const Cache);
00188 
00189 extern MagickExport ColorspaceType
00190   GetCacheColorspace(const Cache);
00191 
00192 extern MagickExport const IndexPacket
00193   *AcquireNexusIndexes(const Cache,const unsigned long);
00194 
00195 extern MagickExport IndexPacket
00196   *GetNexusIndexes(const Cache,const unsigned long);
00197 
00198 extern MagickExport MagickBooleanType
00199   GetCacheInfo(Cache *);
00200 
00201 extern MagickExport PixelPacket
00202   *GetNexusPixels(const Cache,const unsigned long);
00203 
00204 extern MagickExport unsigned long
00205   GetNexus(Cache);
00206 
00207 extern MagickExport void
00208   CloneCacheMethods(Cache,const Cache),
00209   DestroyCacheNexus(Cache,const unsigned long),
00210   GetCacheMethods(CacheMethods *),
00211   SetCacheMethods(Cache,CacheMethods *);
00212 
00213 #if defined(__cplusplus) || defined(c_plusplus)
00214 }
00215 #endif
00216 
00217 #endif

Generated on Sat Jan 26 14:50:29 2008 for MagickCore by  doxygen 1.5.4