% %
% %
% %
-% G e t O n e V i r t u a l M e t h o d P i x e l %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% GetOneVirtualMethodPixel() returns a single pixel at the specified (x,y)
-% location as defined by specified pixel method. The image background color
-% is returned if an error occurs. If you plan to modify the pixel, use
-% GetOneAuthenticPixel() instead.
-%
-% The format of the GetOneVirtualMethodPixel() method is:
-%
-% MagickBooleanType GetOneVirtualMethodPixel(const Image image,
-% const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
-% const ssize_t y,Quantum *pixel,ExceptionInfo exception)
-%
-% A description of each parameter follows:
-%
-% o image: the image.
-%
-% o virtual_pixel_method: the virtual pixel method.
-%
-% o x,y: These values define the location of the pixel to return.
-%
-% o pixel: return a pixel at the specified (x,y) location.
-%
-% o exception: return any errors or warnings in this structure.
-%
-*/
-MagickExport MagickBooleanType GetOneVirtualMethodPixel(const Image *image,
- const VirtualPixelMethod virtual_pixel_method,const ssize_t x,const ssize_t y,
- Quantum *pixel,ExceptionInfo *exception)
-{
- CacheInfo
- *cache_info;
-
- const int
- id = GetOpenMPThreadId();
-
- const Quantum
- *p;
-
- register ssize_t
- i;
-
- assert(image != (const Image *) NULL);
- assert(image->signature == MagickSignature);
- assert(image->cache != (Cache) NULL);
- cache_info=(CacheInfo *) image->cache;
- assert(cache_info->signature == MagickSignature);
- (void) memset(pixel,0,MaxPixelChannels*sizeof(*pixel));
- if (cache_info->methods.get_one_virtual_pixel_from_handler !=
- (GetOneVirtualPixelFromHandler) NULL)
- return(cache_info->methods.get_one_virtual_pixel_from_handler(image,
- virtual_pixel_method,x,y,pixel,exception));
- assert(id < (int) cache_info->number_threads);
- p=GetVirtualPixelsFromNexus(image,virtual_pixel_method,x,y,1UL,1UL,
- cache_info->nexus_info[id],exception);
- if (p == (const Quantum *) NULL)
- {
- pixel[RedPixelChannel]=image->background_color.red;
- pixel[GreenPixelChannel]=image->background_color.green;
- pixel[BluePixelChannel]=image->background_color.blue;
- pixel[BlackPixelChannel]=image->background_color.black;
- pixel[AlphaPixelChannel]=image->background_color.alpha;
- return(MagickFalse);
- }
- for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
- {
- PixelChannel
- channel;
-
- channel=GetPixelChannelMapChannel(image,(PixelChannel) i);
- pixel[channel]=p[i];
- }
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% G e t O n e V i r t u a l P i x e l %
% %
% %
const ssize_t,const ssize_t,PixelInfo *,ExceptionInfo *),
GetOneVirtualPixel(const Image *,const ssize_t,const ssize_t,Quantum *,
ExceptionInfo *),
- GetOneVirtualMethodPixel(const Image *,const VirtualPixelMethod,const ssize_t,
- const ssize_t,Quantum *,ExceptionInfo *),
GetOneAuthenticPixel(Image *,const ssize_t,const ssize_t,Quantum *,
ExceptionInfo *),
PersistPixelCache(Image *,const char *,const MagickBooleanType,
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
(void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ &exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
geometry.x=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ &exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
geometry.y=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ &exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
(void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ &exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
geometry.x=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ &exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
{
geometry.y=StringToLong(value);
(void) GetOneVirtualMagickPixel(msl_info->image[n],
- geometry.x,geometry.y,&target,&exception);
+ TileVirtualPixelMethod,geometry.x,geometry.y,&target,
+ &exception);
break;
}
ThrowMSLException(OptionError,"UnrecognizedAttribute",
#else
p=gdk_pixbuf_get_pixels(pixel_info);
#endif
+ GetPixelInfo(image,&fill_color);
for (y=0; y < (ssize_t) image->rows; y++)
{
q=GetAuthenticPixels(image,0,y,image->columns,1,exception);