cache-view.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 view methods.
00017 */
00018 #ifndef _MAGICKCORE_CACHE_VIEW_H
00019 #define _MAGICKCORE_CACHE_VIEW_H
00020 
00021 #if defined(__cplusplus) || defined(c_plusplus)
00022 extern "C" {
00023 #endif
00024 
00025 #include "magick/pixel.h"
00026 
00027 typedef enum
00028 {
00029   UndefinedVirtualPixelMethod,
00030   BackgroundVirtualPixelMethod,
00031   ConstantVirtualPixelMethod,  /* deprecated */
00032   DitherVirtualPixelMethod,
00033   EdgeVirtualPixelMethod,
00034   MirrorVirtualPixelMethod,
00035   RandomVirtualPixelMethod,
00036   TileVirtualPixelMethod,
00037   TransparentVirtualPixelMethod,
00038   MaskVirtualPixelMethod,
00039   BlackVirtualPixelMethod,
00040   GrayVirtualPixelMethod,
00041   WhiteVirtualPixelMethod,
00042   HorizontalTileVirtualPixelMethod,
00043   VerticalTileVirtualPixelMethod
00044 } VirtualPixelMethod;
00045 
00046 typedef struct _ViewInfo
00047   ViewInfo;
00048 
00049 extern MagickExport ClassType
00050   GetCacheViewStorageClass(const ViewInfo *);
00051 
00052 extern MagickExport ColorspaceType
00053   GetCacheViewColorspace(const ViewInfo *);
00054 
00055 extern MagickExport const IndexPacket
00056   *GetCacheViewVirtualIndexQueue(const ViewInfo *);
00057 
00058 extern MagickExport const PixelPacket
00059   *GetCacheViewVirtualPixels(const ViewInfo *,const long,const long,
00060     const unsigned long,const unsigned long,ExceptionInfo *),
00061   *GetCacheViewVirtualPixelQueue(const ViewInfo *);
00062 
00063 extern MagickExport ExceptionInfo
00064   *GetCacheViewException(const ViewInfo *);
00065 
00066 extern MagickExport IndexPacket
00067   *GetCacheViewAuthenticIndexQueue(ViewInfo *);
00068 
00069 extern MagickExport MagickBooleanType
00070   GetOneCacheViewVirtualPixel(const ViewInfo *,const long,const long,
00071     PixelPacket *,ExceptionInfo *),
00072   GetOneCacheViewVirtualMethodPixel(const ViewInfo *,
00073     const VirtualPixelMethod,const long,const long,PixelPacket *,
00074     ExceptionInfo *),
00075   GetOneCacheViewAuthenticPixel(const ViewInfo *,const long,const long,
00076     PixelPacket *,ExceptionInfo *),
00077   SetCacheViewStorageClass(ViewInfo *,const ClassType),
00078   SetCacheViewVirtualPixelMethod(ViewInfo *,const VirtualPixelMethod),
00079   SyncCacheViewAuthenticPixels(ViewInfo *,ExceptionInfo *);
00080 
00081 extern MagickExport MagickSizeType
00082   GetCacheViewExtent(const ViewInfo *);
00083 
00084 extern MagickExport PixelPacket
00085   *GetCacheViewAuthenticPixelQueue(ViewInfo *),
00086   *GetCacheViewAuthenticPixels(ViewInfo *,const long,const long,
00087     const unsigned long,const unsigned long,ExceptionInfo *),
00088   *QueueCacheViewAuthenticPixels(ViewInfo *,const long,const long,
00089     const unsigned long,const unsigned long,ExceptionInfo *);
00090 
00091 extern MagickExport ViewInfo
00092   *AcquireCacheView(const Image *),
00093   *AcquireCacheViewThread(ViewInfo **),
00094   **AcquireCacheViewThreadSet(const Image *),
00095   *CloneCacheView(const ViewInfo *),
00096   *DestroyCacheView(ViewInfo *),
00097   **DestroyCacheViewThreadSet(ViewInfo **);
00098 
00099 /*
00100   Inline methods.
00101 */
00102 static inline unsigned long GetCacheViewMaximumThreads(void)
00103 {
00104 #if defined(MAGICKCORE_OPENMP_SUPPORT)
00105   return(omp_get_max_threads());
00106 #else
00107   return(1);
00108 #endif
00109 }
00110 
00111 static inline long GetCacheViewThreadId(void)
00112 {
00113 #if defined(MAGICKCORE_OPENMP_SUPPORT)
00114   return(omp_get_thread_num());
00115 #else
00116   return(0);
00117 #endif
00118 }
00119 
00120 static inline void SetCacheViewMaximumThreads(const unsigned long threads)
00121 {
00122 #if defined(MAGICKCORE_OPENMP_SUPPORT)
00123   omp_set_num_threads(threads);
00124 #else
00125   (void) threads;
00126 #endif
00127 }
00128 
00129 #if defined(__cplusplus) || defined(c_plusplus)
00130 }
00131 #endif
00132 
00133 #endif

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