blob,length);
else
{
- count=WritePixelCacheRegion(clone_info,clone_offset,length,
- blob);
+ count=WritePixelCacheRegion(clone_info,clone_offset,length,blob);
if ((MagickSizeType) count != length)
{
status=MagickFalse;
blob,length);
else
{
- count=WritePixelCacheRegion(clone_info,clone_offset,length,
- blob);
+ count=WritePixelCacheRegion(clone_info,clone_offset,length,blob);
if ((MagickSizeType) count != length)
{
status=MagickFalse;
% o exception: return any errors or warnings in this structure.
%
*/
+
static inline MagickBooleanType ValidatePixelCacheMorphology(const Image *image)
{
CacheInfo
time_limit = 0;
static time_t
- cache_genesis = 0;
+ cache_timestamp = 0;
status=MagickTrue;
LockSemaphoreInfo(image->semaphore);
Set the exire time in seconds.
*/
time_limit=GetMagickResourceLimit(TimeResource);
- cache_genesis=time((time_t *) NULL);
+ cache_timestamp=time((time_t *) NULL);
}
if ((time_limit != MagickResourceInfinity) &&
- ((MagickSizeType) (time((time_t *) NULL)-cache_genesis) >= time_limit))
+ ((MagickSizeType) (time((time_t *) NULL)-cache_timestamp) >= time_limit))
ThrowFatalException(ResourceLimitFatalError,"TimeLimitExceeded");
assert(image->cache != (Cache) NULL);
cache_info=(CacheInfo *) image->cache;
status=ClonePixelCachePixels(clone_info,cache_info,exception);
if (status != MagickFalse)
{
+ if (cache_info->mode == ReadMode)
+ cache_info->nexus_info=(NexusInfo **) NULL;
destroy=MagickTrue;
image->cache=clone_image.cache;
}
case GrayVirtualPixelMethod:
{
for (i=0; i < (ssize_t) cache_info->number_channels; i++)
- SetPixelChannel(image,(PixelChannel) i,QuantumRange/2,virtual_pixel);
+ SetPixelChannel(image,(PixelChannel) i,QuantumRange/2,
+ virtual_pixel);
SetPixelAlpha(image,OpaqueAlpha,virtual_pixel);
break;
}
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if ((image->columns == 0) || (image->rows == 0))
ThrowBinaryException(CacheError,"NoPixelsDefinedInCache",image->filename);
- StandardPixelChannelMap(image);
cache_info=(CacheInfo *) image->cache;
assert(cache_info->signature == MagickSignature);
source_info=(*cache_info);
cache_info->matte=image->matte;
cache_info->rows=image->rows;
cache_info->columns=image->columns;
+ InitializePixelChannelMap(image);
cache_info->number_channels=GetPixelChannels(image);
cache_info->metacontent_extent=image->metacontent_extent;
cache_info->mode=mode;
(cache_info->reference_count == 1))
{
LockSemaphoreInfo(cache_info->semaphore);
- if ((cache_info->mode != ReadMode) &&
- (cache_info->type != MemoryCache) &&
+ if ((cache_info->mode != ReadMode) && (cache_info->type != MemoryCache) &&
(cache_info->reference_count == 1))
{
int
% %
% %
% %
+% S y n c I m a g e P i x e l C a c h e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% SyncImagePixelCache() saves the image pixels to the in-memory or disk cache.
+% The method returns MagickTrue if the pixel region is flushed, otherwise
+% MagickFalse.
+%
+% The format of the SyncImagePixelCache() method is:
+%
+% MagickBooleanType SyncImagePixelCache(Image *image,
+% ExceptionInfo *exception)
+%
+% A description of each parameter follows:
+%
+% o image: the image.
+%
+% o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport MagickBooleanType SyncImagePixelCache(Image *image,
+ ExceptionInfo *exception)
+{
+ CacheInfo
+ *cache_info;
+
+ assert(image != (Image *) NULL);
+ assert(exception != (ExceptionInfo *) NULL);
+ cache_info=(CacheInfo *) GetImagePixelCache(image,MagickTrue,exception);
+ return(cache_info == (CacheInfo *) NULL ? MagickFalse : MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+ W r i t e P i x e l C a c h e M e t a c o n t e n t %
% %
% %