From ffaf87e2e4e5508769578770d7dc1e5dfee1743f Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 30 Apr 2013 17:09:30 +0000 Subject: [PATCH] --- MagickCore/cache-private.h | 23 ++++++- MagickCore/cache-view.c | 14 +---- MagickCore/cache.c | 125 +++---------------------------------- 3 files changed, 30 insertions(+), 132 deletions(-) diff --git a/MagickCore/cache-private.h b/MagickCore/cache-private.h index b106cc6c26..9b89131394 100644 --- a/MagickCore/cache-private.h +++ b/MagickCore/cache-private.h @@ -102,7 +102,26 @@ typedef struct _CacheMethods } CacheMethods; typedef struct _NexusInfo - NexusInfo; +{ + MagickBooleanType + mapped; + + RectangleInfo + region; + + MagickSizeType + length; + + Quantum + *cache, + *pixels; + + void + *metacontent; + + size_t + signature; +} NexusInfo; typedef struct _CacheInfo { @@ -238,7 +257,6 @@ extern MagickPrivate NexusInfo extern MagickPrivate Quantum *GetAuthenticPixelCacheNexus(Image *,const ssize_t,const ssize_t, const size_t,const size_t,NexusInfo *,ExceptionInfo *) magick_hot_spot, - *GetPixelCacheNexusPixels(const Cache,NexusInfo *), *QueueAuthenticPixelCacheNexus(Image *,const ssize_t,const ssize_t, const size_t,const size_t,const MagickBooleanType,NexusInfo *, ExceptionInfo *) magick_hot_spot; @@ -253,7 +271,6 @@ extern MagickPrivate VirtualPixelMethod extern MagickPrivate void CacheComponentTerminus(void), ClonePixelCacheMethods(Cache,const Cache), - *GetPixelCacheNexusMetacontent(const Cache,NexusInfo *) magick_hot_spot, *GetPixelCachePixels(Image *,MagickSizeType *,ExceptionInfo *), GetPixelCacheTileSize(const Image *,size_t *,size_t *), GetPixelCacheMethods(CacheMethods *), diff --git a/MagickCore/cache-view.c b/MagickCore/cache-view.c index c5eabf4c0d..874e86aa6e 100644 --- a/MagickCore/cache-view.c +++ b/MagickCore/cache-view.c @@ -342,16 +342,11 @@ MagickExport void *GetCacheViewAuthenticMetacontent(CacheView *cache_view) const int id = GetOpenMPThreadId(); - void - *metacontent; - assert(cache_view != (CacheView *) NULL); assert(cache_view->signature == MagickSignature); assert(cache_view->image->cache != (Cache) NULL); assert(id < (int) cache_view->number_threads); - metacontent=GetPixelCacheNexusMetacontent(cache_view->image->cache, - cache_view->nexus_info[id]); - return(metacontent); + return(cache_view->nexus_info[id]->metacontent); } /* @@ -384,16 +379,11 @@ MagickExport Quantum *GetCacheViewAuthenticPixelQueue(CacheView *cache_view) const int id = GetOpenMPThreadId(); - Quantum - *pixels; - assert(cache_view != (CacheView *) NULL); assert(cache_view->signature == MagickSignature); assert(cache_view->image->cache != (Cache) NULL); assert(id < (int) cache_view->number_threads); - pixels=GetPixelCacheNexusPixels(cache_view->image->cache, - cache_view->nexus_info[id]); - return(pixels); + return(cache_view->nexus_info[id]->pixels); } /* diff --git a/MagickCore/cache.c b/MagickCore/cache.c index 70f5cebba0..bcb6a72b04 100644 --- a/MagickCore/cache.c +++ b/MagickCore/cache.c @@ -93,28 +93,6 @@ typedef struct _MagickModulo quotient, remainder; } MagickModulo; - -struct _NexusInfo -{ - MagickBooleanType - mapped; - - RectangleInfo - region; - - MagickSizeType - length; - - Quantum - *cache, - *pixels; - - void - *metacontent; - - size_t - signature; -}; /* Forward declarations. @@ -1006,9 +984,6 @@ MagickExport void *GetAuthenticMetacontent(const Image *image) const int id = GetOpenMPThreadId(); - void - *metacontent; - assert(image != (const Image *) NULL); assert(image->signature == MagickSignature); assert(image->cache != (Cache) NULL); @@ -1017,14 +992,15 @@ MagickExport void *GetAuthenticMetacontent(const Image *image) if (cache_info->methods.get_authentic_metacontent_from_handler != (GetAuthenticMetacontentFromHandler) NULL) { + void + *metacontent; + metacontent=cache_info->methods. get_authentic_metacontent_from_handler(image); return(metacontent); } assert(id < (int) cache_info->number_threads); - metacontent=GetPixelCacheNexusMetacontent(cache_info, - cache_info->nexus_info[id]); - return(metacontent); + return(cache_info->nexus_info[id]->metacontent); } /* @@ -1059,18 +1035,13 @@ static void *GetAuthenticMetacontentFromCache(const Image *image) const int id = GetOpenMPThreadId(); - void - *metacontent; - assert(image != (const Image *) NULL); assert(image->signature == MagickSignature); assert(image->cache != (Cache) NULL); cache_info=(CacheInfo *) image->cache; assert(cache_info->signature == MagickSignature); assert(id < (int) cache_info->number_threads); - metacontent=GetPixelCacheNexusMetacontent(image->cache, - cache_info->nexus_info[id]); - return(metacontent); + return(cache_info->nexus_info[id]->metacontent); } /* @@ -1194,7 +1165,7 @@ static Quantum *GetAuthenticPixelsFromCache(const Image *image) cache_info=(CacheInfo *) image->cache; assert(cache_info->signature == MagickSignature); assert(id < (int) cache_info->number_threads); - return(GetPixelCacheNexusPixels(image->cache,cache_info->nexus_info[id])); + return(cache_info->nexus_info[id]->pixels); } /* @@ -1238,7 +1209,7 @@ MagickExport Quantum *GetAuthenticPixelQueue(const Image *image) (GetAuthenticPixelsFromHandler) NULL) return(cache_info->methods.get_authentic_pixels_from_handler(image)); assert(id < (int) cache_info->number_threads); - return(GetPixelCacheNexusPixels(cache_info,cache_info->nexus_info[id])); + return(cache_info->nexus_info[id]->pixels); } /* @@ -2092,86 +2063,6 @@ MagickPrivate MagickSizeType GetPixelCacheNexusExtent(const Cache cache, % % % % % % -+ G e t P i x e l C a c h e N e x u s M e t a c o n t e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% GetPixelCacheNexusMetacontent() returns the meta-content for the specified -% cache nexus. -% -% The format of the GetPixelCacheNexusMetacontent() method is: -% -% void *GetPixelCacheNexusMetacontent(const Cache cache, -% NexusInfo *nexus_info) -% -% A description of each parameter follows: -% -% o cache: the pixel cache. -% -% o nexus_info: the cache nexus to return the meta-content. -% -*/ -MagickPrivate void *GetPixelCacheNexusMetacontent(const Cache cache, - NexusInfo *nexus_info) -{ - CacheInfo - *cache_info; - - assert(cache != NULL); - cache_info=(CacheInfo *) cache; - assert(cache_info->signature == MagickSignature); - if (cache_info->storage_class == UndefinedClass) - return((void *) NULL); - return(nexus_info->metacontent); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -+ G e t P i x e l C a c h e N e x u s P i x e l s % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% GetPixelCacheNexusPixels() returns the pixels associated with the specified -% cache nexus. -% -% The format of the GetPixelCacheNexusPixels() method is: -% -% Quantum *GetPixelCacheNexusPixels(const Cache cache, -% NexusInfo *nexus_info) -% -% A description of each parameter follows: -% -% o cache: the pixel cache. -% -% o nexus_info: the cache nexus to return the pixels. -% -*/ -MagickPrivate Quantum *GetPixelCacheNexusPixels(const Cache cache, - NexusInfo *nexus_info) -{ - CacheInfo - *cache_info; - - assert(cache != NULL); - cache_info=(CacheInfo *) cache; - assert(cache_info->signature == MagickSignature); - if (cache_info->storage_class == UndefinedClass) - return((Quantum *) NULL); - return(nexus_info->pixels); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t P i x e l C a c h e P i x e l s % % % % % @@ -2690,7 +2581,7 @@ MagickPrivate const Quantum *GetVirtualPixelsFromNexus(const Image *image, /* Pixel request is outside cache extents. */ - s=(unsigned char *) GetPixelCacheNexusMetacontent(cache_info,nexus_info); + s=(unsigned char *) nexus_info->metacontent; virtual_nexus=AcquirePixelCacheNexus(1); if (virtual_nexus == (NexusInfo **) NULL) {