cache-private.h

Go to the documentation of this file.
00001 /*
00002   Copyright 1999-2009 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/random_.h"
00027 #include "magick/thread-private.h"
00028 #include "magick/semaphore.h"
00029 
00030 typedef enum
00031 {
00032   UndefinedCache,
00033   MemoryCache,
00034   MapCache,
00035   DiskCache
00036 } CacheType;
00037 
00038 typedef void
00039   *Cache;
00040 
00041 typedef const IndexPacket
00042   *(*GetVirtualIndexesFromHandler)(const Image *);
00043 
00044 typedef IndexPacket
00045   *(*GetAuthenticIndexesFromHandler)(const Image *);
00046 
00047 typedef MagickBooleanType
00048   (*GetOneAuthenticPixelFromHandler)(Image *,const long,const long,
00049     PixelPacket *,ExceptionInfo *),
00050   (*GetOneVirtualPixelFromHandler)(const Image *,const VirtualPixelMethod,
00051     const long,const long,PixelPacket *,ExceptionInfo *),
00052   (*SyncAuthenticPixelsHandler)(Image *,ExceptionInfo *);
00053 
00054 typedef const PixelPacket
00055   *(*GetVirtualPixelHandler)(const Image *,const VirtualPixelMethod,const long,
00056     const long,const unsigned long,const unsigned long,ExceptionInfo *),
00057   *(*GetVirtualPixelsHandler)(const Image *);
00058 
00059 typedef PixelPacket
00060   *(*GetAuthenticPixelsHandler)(Image *,const long,const long,
00061     const unsigned long,const unsigned long,ExceptionInfo *);
00062 
00063 typedef PixelPacket
00064   *(*GetAuthenticPixelsFromHandler)(const Image *);
00065 
00066 typedef PixelPacket
00067   *(*QueueAuthenticPixelsHandler)(Image *,const long,const long,
00068     const unsigned long,const unsigned long,ExceptionInfo *);
00069 
00070 typedef void
00071   (*DestroyPixelHandler)(Image *);
00072 
00073 typedef struct _CacheMethods
00074 {
00075   GetVirtualPixelHandler
00076     get_virtual_pixel_handler;
00077 
00078   GetVirtualPixelsHandler
00079     get_virtual_pixels_handler;
00080 
00081   GetVirtualIndexesFromHandler
00082     get_virtual_indexes_from_handler;
00083 
00084   GetOneVirtualPixelFromHandler
00085     get_one_virtual_pixel_from_handler;
00086 
00087   GetAuthenticPixelsHandler
00088     get_authentic_pixels_handler;
00089 
00090   GetAuthenticIndexesFromHandler
00091     get_authentic_indexes_from_handler;
00092 
00093   GetOneAuthenticPixelFromHandler
00094     get_one_authentic_pixel_from_handler;
00095 
00096   GetAuthenticPixelsFromHandler
00097     get_authentic_pixels_from_handler;
00098 
00099   QueueAuthenticPixelsHandler
00100     queue_authentic_pixels_handler;
00101 
00102   SyncAuthenticPixelsHandler
00103     sync_authentic_pixels_handler;
00104 
00105   DestroyPixelHandler
00106     destroy_pixel_handler;
00107 
00108 } CacheMethods;
00109 
00110 typedef struct _NexusInfo
00111    NexusInfo;
00112 
00113 typedef struct _CacheInfo
00114 {
00115   ClassType
00116     storage_class;
00117 
00118   ColorspaceType
00119     colorspace;
00120 
00121   CacheType
00122     type;
00123 
00124   MapMode
00125     mode;
00126 
00127   MagickBooleanType
00128     mapped;
00129 
00130   unsigned long
00131     columns,
00132     rows;
00133 
00134   MagickOffsetType
00135     offset;
00136 
00137   MagickSizeType
00138     length;
00139 
00140   VirtualPixelMethod
00141     virtual_pixel_method;
00142 
00143   unsigned long
00144     number_threads;
00145 
00146   NexusInfo
00147     **nexus_info;
00148 
00149   PixelPacket
00150     *pixels;
00151 
00152   IndexPacket
00153     *indexes;
00154 
00155   MagickBooleanType
00156     active_index_channel;
00157 
00158   int
00159     file;
00160 
00161   char
00162     filename[MaxTextExtent],
00163     cache_filename[MaxTextExtent];
00164 
00165   CacheMethods
00166     methods;
00167 
00168   RandomInfo
00169     *random_info;
00170 
00171   MagickBooleanType
00172     debug;
00173 
00174   MagickThreadType
00175     id;
00176 
00177   long
00178     reference_count;
00179 
00180   SemaphoreInfo
00181     *semaphore,
00182     *disk_semaphore;
00183 
00184   time_t
00185     timestamp;
00186 
00187   unsigned long
00188     signature;
00189 } CacheInfo;
00190 
00191 extern MagickExport Cache
00192   AcquirePixelCache(const unsigned long),
00193   ClonePixelCache(const Cache),
00194   DestroyPixelCache(Cache),
00195   GetImagePixelCache(Image *,const MagickBooleanType,ExceptionInfo *),
00196   ReferencePixelCache(Cache);
00197 
00198 extern MagickExport CacheType
00199   GetPixelCacheType(const Image *);
00200 
00201 extern MagickExport ClassType
00202   GetPixelCacheStorageClass(const Cache);
00203 
00204 extern MagickExport ColorspaceType
00205   GetPixelCacheColorspace(const Cache);
00206 
00207 extern MagickExport const IndexPacket
00208   *GetVirtualIndexesFromNexus(const Cache,NexusInfo *);
00209 
00210 extern MagickExport const PixelPacket
00211   *GetVirtualPixelsFromNexus(const Image *,const VirtualPixelMethod,const long,
00212     const long,const unsigned long,const unsigned long,NexusInfo *,
00213     ExceptionInfo *),
00214   *GetVirtualPixelsNexus(const Cache,NexusInfo *);
00215 
00216 extern MagickExport IndexPacket
00217   *GetPixelCacheNexusIndexes(const Cache,NexusInfo *);
00218 
00219 extern MagickExport MagickBooleanType
00220   SyncAuthenticPixelCacheNexus(Image *,NexusInfo *,ExceptionInfo *);
00221 
00222 extern MagickExport MagickSizeType
00223   GetPixelCacheNexusExtent(const Cache,NexusInfo *);
00224 
00225 extern MagickExport NexusInfo
00226   **AcquirePixelCacheNexus(const unsigned long),
00227   **DestroyPixelCacheNexus(NexusInfo **,const unsigned long);
00228 
00229 extern MagickExport PixelPacket
00230   *GetAuthenticPixelCacheNexus(Image *,const long,const long,
00231     const unsigned long,const unsigned long,NexusInfo *,ExceptionInfo *),
00232   *GetPixelCacheNexusPixels(const Cache,NexusInfo *),
00233   *QueueAuthenticNexus(Image *,const long,const long,const unsigned long,
00234     const unsigned long,NexusInfo *,ExceptionInfo *);
00235 
00236 extern MagickExport void
00237   ClonePixelCacheMethods(Cache,const Cache),
00238   GetPixelCacheTileSize(const Image *,unsigned long *,unsigned long *),
00239   GetPixelCacheMethods(CacheMethods *),
00240   SetPixelCacheMethods(Cache,CacheMethods *);
00241 
00242 #if defined(__cplusplus) || defined(c_plusplus)
00243 }
00244 #endif
00245 
00246 #endif

Generated on 19 Nov 2009 for MagickCore by  doxygen 1.6.1