Lines Matching refs:cache_info
188 *magick_restrict cache_info; in AcquirePixelCache() local
193 cache_info=(CacheInfo *) AcquireAlignedMemory(1,sizeof(*cache_info)); in AcquirePixelCache()
194 if (cache_info == (CacheInfo *) NULL) in AcquirePixelCache()
196 (void) memset(cache_info,0,sizeof(*cache_info)); in AcquirePixelCache()
197 cache_info->type=UndefinedCache; in AcquirePixelCache()
198 cache_info->mode=IOMode; in AcquirePixelCache()
199 cache_info->disk_mode=IOMode; in AcquirePixelCache()
200 cache_info->colorspace=sRGBColorspace; in AcquirePixelCache()
201 cache_info->file=(-1); in AcquirePixelCache()
202 cache_info->id=GetMagickThreadId(); in AcquirePixelCache()
203 cache_info->number_threads=number_threads; in AcquirePixelCache()
204 if (GetOpenMPMaximumThreads() > cache_info->number_threads) in AcquirePixelCache()
205 cache_info->number_threads=GetOpenMPMaximumThreads(); in AcquirePixelCache()
206 if (GetMagickResourceLimit(ThreadResource) > cache_info->number_threads) in AcquirePixelCache()
207 cache_info->number_threads=(size_t) GetMagickResourceLimit(ThreadResource); in AcquirePixelCache()
208 if (cache_info->number_threads == 0) in AcquirePixelCache()
209 cache_info->number_threads=1; in AcquirePixelCache()
210 cache_info->nexus_info=AcquirePixelCacheNexus(cache_info->number_threads); in AcquirePixelCache()
211 if (cache_info->nexus_info == (NexusInfo **) NULL) in AcquirePixelCache()
216 cache_info->synchronize=IsStringTrue(value); in AcquirePixelCache()
222 cache_info->synchronize=IsStringTrue(value); in AcquirePixelCache()
225 cache_info->semaphore=AcquireSemaphoreInfo(); in AcquirePixelCache()
226 cache_info->reference_count=1; in AcquirePixelCache()
227 cache_info->file_semaphore=AcquireSemaphoreInfo(); in AcquirePixelCache()
228 cache_info->debug=IsEventLogging(); in AcquirePixelCache()
229 cache_info->signature=MagickCoreSignature; in AcquirePixelCache()
230 return((Cache ) cache_info); in AcquirePixelCache()
312 *magick_restrict cache_info; in AcquirePixelCachePixels() local
319 cache_info=(CacheInfo *) image->cache; in AcquirePixelCachePixels()
320 assert(cache_info->signature == MagickCoreSignature); in AcquirePixelCachePixels()
322 if ((cache_info->type != MemoryCache) && (cache_info->type != MapCache)) in AcquirePixelCachePixels()
324 *length=(size_t) cache_info->length; in AcquirePixelCachePixels()
325 return(cache_info->pixels); in AcquirePixelCachePixels()
412 *magick_restrict cache_info; in ClipPixelCacheNexus() local
434 cache_info=(CacheInfo *) image->cache; in ClipPixelCacheNexus()
435 if (cache_info == (Cache) NULL) in ClipPixelCacheNexus()
506 *magick_restrict cache_info; in ClonePixelCache() local
509 cache_info=(const CacheInfo *) cache; in ClonePixelCache()
510 assert(cache_info->signature == MagickCoreSignature); in ClonePixelCache()
511 if (cache_info->debug != MagickFalse) in ClonePixelCache()
513 cache_info->filename); in ClonePixelCache()
514 clone_info=(CacheInfo *) AcquirePixelCache(cache_info->number_threads); in ClonePixelCache()
515 clone_info->virtual_pixel_method=cache_info->virtual_pixel_method; in ClonePixelCache()
547 *magick_restrict cache_info, in ClonePixelCacheMethods() local
557 cache_info=(CacheInfo *) cache; in ClonePixelCacheMethods()
558 assert(cache_info->signature == MagickCoreSignature); in ClonePixelCacheMethods()
559 source_info->methods=cache_info->methods; in ClonePixelCacheMethods()
592 CacheInfo *magick_restrict cache_info,CacheInfo *magick_restrict clone_info) in ClonePixelCacheOnDisk() argument
612 if ((OpenPixelCacheOnDisk(cache_info,ReadMode) == MagickFalse) || in ClonePixelCacheOnDisk()
615 if ((lseek(cache_info->file,0,SEEK_SET) < 0) || in ClonePixelCacheOnDisk()
619 if ((fstat(cache_info->file,&file_stats) == 0) && (file_stats.st_size > 0)) in ClonePixelCacheOnDisk()
625 while ((count=read(cache_info->file,buffer,quantum)) > 0) in ClonePixelCacheOnDisk()
636 if (extent != cache_info->length) in ClonePixelCacheOnDisk()
642 CacheInfo *magick_restrict clone_info,CacheInfo *magick_restrict cache_info, in ClonePixelCacheRepository() argument
667 assert(cache_info != (CacheInfo *) NULL); in ClonePixelCacheRepository()
670 if (cache_info->type == PingCache) in ClonePixelCacheRepository()
672 length=cache_info->number_channels*sizeof(*cache_info->channel_map); in ClonePixelCacheRepository()
673 if ((cache_info->storage_class == clone_info->storage_class) && in ClonePixelCacheRepository()
674 (cache_info->colorspace == clone_info->colorspace) && in ClonePixelCacheRepository()
675 (cache_info->alpha_trait == clone_info->alpha_trait) && in ClonePixelCacheRepository()
676 (cache_info->channels == clone_info->channels) && in ClonePixelCacheRepository()
677 (cache_info->columns == clone_info->columns) && in ClonePixelCacheRepository()
678 (cache_info->rows == clone_info->rows) && in ClonePixelCacheRepository()
679 (cache_info->number_channels == clone_info->number_channels) && in ClonePixelCacheRepository()
680 (memcmp(cache_info->channel_map,clone_info->channel_map,length) == 0) && in ClonePixelCacheRepository()
681 (cache_info->metacontent_extent == clone_info->metacontent_extent)) in ClonePixelCacheRepository()
686 if (((cache_info->type == MemoryCache) || in ClonePixelCacheRepository()
687 (cache_info->type == MapCache)) && in ClonePixelCacheRepository()
690 (void) memcpy(clone_info->pixels,cache_info->pixels, in ClonePixelCacheRepository()
691 cache_info->number_channels*cache_info->columns*cache_info->rows* in ClonePixelCacheRepository()
692 sizeof(*cache_info->pixels)); in ClonePixelCacheRepository()
693 if ((cache_info->metacontent_extent != 0) && in ClonePixelCacheRepository()
695 (void) memcpy(clone_info->metacontent,cache_info->metacontent, in ClonePixelCacheRepository()
696 cache_info->columns*cache_info->rows* in ClonePixelCacheRepository()
700 if ((cache_info->type == DiskCache) && (clone_info->type == DiskCache)) in ClonePixelCacheRepository()
701 return(ClonePixelCacheOnDisk(cache_info,clone_info)); in ClonePixelCacheRepository()
708 length=cache_info->number_channels*sizeof(*cache_info->channel_map); in ClonePixelCacheRepository()
709 optimize=(cache_info->number_channels == clone_info->number_channels) && in ClonePixelCacheRepository()
710 (memcmp(cache_info->channel_map,clone_info->channel_map,length) == 0) ? in ClonePixelCacheRepository()
712 length=(size_t) MagickMin(cache_info->number_channels*cache_info->columns, in ClonePixelCacheRepository()
717 cache_number_threads(cache_info,clone_info,cache_info->rows,1) in ClonePixelCacheRepository()
719 for (y=0; y < (ssize_t) cache_info->rows; y++) in ClonePixelCacheRepository()
737 region.width=cache_info->columns; in ClonePixelCacheRepository()
741 pixels=SetPixelCacheNexusPixels(cache_info,ReadMode,®ion,MagickFalse, in ClonePixelCacheRepository()
745 status=ReadPixelCachePixels(cache_info,cache_nexus[id],exception); in ClonePixelCacheRepository()
770 for (x=0; x < (ssize_t) cache_info->columns; x++) in ClonePixelCacheRepository()
786 traits=cache_info->channel_map[channel].traits; in ClonePixelCacheRepository()
788 *q=*(p+cache_info->channel_map[channel].offset); in ClonePixelCacheRepository()
791 p+=cache_info->number_channels; in ClonePixelCacheRepository()
796 if ((cache_info->metacontent_extent != 0) && in ClonePixelCacheRepository()
802 length=(size_t) MagickMin(cache_info->metacontent_extent, in ClonePixelCacheRepository()
806 cache_number_threads(cache_info,clone_info,cache_info->rows,1) in ClonePixelCacheRepository()
808 for (y=0; y < (ssize_t) cache_info->rows; y++) in ClonePixelCacheRepository()
823 region.width=cache_info->columns; in ClonePixelCacheRepository()
827 pixels=SetPixelCacheNexusPixels(cache_info,ReadMode,®ion,MagickFalse, in ClonePixelCacheRepository()
831 status=ReadPixelCacheMetacontent(cache_info,cache_nexus[id],exception); in ClonePixelCacheRepository()
848 if (cache_info->debug != MagickFalse) in ClonePixelCacheRepository()
854 CommandOptionToMnemonic(MagickCacheOptions,(ssize_t) cache_info->type), in ClonePixelCacheRepository()
918 *magick_restrict cache_info; in DestroyImagePixels() local
925 cache_info=(CacheInfo *) image->cache; in DestroyImagePixels()
926 assert(cache_info->signature == MagickCoreSignature); in DestroyImagePixels()
927 if (cache_info->methods.destroy_pixel_handler != (DestroyPixelHandler) NULL) in DestroyImagePixels()
929 cache_info->methods.destroy_pixel_handler(image); in DestroyImagePixels()
958 static MagickBooleanType ClosePixelCacheOnDisk(CacheInfo *cache_info) in ClosePixelCacheOnDisk() argument
964 if (cache_info->file != -1) in ClosePixelCacheOnDisk()
966 status=close(cache_info->file); in ClosePixelCacheOnDisk()
967 cache_info->file=(-1); in ClosePixelCacheOnDisk()
973 static inline void RelinquishPixelCachePixels(CacheInfo *cache_info) in RelinquishPixelCachePixels() argument
975 switch (cache_info->type) in RelinquishPixelCachePixels()
980 if (cache_info->opencl != (MagickCLCacheInfo) NULL) in RelinquishPixelCachePixels()
982 cache_info->opencl=RelinquishMagickCLCacheInfo(cache_info->opencl, in RelinquishPixelCachePixels()
984 cache_info->pixels=(Quantum *) NULL; in RelinquishPixelCachePixels()
988 if (cache_info->mapped == MagickFalse) in RelinquishPixelCachePixels()
989 cache_info->pixels=(Quantum *) RelinquishAlignedMemory( in RelinquishPixelCachePixels()
990 cache_info->pixels); in RelinquishPixelCachePixels()
992 (void) UnmapBlob(cache_info->pixels,(size_t) cache_info->length); in RelinquishPixelCachePixels()
993 RelinquishMagickResource(MemoryResource,cache_info->length); in RelinquishPixelCachePixels()
998 (void) UnmapBlob(cache_info->pixels,(size_t) cache_info->length); in RelinquishPixelCachePixels()
999 cache_info->pixels=(Quantum *) NULL; in RelinquishPixelCachePixels()
1000 if ((cache_info->mode != ReadMode) && (cache_info->mode != PersistMode)) in RelinquishPixelCachePixels()
1001 (void) RelinquishUniqueFileResource(cache_info->cache_filename); in RelinquishPixelCachePixels()
1002 *cache_info->cache_filename='\0'; in RelinquishPixelCachePixels()
1003 RelinquishMagickResource(MapResource,cache_info->length); in RelinquishPixelCachePixels()
1007 if (cache_info->file != -1) in RelinquishPixelCachePixels()
1008 (void) ClosePixelCacheOnDisk(cache_info); in RelinquishPixelCachePixels()
1009 if ((cache_info->mode != ReadMode) && (cache_info->mode != PersistMode)) in RelinquishPixelCachePixels()
1010 (void) RelinquishUniqueFileResource(cache_info->cache_filename); in RelinquishPixelCachePixels()
1011 *cache_info->cache_filename='\0'; in RelinquishPixelCachePixels()
1012 RelinquishMagickResource(DiskResource,cache_info->length); in RelinquishPixelCachePixels()
1017 *cache_info->cache_filename='\0'; in RelinquishPixelCachePixels()
1019 cache_info->server_info); in RelinquishPixelCachePixels()
1025 cache_info->type=UndefinedCache; in RelinquishPixelCachePixels()
1026 cache_info->mapped=MagickFalse; in RelinquishPixelCachePixels()
1027 cache_info->metacontent=(void *) NULL; in RelinquishPixelCachePixels()
1033 *magick_restrict cache_info; in DestroyPixelCache() local
1036 cache_info=(CacheInfo *) cache; in DestroyPixelCache()
1037 assert(cache_info->signature == MagickCoreSignature); in DestroyPixelCache()
1038 if (cache_info->debug != MagickFalse) in DestroyPixelCache()
1040 cache_info->filename); in DestroyPixelCache()
1041 LockSemaphoreInfo(cache_info->semaphore); in DestroyPixelCache()
1042 cache_info->reference_count--; in DestroyPixelCache()
1043 if (cache_info->reference_count != 0) in DestroyPixelCache()
1045 UnlockSemaphoreInfo(cache_info->semaphore); in DestroyPixelCache()
1048 UnlockSemaphoreInfo(cache_info->semaphore); in DestroyPixelCache()
1049 if (cache_info->debug != MagickFalse) in DestroyPixelCache()
1055 cache_info->filename); in DestroyPixelCache()
1058 RelinquishPixelCachePixels(cache_info); in DestroyPixelCache()
1059 if (cache_info->server_info != (DistributeCacheInfo *) NULL) in DestroyPixelCache()
1060 cache_info->server_info=DestroyDistributeCacheInfo((DistributeCacheInfo *) in DestroyPixelCache()
1061 cache_info->server_info); in DestroyPixelCache()
1062 if (cache_info->nexus_info != (NexusInfo **) NULL) in DestroyPixelCache()
1063 cache_info->nexus_info=DestroyPixelCacheNexus(cache_info->nexus_info, in DestroyPixelCache()
1064 cache_info->number_threads); in DestroyPixelCache()
1065 if (cache_info->random_info != (RandomInfo *) NULL) in DestroyPixelCache()
1066 cache_info->random_info=DestroyRandomInfo(cache_info->random_info); in DestroyPixelCache()
1067 if (cache_info->file_semaphore != (SemaphoreInfo *) NULL) in DestroyPixelCache()
1068 RelinquishSemaphoreInfo(&cache_info->file_semaphore); in DestroyPixelCache()
1069 if (cache_info->semaphore != (SemaphoreInfo *) NULL) in DestroyPixelCache()
1070 RelinquishSemaphoreInfo(&cache_info->semaphore); in DestroyPixelCache()
1071 cache_info->signature=(~MagickCoreSignature); in DestroyPixelCache()
1072 cache_info=(CacheInfo *) RelinquishAlignedMemory(cache_info); in DestroyPixelCache()
1161 *magick_restrict cache_info; in GetAuthenticMetacontent() local
1169 cache_info=(CacheInfo *) image->cache; in GetAuthenticMetacontent()
1170 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticMetacontent()
1171 if (cache_info->methods.get_authentic_metacontent_from_handler != in GetAuthenticMetacontent()
1177 metacontent=cache_info->methods. in GetAuthenticMetacontent()
1181 assert(id < (int) cache_info->number_threads); in GetAuthenticMetacontent()
1182 return(cache_info->nexus_info[id]->metacontent); in GetAuthenticMetacontent()
1212 *magick_restrict cache_info; in GetAuthenticMetacontentFromCache() local
1220 cache_info=(CacheInfo *) image->cache; in GetAuthenticMetacontentFromCache()
1221 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticMetacontentFromCache()
1222 assert(id < (int) cache_info->number_threads); in GetAuthenticMetacontentFromCache()
1223 return(cache_info->nexus_info[id]->metacontent); in GetAuthenticMetacontentFromCache()
1259 *magick_restrict cache_info; in GetAuthenticOpenCLBuffer() local
1263 cache_info=(CacheInfo *) image->cache; in GetAuthenticOpenCLBuffer()
1264 if ((cache_info->type == UndefinedCache) || (cache_info->reference_count > 1)) in GetAuthenticOpenCLBuffer()
1267 cache_info=(CacheInfo *) image->cache; in GetAuthenticOpenCLBuffer()
1269 if ((cache_info->type != MemoryCache) || (cache_info->mapped != MagickFalse)) in GetAuthenticOpenCLBuffer()
1271 LockSemaphoreInfo(cache_info->semaphore); in GetAuthenticOpenCLBuffer()
1272 if ((cache_info->opencl != (MagickCLCacheInfo) NULL) && in GetAuthenticOpenCLBuffer()
1273 (cache_info->opencl->device->context != device->context)) in GetAuthenticOpenCLBuffer()
1274 cache_info->opencl=CopyMagickCLCacheInfo(cache_info->opencl); in GetAuthenticOpenCLBuffer()
1275 if (cache_info->opencl == (MagickCLCacheInfo) NULL) in GetAuthenticOpenCLBuffer()
1277 assert(cache_info->pixels != (Quantum *) NULL); in GetAuthenticOpenCLBuffer()
1278 cache_info->opencl=AcquireMagickCLCacheInfo(device,cache_info->pixels, in GetAuthenticOpenCLBuffer()
1279 cache_info->length); in GetAuthenticOpenCLBuffer()
1281 if (cache_info->opencl != (MagickCLCacheInfo) NULL) in GetAuthenticOpenCLBuffer()
1282 RetainOpenCLMemObject(cache_info->opencl->buffer); in GetAuthenticOpenCLBuffer()
1283 UnlockSemaphoreInfo(cache_info->semaphore); in GetAuthenticOpenCLBuffer()
1284 if (cache_info->opencl == (MagickCLCacheInfo) NULL) in GetAuthenticOpenCLBuffer()
1286 assert(cache_info->opencl->pixels == cache_info->pixels); in GetAuthenticOpenCLBuffer()
1287 return(cache_info->opencl->buffer); in GetAuthenticOpenCLBuffer()
1331 *magick_restrict cache_info; in GetAuthenticPixelCacheNexus() local
1345 cache_info=(CacheInfo *) image->cache; in GetAuthenticPixelCacheNexus()
1346 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticPixelCacheNexus()
1349 if (ReadPixelCachePixels(cache_info,nexus_info,exception) == MagickFalse) in GetAuthenticPixelCacheNexus()
1351 if (cache_info->metacontent_extent != 0) in GetAuthenticPixelCacheNexus()
1352 if (ReadPixelCacheMetacontent(cache_info,nexus_info,exception) == MagickFalse) in GetAuthenticPixelCacheNexus()
1383 *magick_restrict cache_info; in GetAuthenticPixelsFromCache() local
1391 cache_info=(CacheInfo *) image->cache; in GetAuthenticPixelsFromCache()
1392 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticPixelsFromCache()
1393 assert(id < (int) cache_info->number_threads); in GetAuthenticPixelsFromCache()
1394 return(cache_info->nexus_info[id]->pixels); in GetAuthenticPixelsFromCache()
1424 *magick_restrict cache_info; in GetAuthenticPixelQueue() local
1432 cache_info=(CacheInfo *) image->cache; in GetAuthenticPixelQueue()
1433 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticPixelQueue()
1434 if (cache_info->methods.get_authentic_pixels_from_handler != in GetAuthenticPixelQueue()
1436 return(cache_info->methods.get_authentic_pixels_from_handler(image)); in GetAuthenticPixelQueue()
1437 assert(id < (int) cache_info->number_threads); in GetAuthenticPixelQueue()
1438 return(cache_info->nexus_info[id]->pixels); in GetAuthenticPixelQueue()
1491 *magick_restrict cache_info; in GetAuthenticPixels() local
1502 cache_info=(CacheInfo *) image->cache; in GetAuthenticPixels()
1503 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticPixels()
1504 if (cache_info->methods.get_authentic_pixels_handler != in GetAuthenticPixels()
1507 pixels=cache_info->methods.get_authentic_pixels_handler(image,x,y,columns, in GetAuthenticPixels()
1511 assert(id < (int) cache_info->number_threads); in GetAuthenticPixels()
1513 cache_info->nexus_info[id],exception); in GetAuthenticPixels()
1553 *magick_restrict cache_info; in GetAuthenticPixelsCache() local
1564 cache_info=(CacheInfo *) image->cache; in GetAuthenticPixelsCache()
1565 if (cache_info == (Cache) NULL) in GetAuthenticPixelsCache()
1567 assert(cache_info->signature == MagickCoreSignature); in GetAuthenticPixelsCache()
1568 assert(id < (int) cache_info->number_threads); in GetAuthenticPixelsCache()
1570 cache_info->nexus_info[id],exception); in GetAuthenticPixelsCache()
1600 *magick_restrict cache_info; in GetImageExtent() local
1610 cache_info=(CacheInfo *) image->cache; in GetImageExtent()
1611 assert(cache_info->signature == MagickCoreSignature); in GetImageExtent()
1612 assert(id < (int) cache_info->number_threads); in GetImageExtent()
1613 return(GetPixelCacheNexusExtent(cache_info,cache_info->nexus_info[id])); in GetImageExtent()
1650 *magick_restrict cache_info; in ValidatePixelCacheMorphology() local
1659 cache_info=(CacheInfo *) image->cache; in ValidatePixelCacheMorphology()
1661 q=cache_info->channel_map; in ValidatePixelCacheMorphology()
1662 if ((image->storage_class != cache_info->storage_class) || in ValidatePixelCacheMorphology()
1663 (image->colorspace != cache_info->colorspace) || in ValidatePixelCacheMorphology()
1664 (image->alpha_trait != cache_info->alpha_trait) || in ValidatePixelCacheMorphology()
1665 (image->channels != cache_info->channels) || in ValidatePixelCacheMorphology()
1666 (image->columns != cache_info->columns) || in ValidatePixelCacheMorphology()
1667 (image->rows != cache_info->rows) || in ValidatePixelCacheMorphology()
1668 (image->number_channels != cache_info->number_channels) || in ValidatePixelCacheMorphology()
1670 (image->metacontent_extent != cache_info->metacontent_extent) || in ValidatePixelCacheMorphology()
1671 (cache_info->nexus_info == (NexusInfo **) NULL)) in ValidatePixelCacheMorphology()
1680 *magick_restrict cache_info; in GetImagePixelCache() local
1710 cache_info=(CacheInfo *) image->cache; in GetImagePixelCache()
1711 if (cache_info->file != -1) in GetImagePixelCache()
1712 (void) ClosePixelCacheOnDisk(cache_info); in GetImagePixelCache()
1717 cache_info=(CacheInfo *) image->cache; in GetImagePixelCache()
1719 CopyOpenCLBuffer(cache_info); in GetImagePixelCache()
1722 if ((cache_info->reference_count > 1) || (cache_info->mode == ReadMode)) in GetImagePixelCache()
1724 LockSemaphoreInfo(cache_info->semaphore); in GetImagePixelCache()
1725 if ((cache_info->reference_count > 1) || (cache_info->mode == ReadMode)) in GetImagePixelCache()
1739 clone_image.cache=ClonePixelCache(cache_info); in GetImagePixelCache()
1747 status=ClonePixelCacheRepository(clone_info,cache_info, in GetImagePixelCache()
1759 UnlockSemaphoreInfo(cache_info->semaphore); in GetImagePixelCache()
1762 cache_info=(CacheInfo *) DestroyPixelCache(cache_info); in GetImagePixelCache()
1772 cache_info=(CacheInfo *) image->cache; in GetImagePixelCache()
1773 if (cache_info->file != -1) in GetImagePixelCache()
1774 (void) ClosePixelCacheOnDisk(cache_info); in GetImagePixelCache()
1809 *magick_restrict cache_info; in GetImagePixelCacheType() local
1814 cache_info=(CacheInfo *) image->cache; in GetImagePixelCacheType()
1815 assert(cache_info->signature == MagickCoreSignature); in GetImagePixelCacheType()
1816 return(cache_info->type); in GetImagePixelCacheType()
1881 *magick_restrict cache_info; in GetOneAuthenticPixel() local
1889 cache_info=(CacheInfo *) image->cache; in GetOneAuthenticPixel()
1890 assert(cache_info->signature == MagickCoreSignature); in GetOneAuthenticPixel()
1892 …if (cache_info->methods.get_one_authentic_pixel_from_handler != (GetOneAuthenticPixelFromHandler) … in GetOneAuthenticPixel()
1893 return(cache_info->methods.get_one_authentic_pixel_from_handler(image,x,y,pixel,exception)); in GetOneAuthenticPixel()
1933 *magick_restrict cache_info; in GetOneAuthenticPixelFromCache() local
1944 cache_info=(CacheInfo *) image->cache; in GetOneAuthenticPixelFromCache()
1945 assert(cache_info->signature == MagickCoreSignature); in GetOneAuthenticPixelFromCache()
1946 assert(id < (int) cache_info->number_threads); in GetOneAuthenticPixelFromCache()
1948 q=GetAuthenticPixelCacheNexus(image,x,y,1UL,1UL,cache_info->nexus_info[id], in GetOneAuthenticPixelFromCache()
1988 *magick_restrict cache_info; in GetOneVirtualPixel() local
1999 cache_info=(CacheInfo *) image->cache; in GetOneVirtualPixel()
2000 assert(cache_info->signature == MagickCoreSignature); in GetOneVirtualPixel()
2002 if (cache_info->methods.get_one_virtual_pixel_from_handler != in GetOneVirtualPixel()
2004 return(cache_info->methods.get_one_virtual_pixel_from_handler(image, in GetOneVirtualPixel()
2006 assert(id < (int) cache_info->number_threads); in GetOneVirtualPixel()
2008 1UL,1UL,cache_info->nexus_info[id],exception); in GetOneVirtualPixel()
2051 *magick_restrict cache_info; in GetOneVirtualPixelFromCache() local
2062 cache_info=(CacheInfo *) image->cache; in GetOneVirtualPixelFromCache()
2063 assert(cache_info->signature == MagickCoreSignature); in GetOneVirtualPixelFromCache()
2064 assert(id < (int) cache_info->number_threads); in GetOneVirtualPixelFromCache()
2067 cache_info->nexus_info[id],exception); in GetOneVirtualPixelFromCache()
2110 *magick_restrict cache_info; in GetOneVirtualPixelInfo() local
2121 cache_info=(CacheInfo *) image->cache; in GetOneVirtualPixelInfo()
2122 assert(cache_info->signature == MagickCoreSignature); in GetOneVirtualPixelInfo()
2123 assert(id < (int) cache_info->number_threads); in GetOneVirtualPixelInfo()
2126 cache_info->nexus_info[id],exception); in GetOneVirtualPixelInfo()
2158 *magick_restrict cache_info; in GetPixelCacheColorspace() local
2161 cache_info=(CacheInfo *) cache; in GetPixelCacheColorspace()
2162 assert(cache_info->signature == MagickCoreSignature); in GetPixelCacheColorspace()
2163 if (cache_info->debug != MagickFalse) in GetPixelCacheColorspace()
2165 cache_info->filename); in GetPixelCacheColorspace()
2166 return(cache_info->colorspace); in GetPixelCacheColorspace()
2195 *magick_restrict cache_info; in GetPixelCacheFilename() local
2200 cache_info=(CacheInfo *) image->cache; in GetPixelCacheFilename()
2201 assert(cache_info->signature == MagickCoreSignature); in GetPixelCacheFilename()
2202 return(cache_info->cache_filename); in GetPixelCacheFilename()
2276 *magick_restrict cache_info; in GetPixelCacheNexusExtent() local
2282 cache_info=(CacheInfo *) cache; in GetPixelCacheNexusExtent()
2283 assert(cache_info->signature == MagickCoreSignature); in GetPixelCacheNexusExtent()
2286 return((MagickSizeType) cache_info->columns*cache_info->rows); in GetPixelCacheNexusExtent()
2321 *magick_restrict cache_info; in GetPixelCachePixels() local
2329 cache_info=(CacheInfo *) image->cache; in GetPixelCachePixels()
2330 assert(cache_info->signature == MagickCoreSignature); in GetPixelCachePixels()
2331 *length=cache_info->length; in GetPixelCachePixels()
2332 if ((cache_info->type != MemoryCache) && (cache_info->type != MapCache)) in GetPixelCachePixels()
2334 return((void *) cache_info->pixels); in GetPixelCachePixels()
2364 *magick_restrict cache_info; in GetPixelCacheStorageClass() local
2367 cache_info=(CacheInfo *) cache; in GetPixelCacheStorageClass()
2368 assert(cache_info->signature == MagickCoreSignature); in GetPixelCacheStorageClass()
2369 if (cache_info->debug != MagickFalse) in GetPixelCacheStorageClass()
2371 cache_info->filename); in GetPixelCacheStorageClass()
2372 return(cache_info->storage_class); in GetPixelCacheStorageClass()
2406 *magick_restrict cache_info; in GetPixelCacheTileSize() local
2412 cache_info=(CacheInfo *) image->cache; in GetPixelCacheTileSize()
2413 assert(cache_info->signature == MagickCoreSignature); in GetPixelCacheTileSize()
2414 *width=2048UL/(cache_info->number_channels*sizeof(Quantum)); in GetPixelCacheTileSize()
2416 *width=8192UL/(cache_info->number_channels*sizeof(Quantum)); in GetPixelCacheTileSize()
2447 *magick_restrict cache_info; in GetPixelCacheVirtualMethod() local
2452 cache_info=(CacheInfo *) image->cache; in GetPixelCacheVirtualMethod()
2453 assert(cache_info->signature == MagickCoreSignature); in GetPixelCacheVirtualMethod()
2454 return(cache_info->virtual_pixel_method); in GetPixelCacheVirtualMethod()
2483 *magick_restrict cache_info; in GetVirtualMetacontentFromCache() local
2494 cache_info=(CacheInfo *) image->cache; in GetVirtualMetacontentFromCache()
2495 assert(cache_info->signature == MagickCoreSignature); in GetVirtualMetacontentFromCache()
2496 assert(id < (int) cache_info->number_threads); in GetVirtualMetacontentFromCache()
2497 metacontent=GetVirtualMetacontentFromNexus(cache_info, in GetVirtualMetacontentFromCache()
2498 cache_info->nexus_info[id]); in GetVirtualMetacontentFromCache()
2532 *magick_restrict cache_info; in GetVirtualMetacontentFromNexus() local
2535 cache_info=(CacheInfo *) cache; in GetVirtualMetacontentFromNexus()
2536 assert(cache_info->signature == MagickCoreSignature); in GetVirtualMetacontentFromNexus()
2537 if (cache_info->storage_class == UndefinedClass) in GetVirtualMetacontentFromNexus()
2569 *magick_restrict cache_info; in GetVirtualMetacontent() local
2580 cache_info=(CacheInfo *) image->cache; in GetVirtualMetacontent()
2581 assert(cache_info->signature == MagickCoreSignature); in GetVirtualMetacontent()
2582 metacontent=cache_info->methods.get_virtual_metacontent_from_handler(image); in GetVirtualMetacontent()
2585 assert(id < (int) cache_info->number_threads); in GetVirtualMetacontent()
2586 metacontent=GetVirtualMetacontentFromNexus(cache_info, in GetVirtualMetacontent()
2587 cache_info->nexus_info[id]); in GetVirtualMetacontent()
2721 *magick_restrict cache_info; in GetVirtualPixelCacheNexus() local
2768 cache_info=(CacheInfo *) image->cache; in GetVirtualPixelCacheNexus()
2769 assert(cache_info->signature == MagickCoreSignature); in GetVirtualPixelCacheNexus()
2770 if (cache_info->type == UndefinedCache) in GetVirtualPixelCacheNexus()
2773 CopyOpenCLBuffer(cache_info); in GetVirtualPixelCacheNexus()
2779 pixels=SetPixelCacheNexusPixels(cache_info,ReadMode,®ion, in GetVirtualPixelCacheNexus()
2786 offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ in GetVirtualPixelCacheNexus()
2788 length=(MagickSizeType) (nexus_info->region.height-1L)*cache_info->columns+ in GetVirtualPixelCacheNexus()
2790 number_pixels=(MagickSizeType) cache_info->columns*cache_info->rows; in GetVirtualPixelCacheNexus()
2792 if ((x >= 0) && ((ssize_t) (x+columns) <= (ssize_t) cache_info->columns) && in GetVirtualPixelCacheNexus()
2793 (y >= 0) && ((ssize_t) (y+rows) <= (ssize_t) cache_info->rows)) in GetVirtualPixelCacheNexus()
2803 status=ReadPixelCachePixels(cache_info,nexus_info,exception); in GetVirtualPixelCacheNexus()
2806 if (cache_info->metacontent_extent != 0) in GetVirtualPixelCacheNexus()
2808 status=ReadPixelCacheMetacontent(cache_info,nexus_info,exception); in GetVirtualPixelCacheNexus()
2819 (void) memset(virtual_pixel,0,cache_info->number_channels* in GetVirtualPixelCacheNexus()
2835 if (cache_info->metacontent_extent != 0) in GetVirtualPixelCacheNexus()
2841 cache_info->metacontent_extent); in GetVirtualPixelCacheNexus()
2849 (void) memset(virtual_metacontent,0,cache_info->metacontent_extent); in GetVirtualPixelCacheNexus()
2855 for (i=0; i < (ssize_t) cache_info->number_channels; i++) in GetVirtualPixelCacheNexus()
2862 for (i=0; i < (ssize_t) cache_info->number_channels; i++) in GetVirtualPixelCacheNexus()
2870 for (i=0; i < (ssize_t) cache_info->number_channels; i++) in GetVirtualPixelCacheNexus()
2878 for (i=0; i < (ssize_t) cache_info->number_channels; i++) in GetVirtualPixelCacheNexus()
2911 y_offset=EdgeY(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
2918 length=(MagickSizeType) MagickMin(cache_info->columns-x_offset,columns-u); in GetVirtualPixelCacheNexus()
2919 if (((x_offset < 0) || (x_offset >= (ssize_t) cache_info->columns)) || in GetVirtualPixelCacheNexus()
2920 ((y_offset < 0) || (y_offset >= (ssize_t) cache_info->rows)) || in GetVirtualPixelCacheNexus()
2937 EdgeX(x_offset,cache_info->columns), in GetVirtualPixelCacheNexus()
2938 EdgeY(y_offset,cache_info->rows),1UL,1UL,*virtual_nexus, in GetVirtualPixelCacheNexus()
2940 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
2945 if (cache_info->random_info == (RandomInfo *) NULL) in GetVirtualPixelCacheNexus()
2946 cache_info->random_info=AcquireRandomInfo(); in GetVirtualPixelCacheNexus()
2948 RandomX(cache_info->random_info,cache_info->columns), in GetVirtualPixelCacheNexus()
2949 RandomY(cache_info->random_info,cache_info->rows),1UL,1UL, in GetVirtualPixelCacheNexus()
2951 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
2957 DitherX(x_offset,cache_info->columns), in GetVirtualPixelCacheNexus()
2958 DitherY(y_offset,cache_info->rows),1UL,1UL,*virtual_nexus, in GetVirtualPixelCacheNexus()
2960 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
2965 x_modulo=VirtualPixelModulo(x_offset,cache_info->columns); in GetVirtualPixelCacheNexus()
2966 y_modulo=VirtualPixelModulo(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
2970 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
2975 x_modulo=VirtualPixelModulo(x_offset,cache_info->columns); in GetVirtualPixelCacheNexus()
2977 x_modulo.remainder=(ssize_t) cache_info->columns- in GetVirtualPixelCacheNexus()
2979 y_modulo=VirtualPixelModulo(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
2981 y_modulo.remainder=(ssize_t) cache_info->rows- in GetVirtualPixelCacheNexus()
2986 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
2991 x_modulo=VirtualPixelModulo(x_offset,cache_info->columns); in GetVirtualPixelCacheNexus()
2993 x_modulo.remainder,EdgeY(y_offset,cache_info->rows),1UL,1UL, in GetVirtualPixelCacheNexus()
2995 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
3000 y_modulo=VirtualPixelModulo(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
3002 EdgeX(x_offset,cache_info->columns),y_modulo.remainder,1UL,1UL, in GetVirtualPixelCacheNexus()
3004 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
3020 x_modulo=VirtualPixelModulo(x_offset,cache_info->columns); in GetVirtualPixelCacheNexus()
3021 y_modulo=VirtualPixelModulo(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
3031 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
3036 if ((y_offset < 0) || (y_offset >= (ssize_t) cache_info->rows)) in GetVirtualPixelCacheNexus()
3042 x_modulo=VirtualPixelModulo(x_offset,cache_info->columns); in GetVirtualPixelCacheNexus()
3043 y_modulo=VirtualPixelModulo(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
3047 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
3052 if ((x_offset < 0) || (x_offset >= (ssize_t) cache_info->columns)) in GetVirtualPixelCacheNexus()
3058 x_modulo=VirtualPixelModulo(x_offset,cache_info->columns); in GetVirtualPixelCacheNexus()
3059 y_modulo=VirtualPixelModulo(y_offset,cache_info->rows); in GetVirtualPixelCacheNexus()
3063 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
3069 (void) memcpy(q,p,(size_t) (cache_info->number_channels*length* in GetVirtualPixelCacheNexus()
3071 q+=cache_info->number_channels; in GetVirtualPixelCacheNexus()
3074 (void) memcpy(s,r,(size_t) cache_info->metacontent_extent); in GetVirtualPixelCacheNexus()
3075 s+=cache_info->metacontent_extent; in GetVirtualPixelCacheNexus()
3086 r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus); in GetVirtualPixelCacheNexus()
3087 (void) memcpy(q,p,(size_t) (cache_info->number_channels*length* in GetVirtualPixelCacheNexus()
3089 q+=cache_info->number_channels*length; in GetVirtualPixelCacheNexus()
3093 s+=length*cache_info->metacontent_extent; in GetVirtualPixelCacheNexus()
3149 *magick_restrict cache_info; in GetVirtualPixelCache() local
3160 cache_info=(CacheInfo *) image->cache; in GetVirtualPixelCache()
3161 assert(cache_info->signature == MagickCoreSignature); in GetVirtualPixelCache()
3162 assert(id < (int) cache_info->number_threads); in GetVirtualPixelCache()
3164 cache_info->nexus_info[id],exception); in GetVirtualPixelCache()
3194 *magick_restrict cache_info; in GetVirtualPixelQueue() local
3202 cache_info=(CacheInfo *) image->cache; in GetVirtualPixelQueue()
3203 assert(cache_info->signature == MagickCoreSignature); in GetVirtualPixelQueue()
3204 if (cache_info->methods.get_virtual_pixels_handler != in GetVirtualPixelQueue()
3206 return(cache_info->methods.get_virtual_pixels_handler(image)); in GetVirtualPixelQueue()
3207 assert(id < (int) cache_info->number_threads); in GetVirtualPixelQueue()
3208 return(GetVirtualPixelsNexus(cache_info,cache_info->nexus_info[id])); in GetVirtualPixelQueue()
3264 *magick_restrict cache_info; in GetVirtualPixels() local
3275 cache_info=(CacheInfo *) image->cache; in GetVirtualPixels()
3276 assert(cache_info->signature == MagickCoreSignature); in GetVirtualPixels()
3277 if (cache_info->methods.get_virtual_pixel_handler != in GetVirtualPixels()
3279 return(cache_info->methods.get_virtual_pixel_handler(image, in GetVirtualPixels()
3281 assert(id < (int) cache_info->number_threads); in GetVirtualPixels()
3283 columns,rows,cache_info->nexus_info[id],exception); in GetVirtualPixels()
3313 *magick_restrict cache_info; in GetVirtualPixelsCache() local
3321 cache_info=(CacheInfo *) image->cache; in GetVirtualPixelsCache()
3322 assert(cache_info->signature == MagickCoreSignature); in GetVirtualPixelsCache()
3323 assert(id < (int) cache_info->number_threads); in GetVirtualPixelsCache()
3324 return(GetVirtualPixelsNexus(image->cache,cache_info->nexus_info[id])); in GetVirtualPixelsCache()
3357 *magick_restrict cache_info; in GetVirtualPixelsNexus() local
3360 cache_info=(CacheInfo *) cache; in GetVirtualPixelsNexus()
3361 assert(cache_info->signature == MagickCoreSignature); in GetVirtualPixelsNexus()
3362 if (cache_info->storage_class == UndefinedClass) in GetVirtualPixelsNexus()
3414 *magick_restrict cache_info; in MaskPixelCacheNexus() local
3436 cache_info=(CacheInfo *) image->cache; in MaskPixelCacheNexus()
3437 if (cache_info == (Cache) NULL) in MaskPixelCacheNexus()
3506 static MagickBooleanType OpenPixelCacheOnDisk(CacheInfo *cache_info, in OpenPixelCacheOnDisk() argument
3515 if ((cache_info->file != -1) && (cache_info->disk_mode == mode)) in OpenPixelCacheOnDisk()
3517 if (*cache_info->cache_filename == '\0') in OpenPixelCacheOnDisk()
3518 file=AcquireUniqueFileResource(cache_info->cache_filename); in OpenPixelCacheOnDisk()
3524 file=open_utf8(cache_info->cache_filename,O_RDONLY | O_BINARY,0); in OpenPixelCacheOnDisk()
3529 file=open_utf8(cache_info->cache_filename,O_WRONLY | O_CREAT | in OpenPixelCacheOnDisk()
3532 file=open_utf8(cache_info->cache_filename,O_WRONLY | O_BINARY,S_MODE); in OpenPixelCacheOnDisk()
3538 file=open_utf8(cache_info->cache_filename,O_RDWR | O_CREAT | O_BINARY | in OpenPixelCacheOnDisk()
3541 file=open_utf8(cache_info->cache_filename,O_RDWR | O_BINARY,S_MODE); in OpenPixelCacheOnDisk()
3548 if (cache_info->file != -1) in OpenPixelCacheOnDisk()
3549 (void) ClosePixelCacheOnDisk(cache_info); in OpenPixelCacheOnDisk()
3550 cache_info->file=file; in OpenPixelCacheOnDisk()
3551 cache_info->disk_mode=mode; in OpenPixelCacheOnDisk()
3556 const CacheInfo *magick_restrict cache_info,const MagickOffsetType offset, in WritePixelCacheRegion() argument
3566 if (lseek(cache_info->file,offset,SEEK_SET) < 0) in WritePixelCacheRegion()
3573 count=write(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) in WritePixelCacheRegion()
3576 count=pwrite(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) in WritePixelCacheRegion()
3592 *magick_restrict cache_info; in SetPixelCacheExtent() local
3599 cache_info=(CacheInfo *) image->cache; in SetPixelCacheExtent()
3608 "extend %s (%s[%d], disk, %s)",cache_info->filename, in SetPixelCacheExtent()
3609 cache_info->cache_filename,cache_info->file,format); in SetPixelCacheExtent()
3614 offset=(MagickOffsetType) lseek(cache_info->file,0,SEEK_END); in SetPixelCacheExtent()
3622 count=WritePixelCacheRegion(cache_info,extent,1,(const unsigned char *) in SetPixelCacheExtent()
3627 if (cache_info->synchronize != MagickFalse) in SetPixelCacheExtent()
3628 if (posix_fallocate(cache_info->file,offset+1,extent-offset) != 0) in SetPixelCacheExtent()
3632 offset=(MagickOffsetType) lseek(cache_info->file,0,SEEK_SET); in SetPixelCacheExtent()
3642 *magick_restrict cache_info, in OpenPixelCache() local
3695 cache_info=(CacheInfo *) image->cache; in OpenPixelCache()
3696 assert(cache_info->signature == MagickCoreSignature); in OpenPixelCache()
3705 source_info=(*cache_info); in OpenPixelCache()
3707 (void) FormatLocaleString(cache_info->filename,MagickPathExtent,"%s[%.20g]", in OpenPixelCache()
3709 cache_info->storage_class=image->storage_class; in OpenPixelCache()
3710 cache_info->colorspace=image->colorspace; in OpenPixelCache()
3711 cache_info->alpha_trait=image->alpha_trait; in OpenPixelCache()
3712 cache_info->channels=image->channels; in OpenPixelCache()
3713 cache_info->rows=image->rows; in OpenPixelCache()
3714 cache_info->columns=image->columns; in OpenPixelCache()
3716 cache_info->number_channels=GetPixelChannels(image); in OpenPixelCache()
3717 (void) memcpy(cache_info->channel_map,image->channel_map,MaxPixelChannels* in OpenPixelCache()
3719 cache_info->metacontent_extent=image->metacontent_extent; in OpenPixelCache()
3720 cache_info->mode=mode; in OpenPixelCache()
3721 number_pixels=(MagickSizeType) cache_info->columns*cache_info->rows; in OpenPixelCache()
3722 packet_size=cache_info->number_channels*sizeof(Quantum); in OpenPixelCache()
3724 packet_size+=cache_info->metacontent_extent; in OpenPixelCache()
3726 columns=(size_t) (length/cache_info->rows/packet_size); in OpenPixelCache()
3727 if ((cache_info->columns != columns) || ((ssize_t) cache_info->columns < 0) || in OpenPixelCache()
3728 ((ssize_t) cache_info->rows < 0)) in OpenPixelCache()
3731 cache_info->length=length; in OpenPixelCache()
3734 cache_info->storage_class=image->storage_class; in OpenPixelCache()
3735 cache_info->colorspace=image->colorspace; in OpenPixelCache()
3736 cache_info->type=PingCache; in OpenPixelCache()
3740 cache_info->columns*cache_info->rows); in OpenPixelCache()
3741 if (cache_info->mode == PersistMode) in OpenPixelCache()
3743 length=number_pixels*(cache_info->number_channels*sizeof(Quantum)+ in OpenPixelCache()
3744 cache_info->metacontent_extent); in OpenPixelCache()
3747 ((cache_info->type == UndefinedCache) || (cache_info->type == MemoryCache))) in OpenPixelCache()
3749 status=AcquireMagickResource(MemoryResource,cache_info->length); in OpenPixelCache()
3755 cache_info->mapped=MagickFalse; in OpenPixelCache()
3756 cache_info->pixels=(Quantum *) MagickAssumeAligned( in OpenPixelCache()
3757 AcquireAlignedMemory(1,(size_t) cache_info->length)); in OpenPixelCache()
3761 cache_info->mapped=MagickTrue; in OpenPixelCache()
3762 cache_info->pixels=(Quantum *) MapBlob(-1,IOMode,0,(size_t) in OpenPixelCache()
3763 cache_info->length); in OpenPixelCache()
3765 if (cache_info->pixels == (Quantum *) NULL) in OpenPixelCache()
3767 cache_info->mapped=source_info.mapped; in OpenPixelCache()
3768 cache_info->pixels=source_info.pixels; in OpenPixelCache()
3775 cache_info->type=MemoryCache; in OpenPixelCache()
3776 cache_info->metacontent=(void *) NULL; in OpenPixelCache()
3777 if (cache_info->metacontent_extent != 0) in OpenPixelCache()
3778 cache_info->metacontent=(void *) (cache_info->pixels+ in OpenPixelCache()
3779 cache_info->number_channels*number_pixels); in OpenPixelCache()
3783 status=ClonePixelCacheRepository(cache_info,&source_info, in OpenPixelCache()
3789 (void) FormatMagickSize(cache_info->length,MagickTrue,"B", in OpenPixelCache()
3792 cache_info->type); in OpenPixelCache()
3795 cache_info->filename,cache_info->mapped != MagickFalse ? in OpenPixelCache()
3796 "Anonymous" : "Heap",type,(double) cache_info->columns, in OpenPixelCache()
3797 (double) cache_info->rows,(double) in OpenPixelCache()
3798 cache_info->number_channels,format); in OpenPixelCache()
3806 status=AcquireMagickResource(DiskResource,cache_info->length); in OpenPixelCache()
3833 cache_info->type=DistributedCache; in OpenPixelCache()
3834 cache_info->server_info=server_info; in OpenPixelCache()
3835 (void) FormatLocaleString(cache_info->cache_filename, in OpenPixelCache()
3837 (DistributeCacheInfo *) cache_info->server_info), in OpenPixelCache()
3839 cache_info->server_info)); in OpenPixelCache()
3843 status=ClonePixelCacheRepository(cache_info,&source_info, in OpenPixelCache()
3849 (void) FormatMagickSize(cache_info->length,MagickFalse,"B", in OpenPixelCache()
3852 cache_info->type); in OpenPixelCache()
3855 cache_info->filename,cache_info->cache_filename, in OpenPixelCache()
3857 cache_info->server_info),type,(double) cache_info->columns, in OpenPixelCache()
3858 (double) cache_info->rows,(double) in OpenPixelCache()
3859 cache_info->number_channels,format); in OpenPixelCache()
3866 cache_info->type=UndefinedCache; in OpenPixelCache()
3876 cache_info->type=UndefinedCache; in OpenPixelCache()
3882 (cache_info->mode != PersistMode)) in OpenPixelCache()
3884 (void) ClosePixelCacheOnDisk(cache_info); in OpenPixelCache()
3885 *cache_info->cache_filename='\0'; in OpenPixelCache()
3887 if (OpenPixelCacheOnDisk(cache_info,mode) == MagickFalse) in OpenPixelCache()
3893 status=SetPixelCacheExtent(image,(MagickSizeType) cache_info->offset+ in OpenPixelCache()
3894 cache_info->length); in OpenPixelCache()
3901 length=number_pixels*(cache_info->number_channels*sizeof(Quantum)+ in OpenPixelCache()
3902 cache_info->metacontent_extent); in OpenPixelCache()
3904 cache_info->type=DiskCache; in OpenPixelCache()
3907 status=AcquireMagickResource(MapResource,cache_info->length); in OpenPixelCache()
3909 cache_info->type=DiskCache; in OpenPixelCache()
3911 if ((cache_info->type != MapCache) && (cache_info->type != MemoryCache)) in OpenPixelCache()
3913 cache_info->type=DiskCache; in OpenPixelCache()
3914 RelinquishMagickResource(MapResource,cache_info->length); in OpenPixelCache()
3918 cache_info->pixels=(Quantum *) MapBlob(cache_info->file,mode, in OpenPixelCache()
3919 cache_info->offset,(size_t) cache_info->length); in OpenPixelCache()
3920 if (cache_info->pixels == (Quantum *) NULL) in OpenPixelCache()
3922 cache_info->type=DiskCache; in OpenPixelCache()
3923 cache_info->mapped=source_info.mapped; in OpenPixelCache()
3924 cache_info->pixels=source_info.pixels; in OpenPixelCache()
3925 RelinquishMagickResource(MapResource,cache_info->length); in OpenPixelCache()
3932 (void) ClosePixelCacheOnDisk(cache_info); in OpenPixelCache()
3933 cache_info->type=MapCache; in OpenPixelCache()
3934 cache_info->mapped=MagickTrue; in OpenPixelCache()
3935 cache_info->metacontent=(void *) NULL; in OpenPixelCache()
3936 if (cache_info->metacontent_extent != 0) in OpenPixelCache()
3937 cache_info->metacontent=(void *) (cache_info->pixels+ in OpenPixelCache()
3938 cache_info->number_channels*number_pixels); in OpenPixelCache()
3942 status=ClonePixelCacheRepository(cache_info,&source_info, in OpenPixelCache()
3948 (void) FormatMagickSize(cache_info->length,MagickTrue,"B", in OpenPixelCache()
3951 cache_info->type); in OpenPixelCache()
3954 cache_info->filename,cache_info->cache_filename, in OpenPixelCache()
3955 cache_info->file,type,(double) cache_info->columns, in OpenPixelCache()
3956 (double) cache_info->rows,(double) in OpenPixelCache()
3957 cache_info->number_channels,format); in OpenPixelCache()
3968 status=ClonePixelCacheRepository(cache_info,&source_info,exception); in OpenPixelCache()
3973 (void) FormatMagickSize(cache_info->length,MagickFalse,"B", in OpenPixelCache()
3976 cache_info->type); in OpenPixelCache()
3978 "open %s (%s[%d], %s, %.20gx%.20gx%.20g %s)",cache_info->filename, in OpenPixelCache()
3979 cache_info->cache_filename,cache_info->file,type,(double) in OpenPixelCache()
3980 cache_info->columns,(double) cache_info->rows,(double) in OpenPixelCache()
3981 cache_info->number_channels,format); in OpenPixelCache()
4029 *magick_restrict cache_info, in PersistPixelCache() local
4046 cache_info=(CacheInfo *) image->cache; in PersistPixelCache()
4047 assert(cache_info->signature == MagickCoreSignature); in PersistPixelCache()
4049 CopyOpenCLBuffer(cache_info); in PersistPixelCache()
4059 (void) CopyMagickString(cache_info->cache_filename,filename, in PersistPixelCache()
4061 cache_info->type=DiskCache; in PersistPixelCache()
4062 cache_info->offset=(*offset); in PersistPixelCache()
4065 *offset+=cache_info->length+page_size-(cache_info->length % page_size); in PersistPixelCache()
4071 status=AcquireMagickResource(DiskResource,cache_info->length); in PersistPixelCache()
4078 clone_info=(CacheInfo *) ClonePixelCache(cache_info); in PersistPixelCache()
4082 clone_info->storage_class=cache_info->storage_class; in PersistPixelCache()
4083 clone_info->colorspace=cache_info->colorspace; in PersistPixelCache()
4084 clone_info->alpha_trait=cache_info->alpha_trait; in PersistPixelCache()
4085 clone_info->channels=cache_info->channels; in PersistPixelCache()
4086 clone_info->columns=cache_info->columns; in PersistPixelCache()
4087 clone_info->rows=cache_info->rows; in PersistPixelCache()
4088 clone_info->number_channels=cache_info->number_channels; in PersistPixelCache()
4089 clone_info->metacontent_extent=cache_info->metacontent_extent; in PersistPixelCache()
4091 clone_info->length=cache_info->length; in PersistPixelCache()
4092 (void) memcpy(clone_info->channel_map,cache_info->channel_map, in PersistPixelCache()
4093 MaxPixelChannels*sizeof(*cache_info->channel_map)); in PersistPixelCache()
4095 status=ClonePixelCacheRepository(clone_info,cache_info,exception); in PersistPixelCache()
4096 *offset+=cache_info->length+page_size-(cache_info->length % page_size); in PersistPixelCache()
4144 *magick_restrict cache_info; in QueueAuthenticPixelCacheNexus() local
4164 cache_info=(CacheInfo *) GetImagePixelCache(image,clone,exception); in QueueAuthenticPixelCacheNexus()
4165 if (cache_info == (Cache) NULL) in QueueAuthenticPixelCacheNexus()
4167 assert(cache_info->signature == MagickCoreSignature); in QueueAuthenticPixelCacheNexus()
4168 if ((cache_info->columns == 0) || (cache_info->rows == 0) || (x < 0) || in QueueAuthenticPixelCacheNexus()
4169 (y < 0) || (x >= (ssize_t) cache_info->columns) || in QueueAuthenticPixelCacheNexus()
4170 (y >= (ssize_t) cache_info->rows)) in QueueAuthenticPixelCacheNexus()
4176 offset=(MagickOffsetType) y*cache_info->columns+x; in QueueAuthenticPixelCacheNexus()
4179 number_pixels=(MagickSizeType) cache_info->columns*cache_info->rows; in QueueAuthenticPixelCacheNexus()
4180 offset+=(MagickOffsetType) (rows-1)*cache_info->columns+columns-1; in QueueAuthenticPixelCacheNexus()
4190 pixels=SetPixelCacheNexusPixels(cache_info,WriteMode,®ion, in QueueAuthenticPixelCacheNexus()
4235 *magick_restrict cache_info; in QueueAuthenticPixelsCache() local
4246 cache_info=(CacheInfo *) image->cache; in QueueAuthenticPixelsCache()
4247 assert(cache_info->signature == MagickCoreSignature); in QueueAuthenticPixelsCache()
4248 assert(id < (int) cache_info->number_threads); in QueueAuthenticPixelsCache()
4250 cache_info->nexus_info[id],exception); in QueueAuthenticPixelsCache()
4315 *magick_restrict cache_info; in QueueAuthenticPixels() local
4326 cache_info=(CacheInfo *) image->cache; in QueueAuthenticPixels()
4327 assert(cache_info->signature == MagickCoreSignature); in QueueAuthenticPixels()
4328 if (cache_info->methods.queue_authentic_pixels_handler != in QueueAuthenticPixels()
4331 pixels=cache_info->methods.queue_authentic_pixels_handler(image,x,y, in QueueAuthenticPixels()
4335 assert(id < (int) cache_info->number_threads); in QueueAuthenticPixels()
4337 cache_info->nexus_info[id],exception); in QueueAuthenticPixels()
4371 const CacheInfo *magick_restrict cache_info,const MagickOffsetType offset, in ReadPixelCacheRegion() argument
4381 if (lseek(cache_info->file,offset,SEEK_SET) < 0) in ReadPixelCacheRegion()
4388 count=read(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) in ReadPixelCacheRegion()
4391 count=pread(cache_info->file,buffer+i,(size_t) MagickMin(length-i,(size_t) in ReadPixelCacheRegion()
4405 CacheInfo *magick_restrict cache_info,NexusInfo *magick_restrict nexus_info, in ReadPixelCacheMetacontent() argument
4425 if (cache_info->metacontent_extent == 0) in ReadPixelCacheMetacontent()
4429 offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ in ReadPixelCacheMetacontent()
4432 cache_info->metacontent_extent; in ReadPixelCacheMetacontent()
4437 switch (cache_info->type) in ReadPixelCacheMetacontent()
4448 if ((cache_info->columns == nexus_info->region.width) && in ReadPixelCacheMetacontent()
4454 p=(unsigned char *) cache_info->metacontent+offset* in ReadPixelCacheMetacontent()
4455 cache_info->metacontent_extent; in ReadPixelCacheMetacontent()
4459 p+=cache_info->metacontent_extent*cache_info->columns; in ReadPixelCacheMetacontent()
4460 q+=cache_info->metacontent_extent*nexus_info->region.width; in ReadPixelCacheMetacontent()
4469 LockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCacheMetacontent()
4470 if (OpenPixelCacheOnDisk(cache_info,IOMode) == MagickFalse) in ReadPixelCacheMetacontent()
4473 cache_info->cache_filename); in ReadPixelCacheMetacontent()
4474 UnlockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCacheMetacontent()
4477 if ((cache_info->columns == nexus_info->region.width) && in ReadPixelCacheMetacontent()
4483 extent=(MagickSizeType) cache_info->columns*cache_info->rows; in ReadPixelCacheMetacontent()
4486 count=ReadPixelCacheRegion(cache_info,cache_info->offset+extent* in ReadPixelCacheMetacontent()
4487 cache_info->number_channels*sizeof(Quantum)+offset* in ReadPixelCacheMetacontent()
4488 cache_info->metacontent_extent,length,(unsigned char *) q); in ReadPixelCacheMetacontent()
4491 offset+=cache_info->columns; in ReadPixelCacheMetacontent()
4492 q+=cache_info->metacontent_extent*nexus_info->region.width; in ReadPixelCacheMetacontent()
4495 (void) ClosePixelCacheOnDisk(cache_info); in ReadPixelCacheMetacontent()
4496 UnlockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCacheMetacontent()
4507 LockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCacheMetacontent()
4509 if ((cache_info->columns != nexus_info->region.width) || in ReadPixelCacheMetacontent()
4520 cache_info->server_info,®ion,length,(unsigned char *) q); in ReadPixelCacheMetacontent()
4523 q+=cache_info->metacontent_extent*nexus_info->region.width; in ReadPixelCacheMetacontent()
4526 UnlockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCacheMetacontent()
4535 cache_info->cache_filename); in ReadPixelCacheMetacontent()
4538 if ((cache_info->debug != MagickFalse) && in ReadPixelCacheMetacontent()
4539 (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse)) in ReadPixelCacheMetacontent()
4541 "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double) in ReadPixelCacheMetacontent()
4576 CacheInfo *magick_restrict cache_info,NexusInfo *magick_restrict nexus_info, in ReadPixelCachePixels() argument
4599 offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns; in ReadPixelCachePixels()
4600 if ((ssize_t) (offset/cache_info->columns) != nexus_info->region.y) in ReadPixelCachePixels()
4603 number_channels=cache_info->number_channels; in ReadPixelCachePixels()
4614 switch (cache_info->type) in ReadPixelCachePixels()
4625 if ((cache_info->columns == nexus_info->region.width) && in ReadPixelCachePixels()
4631 p=cache_info->pixels+cache_info->number_channels*offset; in ReadPixelCachePixels()
4635 p+=cache_info->number_channels*cache_info->columns; in ReadPixelCachePixels()
4636 q+=cache_info->number_channels*nexus_info->region.width; in ReadPixelCachePixels()
4645 LockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCachePixels()
4646 if (OpenPixelCacheOnDisk(cache_info,IOMode) == MagickFalse) in ReadPixelCachePixels()
4649 cache_info->cache_filename); in ReadPixelCachePixels()
4650 UnlockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCachePixels()
4653 if ((cache_info->columns == nexus_info->region.width) && in ReadPixelCachePixels()
4661 count=ReadPixelCacheRegion(cache_info,cache_info->offset+offset* in ReadPixelCachePixels()
4662 cache_info->number_channels*sizeof(*q),length,(unsigned char *) q); in ReadPixelCachePixels()
4665 offset+=cache_info->columns; in ReadPixelCachePixels()
4666 q+=cache_info->number_channels*nexus_info->region.width; in ReadPixelCachePixels()
4669 (void) ClosePixelCacheOnDisk(cache_info); in ReadPixelCachePixels()
4670 UnlockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCachePixels()
4681 LockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCachePixels()
4683 if ((cache_info->columns != nexus_info->region.width) || in ReadPixelCachePixels()
4694 cache_info->server_info,®ion,length,(unsigned char *) q); in ReadPixelCachePixels()
4697 q+=cache_info->number_channels*nexus_info->region.width; in ReadPixelCachePixels()
4700 UnlockSemaphoreInfo(cache_info->file_semaphore); in ReadPixelCachePixels()
4709 cache_info->cache_filename); in ReadPixelCachePixels()
4712 if ((cache_info->debug != MagickFalse) && in ReadPixelCachePixels()
4713 (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse)) in ReadPixelCachePixels()
4715 "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double) in ReadPixelCachePixels()
4747 *magick_restrict cache_info; in ReferencePixelCache() local
4750 cache_info=(CacheInfo *) cache; in ReferencePixelCache()
4751 assert(cache_info->signature == MagickCoreSignature); in ReferencePixelCache()
4752 LockSemaphoreInfo(cache_info->semaphore); in ReferencePixelCache()
4753 cache_info->reference_count++; in ReferencePixelCache()
4754 UnlockSemaphoreInfo(cache_info->semaphore); in ReferencePixelCache()
4755 return(cache_info); in ReferencePixelCache()
4783 *magick_restrict cache_info; in ResetPixelCacheChannels() local
4788 cache_info=(CacheInfo *) image->cache; in ResetPixelCacheChannels()
4789 assert(cache_info->signature == MagickCoreSignature); in ResetPixelCacheChannels()
4790 cache_info->number_channels=GetPixelChannels(image); in ResetPixelCacheChannels()
4866 *magick_restrict cache_info; in SetPixelCacheMethods() local
4879 cache_info=(CacheInfo *) cache; in SetPixelCacheMethods()
4880 assert(cache_info->signature == MagickCoreSignature); in SetPixelCacheMethods()
4881 if (cache_info->debug != MagickFalse) in SetPixelCacheMethods()
4883 cache_info->filename); in SetPixelCacheMethods()
4885 cache_info->methods.get_virtual_pixel_handler= in SetPixelCacheMethods()
4888 cache_info->methods.destroy_pixel_handler= in SetPixelCacheMethods()
4892 cache_info->methods.get_virtual_metacontent_from_handler= in SetPixelCacheMethods()
4896 cache_info->methods.get_authentic_pixels_handler= in SetPixelCacheMethods()
4900 cache_info->methods.queue_authentic_pixels_handler= in SetPixelCacheMethods()
4904 cache_info->methods.sync_authentic_pixels_handler= in SetPixelCacheMethods()
4908 cache_info->methods.get_authentic_pixels_from_handler= in SetPixelCacheMethods()
4912 cache_info->methods.get_authentic_metacontent_from_handler= in SetPixelCacheMethods()
4915 cache_info->methods.get_one_virtual_pixel_from_handler; in SetPixelCacheMethods()
4918 cache_info->methods.get_one_virtual_pixel_from_handler= in SetPixelCacheMethods()
4924 cache_info->methods.get_one_authentic_pixel_from_handler= in SetPixelCacheMethods()
4967 const CacheInfo *magick_restrict cache_info,const MagickSizeType length, in AcquireCacheNexusPixels() argument
4974 cache_info->filename); in AcquireCacheNexusPixels()
4996 cache_info->filename); in AcquireCacheNexusPixels()
5017 static Quantum *SetPixelCacheNexusPixels(const CacheInfo *cache_info, in SetPixelCacheNexusPixels() argument
5029 assert(cache_info != (const CacheInfo *) NULL); in SetPixelCacheNexusPixels()
5030 assert(cache_info->signature == MagickCoreSignature); in SetPixelCacheNexusPixels()
5031 if (cache_info->type == UndefinedCache) in SetPixelCacheNexusPixels()
5037 "NoPixelsDefinedInCache","`%s'",cache_info->filename); in SetPixelCacheNexusPixels()
5041 if (((cache_info->type == MemoryCache) || (cache_info->type == MapCache)) && in SetPixelCacheNexusPixels()
5051 (region->y >= 0) && (y < (ssize_t) cache_info->rows)) && in SetPixelCacheNexusPixels()
5052 (((region->x == 0) && (region->width == cache_info->columns)) || in SetPixelCacheNexusPixels()
5053 ((region->height == 1) && (x < (ssize_t) cache_info->columns)))) in SetPixelCacheNexusPixels()
5061 offset=(MagickOffsetType) region->y*cache_info->columns+region->x; in SetPixelCacheNexusPixels()
5062 nexus_info->pixels=cache_info->pixels+cache_info->number_channels* in SetPixelCacheNexusPixels()
5065 if (cache_info->metacontent_extent != 0) in SetPixelCacheNexusPixels()
5066 nexus_info->metacontent=(unsigned char *) cache_info->metacontent+ in SetPixelCacheNexusPixels()
5067 offset*cache_info->metacontent_extent; in SetPixelCacheNexusPixels()
5083 "WidthOrHeightExceedsLimit","`%s'",cache_info->filename); in SetPixelCacheNexusPixels()
5087 length=MagickMax(number_pixels,cache_info->columns)* in SetPixelCacheNexusPixels()
5088 cache_info->number_channels*sizeof(*nexus_info->pixels); in SetPixelCacheNexusPixels()
5089 if (cache_info->metacontent_extent != 0) in SetPixelCacheNexusPixels()
5090 length+=number_pixels*cache_info->metacontent_extent; in SetPixelCacheNexusPixels()
5093 status=AcquireCacheNexusPixels(cache_info,length,nexus_info,exception); in SetPixelCacheNexusPixels()
5098 status=AcquireCacheNexusPixels(cache_info,length,nexus_info,exception); in SetPixelCacheNexusPixels()
5104 if (cache_info->metacontent_extent != 0) in SetPixelCacheNexusPixels()
5106 cache_info->number_channels*number_pixels); in SetPixelCacheNexusPixels()
5108 nexus_info->authentic_pixel_cache=cache_info->type == PingCache ? in SetPixelCacheNexusPixels()
5148 *magick_restrict cache_info; in SetCacheAlphaChannel() local
5164 cache_info=(CacheInfo *) image->cache; in SetCacheAlphaChannel()
5165 assert(cache_info->signature == MagickCoreSignature); in SetCacheAlphaChannel()
5204 *magick_restrict cache_info; in SetPixelCacheVirtualMethod() local
5214 cache_info=(CacheInfo *) image->cache; in SetPixelCacheVirtualMethod()
5215 assert(cache_info->signature == MagickCoreSignature); in SetPixelCacheVirtualMethod()
5216 method=cache_info->virtual_pixel_method; in SetPixelCacheVirtualMethod()
5217 cache_info->virtual_pixel_method=virtual_pixel_method; in SetPixelCacheVirtualMethod()
5268 static void CopyOpenCLBuffer(CacheInfo *magick_restrict cache_info) in CopyOpenCLBuffer() argument
5270 assert(cache_info != (CacheInfo *) NULL); in CopyOpenCLBuffer()
5271 assert(cache_info->signature == MagickCoreSignature); in CopyOpenCLBuffer()
5272 if ((cache_info->type != MemoryCache) || in CopyOpenCLBuffer()
5273 (cache_info->opencl == (MagickCLCacheInfo) NULL)) in CopyOpenCLBuffer()
5278 LockSemaphoreInfo(cache_info->semaphore); in CopyOpenCLBuffer()
5279 cache_info->opencl=CopyMagickCLCacheInfo(cache_info->opencl); in CopyOpenCLBuffer()
5280 UnlockSemaphoreInfo(cache_info->semaphore); in CopyOpenCLBuffer()
5286 *magick_restrict cache_info; in SyncAuthenticOpenCLBuffer() local
5289 cache_info=(CacheInfo *) image->cache; in SyncAuthenticOpenCLBuffer()
5290 CopyOpenCLBuffer(cache_info); in SyncAuthenticOpenCLBuffer()
5327 *magick_restrict cache_info; in SyncAuthenticPixelCacheNexus() local
5339 cache_info=(CacheInfo *) image->cache; in SyncAuthenticPixelCacheNexus()
5340 assert(cache_info->signature == MagickCoreSignature); in SyncAuthenticPixelCacheNexus()
5341 if (cache_info->type == UndefinedCache) in SyncAuthenticPixelCacheNexus()
5357 assert(cache_info->signature == MagickCoreSignature); in SyncAuthenticPixelCacheNexus()
5358 status=WritePixelCachePixels(cache_info,nexus_info,exception); in SyncAuthenticPixelCacheNexus()
5359 if ((cache_info->metacontent_extent != 0) && in SyncAuthenticPixelCacheNexus()
5360 (WritePixelCacheMetacontent(cache_info,nexus_info,exception) == MagickFalse)) in SyncAuthenticPixelCacheNexus()
5398 *magick_restrict cache_info; in SyncAuthenticPixelsCache() local
5409 cache_info=(CacheInfo *) image->cache; in SyncAuthenticPixelsCache()
5410 assert(cache_info->signature == MagickCoreSignature); in SyncAuthenticPixelsCache()
5411 assert(id < (int) cache_info->number_threads); in SyncAuthenticPixelsCache()
5412 status=SyncAuthenticPixelCacheNexus(image,cache_info->nexus_info[id], in SyncAuthenticPixelsCache()
5448 *magick_restrict cache_info; in SyncAuthenticPixels() local
5459 cache_info=(CacheInfo *) image->cache; in SyncAuthenticPixels()
5460 assert(cache_info->signature == MagickCoreSignature); in SyncAuthenticPixels()
5461 if (cache_info->methods.sync_authentic_pixels_handler != (SyncAuthenticPixelsHandler) NULL) in SyncAuthenticPixels()
5463 status=cache_info->methods.sync_authentic_pixels_handler(image, in SyncAuthenticPixels()
5467 assert(id < (int) cache_info->number_threads); in SyncAuthenticPixels()
5468 status=SyncAuthenticPixelCacheNexus(image,cache_info->nexus_info[id], in SyncAuthenticPixels()
5504 *magick_restrict cache_info; in SyncImagePixelCache() local
5508 cache_info=(CacheInfo *) GetImagePixelCache(image,MagickTrue,exception); in SyncImagePixelCache()
5509 return(cache_info == (CacheInfo *) NULL ? MagickFalse : MagickTrue); in SyncImagePixelCache()
5540 static MagickBooleanType WritePixelCacheMetacontent(CacheInfo *cache_info, in WritePixelCacheMetacontent() argument
5560 if (cache_info->metacontent_extent == 0) in WritePixelCacheMetacontent()
5564 offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ in WritePixelCacheMetacontent()
5567 cache_info->metacontent_extent; in WritePixelCacheMetacontent()
5572 switch (cache_info->type) in WritePixelCacheMetacontent()
5583 if ((cache_info->columns == nexus_info->region.width) && in WritePixelCacheMetacontent()
5589 q=(unsigned char *) cache_info->metacontent+offset* in WritePixelCacheMetacontent()
5590 cache_info->metacontent_extent; in WritePixelCacheMetacontent()
5594 p+=nexus_info->region.width*cache_info->metacontent_extent; in WritePixelCacheMetacontent()
5595 q+=cache_info->columns*cache_info->metacontent_extent; in WritePixelCacheMetacontent()
5604 LockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCacheMetacontent()
5605 if (OpenPixelCacheOnDisk(cache_info,IOMode) == MagickFalse) in WritePixelCacheMetacontent()
5608 cache_info->cache_filename); in WritePixelCacheMetacontent()
5609 UnlockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCacheMetacontent()
5612 if ((cache_info->columns == nexus_info->region.width) && in WritePixelCacheMetacontent()
5618 extent=(MagickSizeType) cache_info->columns*cache_info->rows; in WritePixelCacheMetacontent()
5621 count=WritePixelCacheRegion(cache_info,cache_info->offset+extent* in WritePixelCacheMetacontent()
5622 cache_info->number_channels*sizeof(Quantum)+offset* in WritePixelCacheMetacontent()
5623 cache_info->metacontent_extent,length,(const unsigned char *) p); in WritePixelCacheMetacontent()
5626 p+=cache_info->metacontent_extent*nexus_info->region.width; in WritePixelCacheMetacontent()
5627 offset+=cache_info->columns; in WritePixelCacheMetacontent()
5630 (void) ClosePixelCacheOnDisk(cache_info); in WritePixelCacheMetacontent()
5631 UnlockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCacheMetacontent()
5642 LockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCacheMetacontent()
5644 if ((cache_info->columns != nexus_info->region.width) || in WritePixelCacheMetacontent()
5655 cache_info->server_info,®ion,length,(const unsigned char *) p); in WritePixelCacheMetacontent()
5658 p+=cache_info->metacontent_extent*nexus_info->region.width; in WritePixelCacheMetacontent()
5661 UnlockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCacheMetacontent()
5670 cache_info->cache_filename); in WritePixelCacheMetacontent()
5673 if ((cache_info->debug != MagickFalse) && in WritePixelCacheMetacontent()
5674 (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse)) in WritePixelCacheMetacontent()
5676 "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double) in WritePixelCacheMetacontent()
5711 CacheInfo *magick_restrict cache_info,NexusInfo *magick_restrict nexus_info, in WritePixelCachePixels() argument
5733 offset=(MagickOffsetType) nexus_info->region.y*cache_info->columns+ in WritePixelCachePixels()
5735 length=(MagickSizeType) cache_info->number_channels*nexus_info->region.width* in WritePixelCachePixels()
5741 switch (cache_info->type) in WritePixelCachePixels()
5752 if ((cache_info->columns == nexus_info->region.width) && in WritePixelCachePixels()
5758 q=cache_info->pixels+cache_info->number_channels*offset; in WritePixelCachePixels()
5762 p+=cache_info->number_channels*nexus_info->region.width; in WritePixelCachePixels()
5763 q+=cache_info->number_channels*cache_info->columns; in WritePixelCachePixels()
5772 LockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCachePixels()
5773 if (OpenPixelCacheOnDisk(cache_info,IOMode) == MagickFalse) in WritePixelCachePixels()
5776 cache_info->cache_filename); in WritePixelCachePixels()
5777 UnlockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCachePixels()
5780 if ((cache_info->columns == nexus_info->region.width) && in WritePixelCachePixels()
5788 count=WritePixelCacheRegion(cache_info,cache_info->offset+offset* in WritePixelCachePixels()
5789 cache_info->number_channels*sizeof(*p),length,(const unsigned char *) in WritePixelCachePixels()
5793 p+=cache_info->number_channels*nexus_info->region.width; in WritePixelCachePixels()
5794 offset+=cache_info->columns; in WritePixelCachePixels()
5797 (void) ClosePixelCacheOnDisk(cache_info); in WritePixelCachePixels()
5798 UnlockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCachePixels()
5809 LockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCachePixels()
5811 if ((cache_info->columns != nexus_info->region.width) || in WritePixelCachePixels()
5822 cache_info->server_info,®ion,length,(const unsigned char *) p); in WritePixelCachePixels()
5825 p+=cache_info->number_channels*nexus_info->region.width; in WritePixelCachePixels()
5828 UnlockSemaphoreInfo(cache_info->file_semaphore); in WritePixelCachePixels()
5837 cache_info->cache_filename); in WritePixelCachePixels()
5840 if ((cache_info->debug != MagickFalse) && in WritePixelCachePixels()
5841 (CacheTick(nexus_info->region.y,cache_info->rows) != MagickFalse)) in WritePixelCachePixels()
5843 "%s[%.20gx%.20g%+.20g%+.20g]",cache_info->filename,(double) in WritePixelCachePixels()