i;
nexus_info=(NexusInfo **) MagickAssumeAligned(AcquireAlignedMemory(
- number_threads,sizeof(*nexus_info)));
+ number_threads+1,sizeof(*nexus_info)));
if (nexus_info == (NexusInfo **) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
- nexus_info[0]=(NexusInfo *) AcquireQuantumMemory(number_threads,
+ nexus_info[0]=(NexusInfo *) AcquireQuantumMemory(number_threads+1,
sizeof(**nexus_info));
if (nexus_info[0] == (NexusInfo *) NULL)
ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
- (void) memset(nexus_info[0],0,number_threads*sizeof(**nexus_info));
- for (i=0; i < (ssize_t) number_threads; i++)
+ (void) memset(nexus_info[0],0,(number_threads+1)*sizeof(**nexus_info));
+ for (i=0; i <= (ssize_t) number_threads; i++)
{
nexus_info[i]=(&nexus_info[0][i]);
+ nexus_info[i]->pixel_nexus=(&nexus_info[0][number_threads]);
nexus_info[i]->signature=MagickCoreSignature;
}
return(nexus_info);
MagickSizeType
number_pixels;
- NexusInfo
- **magick_restrict image_nexus;
-
register Quantum
*magick_restrict p,
*magick_restrict q;
cache_info=(CacheInfo *) image->cache;
if (cache_info == (Cache) NULL)
return(MagickFalse);
- image_nexus=AcquirePixelCacheNexus(1);
p=GetAuthenticPixelCacheNexus(image,nexus_info->region.x,nexus_info->region.y,
- nexus_info->region.width,nexus_info->region.height,image_nexus[0],
- exception);
+ nexus_info->region.width,nexus_info->region.height,
+ nexus_info->pixel_nexus,exception);
q=nexus_info->pixels;
number_pixels=(MagickSizeType) nexus_info->region.width*
nexus_info->region.height;
p+=GetPixelChannels(image);
q+=GetPixelChannels(image);
}
- image_nexus=DestroyPixelCacheNexus(image_nexus,1);
if (n < (ssize_t) number_pixels)
return(MagickFalse);
return(MagickTrue);
i;
assert(nexus_info != (NexusInfo **) NULL);
- for (i=0; i < (ssize_t) number_threads; i++)
+ for (i=0; i <= (ssize_t) number_threads; i++)
{
if (nexus_info[i]->cache != (Quantum *) NULL)
RelinquishCacheNexusPixels(nexus_info[i]);
length,
number_pixels;
- NexusInfo
- **magick_restrict virtual_nexus;
-
Quantum
*magick_restrict pixels,
virtual_pixel[MaxPixelChannels];
Pixel request is outside cache extents.
*/
s=(unsigned char *) nexus_info->metacontent;
- virtual_nexus=AcquirePixelCacheNexus(1);
(void) memset(virtual_pixel,0,cache_info->number_channels*
sizeof(*virtual_pixel));
virtual_metacontent=(void *) NULL;
cache_info->metacontent_extent);
if (virtual_metacontent == (void *) NULL)
{
- virtual_nexus=DestroyPixelCacheNexus(virtual_nexus,1);
(void) ThrowMagickException(exception,GetMagickModule(),
CacheError,"UnableToGetCacheNexus","`%s'",image->filename);
return((const Quantum *) NULL);
{
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
EdgeX(x_offset,cache_info->columns),
- EdgeY(y_offset,cache_info->rows),1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ EdgeY(y_offset,cache_info->rows),1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case RandomVirtualPixelMethod:
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
RandomX(cache_info->random_info,cache_info->columns),
RandomY(cache_info->random_info,cache_info->rows),1UL,1UL,
- *virtual_nexus,exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case DitherVirtualPixelMethod:
{
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
DitherX(x_offset,cache_info->columns),
- DitherY(y_offset,cache_info->rows),1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ DitherY(y_offset,cache_info->rows),1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case TileVirtualPixelMethod:
x_modulo=VirtualPixelModulo(x_offset,cache_info->columns);
y_modulo=VirtualPixelModulo(y_offset,cache_info->rows);
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
- x_modulo.remainder,y_modulo.remainder,1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ x_modulo.remainder,y_modulo.remainder,1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case MirrorVirtualPixelMethod:
y_modulo.remainder=(ssize_t) cache_info->rows-
y_modulo.remainder-1L;
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
- x_modulo.remainder,y_modulo.remainder,1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ x_modulo.remainder,y_modulo.remainder,1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case HorizontalTileEdgeVirtualPixelMethod:
x_modulo=VirtualPixelModulo(x_offset,cache_info->columns);
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
x_modulo.remainder,EdgeY(y_offset,cache_info->rows),1UL,1UL,
- *virtual_nexus,exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case VerticalTileEdgeVirtualPixelMethod:
y_modulo=VirtualPixelModulo(y_offset,cache_info->rows);
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
EdgeX(x_offset,cache_info->columns),y_modulo.remainder,1UL,1UL,
- *virtual_nexus,exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case BackgroundVirtualPixelMethod:
break;
}
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
- x_modulo.remainder,y_modulo.remainder,1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ x_modulo.remainder,y_modulo.remainder,1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case HorizontalTileVirtualPixelMethod:
x_modulo=VirtualPixelModulo(x_offset,cache_info->columns);
y_modulo=VirtualPixelModulo(y_offset,cache_info->rows);
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
- x_modulo.remainder,y_modulo.remainder,1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ x_modulo.remainder,y_modulo.remainder,1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
case VerticalTileVirtualPixelMethod:
x_modulo=VirtualPixelModulo(x_offset,cache_info->columns);
y_modulo=VirtualPixelModulo(y_offset,cache_info->rows);
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,
- x_modulo.remainder,y_modulo.remainder,1UL,1UL,*virtual_nexus,
- exception);
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ x_modulo.remainder,y_modulo.remainder,1UL,1UL,
+ nexus_info->pixel_nexus,exception);
+ r=GetVirtualMetacontentFromNexus(cache_info,
+ nexus_info->pixel_nexus);
break;
}
}
Transfer a run of pixels.
*/
p=GetVirtualPixelCacheNexus(image,virtual_pixel_method,x_offset,y_offset,
- (size_t) length,1UL,*virtual_nexus,exception);
+ (size_t) length,1UL,nexus_info->pixel_nexus,exception);
if (p == (const Quantum *) NULL)
break;
- r=GetVirtualMetacontentFromNexus(cache_info,*virtual_nexus);
+ r=GetVirtualMetacontentFromNexus(cache_info,nexus_info->pixel_nexus);
(void) memcpy(q,p,(size_t) (cache_info->number_channels*length*
sizeof(*p)));
q+=cache_info->number_channels*length;
*/
if (virtual_metacontent != (void *) NULL)
virtual_metacontent=(void *) RelinquishMagickMemory(virtual_metacontent);
- virtual_nexus=DestroyPixelCacheNexus(virtual_nexus,1);
if (v < (ssize_t) rows)
return((const Quantum *) NULL);
return(pixels);
MagickSizeType
number_pixels;
- NexusInfo
- **magick_restrict image_nexus;
-
register Quantum
*magick_restrict p,
*magick_restrict q;
cache_info=(CacheInfo *) image->cache;
if (cache_info == (Cache) NULL)
return(MagickFalse);
- image_nexus=AcquirePixelCacheNexus(1);
p=GetAuthenticPixelCacheNexus(image,nexus_info->region.x,nexus_info->region.y,
- nexus_info->region.width,nexus_info->region.height,image_nexus[0],
- exception);
+ nexus_info->region.width,nexus_info->region.height,
+ nexus_info->pixel_nexus,exception);
q=nexus_info->pixels;
number_pixels=(MagickSizeType) nexus_info->region.width*
nexus_info->region.height;
p+=GetPixelChannels(image);
q+=GetPixelChannels(image);
}
- image_nexus=DestroyPixelCacheNexus(image_nexus,1);
if (n < (ssize_t) number_pixels)
return(MagickFalse);
return(MagickTrue);