]> granicus.if.org Git - imagemagick/blobdiff - magick/cache-view.c
(no commit message)
[imagemagick] / magick / cache-view.c
index 4982efece53b2e47665b07ce0f1e3acdce06628f..83e843e9896a505a0069f575d29a515c6491a94a 100644 (file)
@@ -23,7 +23,7 @@
 %                               February 2000                                 %
 %                                                                             %
 %                                                                             %
-%  Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization      %
+%  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization      %
 %  dedicated to making software imaging solutions freely available.           %
 %                                                                             %
 %  You may not use this file except in compliance with the License.  You may  %
@@ -112,7 +112,7 @@ MagickExport CacheView *AcquireCacheView(const Image *image)
   assert(image->signature == MagickSignature);
   if (image->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  cache_view=(CacheView *) AcquireAlignedMemory(1,sizeof(*cache_view));
+  cache_view=(CacheView *) AcquireMagickMemory(sizeof(*cache_view));
   if (cache_view == (CacheView *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   (void) ResetMagickMemory(cache_view,0,sizeof(*cache_view));
@@ -159,7 +159,7 @@ MagickExport CacheView *CloneCacheView(const CacheView *cache_view)
   if (cache_view->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       cache_view->image->filename);
-  clone_view=(CacheView *) AcquireAlignedMemory(1,sizeof(*clone_view));
+  clone_view=(CacheView *) AcquireMagickMemory(sizeof(*clone_view));
   if (clone_view == (CacheView *) NULL)
     ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
   (void) ResetMagickMemory(clone_view,0,sizeof(*clone_view));
@@ -207,7 +207,7 @@ MagickExport CacheView *DestroyCacheView(CacheView *cache_view)
       cache_view->number_threads);
   cache_view->image=DestroyImage(cache_view->image);
   cache_view->signature=(~MagickSignature);
-  cache_view=(CacheView *) RelinquishAlignedMemory(cache_view);
+  cache_view=(CacheView *) RelinquishMagickMemory(cache_view);
   return(cache_view);
 }
 \f
@@ -216,6 +216,39 @@ MagickExport CacheView *DestroyCacheView(CacheView *cache_view)
 %                                                                             %
 %                                                                             %
 %                                                                             %
+%   G e t C a c h e V i e w C h a n n e l s                                   %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  GetCacheViewChannels() returns the image pixel channels associated with
+%  the specified view.
+%
+%  The format of the GetCacheViewChannels method is:
+%
+%      size_t GetCacheViewChannels(const CacheView *cache_view)
+%
+%  A description of each parameter follows:
+%
+%    o cache_view: the cache view.
+%
+*/
+MagickExport size_t GetCacheViewChannels(const CacheView *cache_view)
+{
+  assert(cache_view != (CacheView *) NULL);
+  assert(cache_view->signature == MagickSignature);
+  if (cache_view->debug != MagickFalse)
+    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
+      cache_view->image->filename);
+  return(GetPixelCacheChannels(cache_view->image->cache));
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   G e t C a c h e V i e w C o l o r s p a c e                               %
 %                                                                             %
 %                                                                             %
@@ -241,7 +274,7 @@ MagickExport ColorspaceType GetCacheViewColorspace(const CacheView *cache_view)
   if (cache_view->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       cache_view->image->filename);
-  return(cache_view->image->colorspace);
+  return(GetPixelCacheColorspace(cache_view->image->cache));
 }
 \f
 /*
@@ -347,7 +380,7 @@ MagickExport ClassType GetCacheViewStorageClass(const CacheView *cache_view)
   if (cache_view->debug != MagickFalse)
     (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
       cache_view->image->filename);
-  return(cache_view->image->storage_class);
+  return(GetPixelCacheStorageClass(cache_view->image->cache));
 }
 \f
 /*