% %
% %
% %
-% G e t O n e V i r t u a l M a g i c k P i x e l %
-% %
-% %
-% %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% GetOneVirtualMagickPixel() returns a single pixel at the specified (x,y)
-% location. The image background color is returned if an error occurs. If
-% you plan to modify the pixel, use GetOneAuthenticPixel() instead.
-%
-% The format of the GetOneVirtualMagickPixel() method is:
-%
-% MagickBooleanType GetOneVirtualMagickPixel(const Image image,
-% const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
-% const ssize_t y,PixelInfo *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 GetOneVirtualMagickPixel(const Image *image,
- const VirtualPixelMethod virtual_pixel_method,const ssize_t x,const ssize_t y,
- PixelInfo *pixel,ExceptionInfo *exception)
-{
- CacheInfo
- *cache_info;
-
- const int
- id = GetOpenMPThreadId();
-
- register const Quantum
- *p;
-
- 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);
- p=GetVirtualPixelsFromNexus(image,virtual_pixel_method,x,y,1UL,1UL,
- cache_info->nexus_info[id],exception);
- GetPixelInfo(image,pixel);
- if (p == (const Quantum *) NULL)
- return(MagickFalse);
- GetPixelInfoPixel(image,p,pixel);
- return(MagickTrue);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% %
-% %
-% %
% G e t O n e V i r t u a l P i x e l %
% %
% %
% %
% %
% %
+% G e t O n e V i r t u a l P i x e l I n f o %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% GetOneVirtualPixelInfo() returns a single pixel at the specified (x,y)
+% location. The image background color is returned if an error occurs. If
+% you plan to modify the pixel, use GetOneAuthenticPixel() instead.
+%
+% The format of the GetOneVirtualPixelInfo() method is:
+%
+% MagickBooleanType GetOneVirtualPixelInfo(const Image image,
+% const VirtualPixelMethod virtual_pixel_method,const ssize_t x,
+% const ssize_t y,PixelInfo *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 GetOneVirtualPixelInfo(const Image *image,
+ const VirtualPixelMethod virtual_pixel_method,const ssize_t x,const ssize_t y,
+ PixelInfo *pixel,ExceptionInfo *exception)
+{
+ CacheInfo
+ *cache_info;
+
+ const int
+ id = GetOpenMPThreadId();
+
+ register const Quantum
+ *p;
+
+ 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);
+ p=GetVirtualPixelsFromNexus(image,virtual_pixel_method,x,y,1UL,1UL,
+ cache_info->nexus_info[id],exception);
+ GetPixelInfo(image,pixel);
+ if (p == (const Quantum *) NULL)
+ return(MagickFalse);
+ GetPixelInfoPixel(image,p,pixel);
+ return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
+ G e t P i x e l C a c h e C o l o r s p a c e %
% %
% %
%
*/
-static inline void MagickPixelCompositeMask(const PixelInfo *p,
- const MagickRealType alpha,const PixelInfo *q,
- const MagickRealType beta,PixelInfo *composite)
+static inline void MaskPixelOver(const PixelInfo *p,const MagickRealType alpha,
+ const PixelInfo *q,const MagickRealType beta,PixelInfo *composite)
{
MagickRealType
gamma;
break;
GetPixelInfoPixel(image,p,&alpha);
GetPixelInfoPixel(image,q,&beta);
- MagickPixelCompositeMask(&beta,(MagickRealType) GetPixelIntensity(image,r),
+ MaskPixelOver(&beta,(MagickRealType) GetPixelIntensity(image,r),
&alpha,alpha.alpha,&beta);
SetPixelRed(image,ClampToQuantum(beta.red),q);
SetPixelGreen(image,ClampToQuantum(beta.green),q);
*GetVirtualMetacontent(const Image *);
extern MagickExport MagickBooleanType
- GetOneVirtualMagickPixel(const Image *,const VirtualPixelMethod,
+ GetOneVirtualPixelInfo(const Image *,const VirtualPixelMethod,
const ssize_t,const ssize_t,PixelInfo *,ExceptionInfo *),
GetOneVirtualPixel(const Image *,const ssize_t,const ssize_t,Quantum *,
ExceptionInfo *),
}
default:
{
- (void) GetOneVirtualMagickPixel(composite_image,
+ (void) GetOneVirtualPixelInfo(composite_image,
GetPixelCacheVirtualMethod(composite_image),x-x_offset,y-
y_offset,&composite,exception);
break;
/*
Update color information using floodfill algorithm.
*/
- (void) GetOneVirtualMagickPixel(*image,
+ (void) GetOneVirtualPixelInfo(*image,
GetPixelCacheVirtualMethod(*image),(ssize_t) x_offset,(ssize_t)
y_offset,&target,exception);
if (method == FillToBorderMethod)
/*
Update matte information using floodfill algorithm.
*/
- (void) GetOneVirtualMagickPixel(*image,
+ (void) GetOneVirtualPixelInfo(*image,
GetPixelCacheVirtualMethod(*image),(ssize_t) x_offset,(ssize_t)
y_offset,&target,exception);
if (method == FillToBorderMethod)
#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
#pragma omp critical
#endif
- status=GetOneVirtualMagickPixel(pattern,TileVirtualPixelMethod,x+
+ status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+
pattern->tile_offset.x,y+pattern->tile_offset.y,fill,exception);
return(status);
}
#if defined(MAGICKCORE_OPENMP_SUPPORT) && (_OPENMP >= 200203)
#pragma omp critical
#endif
- status=GetOneVirtualMagickPixel(pattern,TileVirtualPixelMethod,x+
+ status=GetOneVirtualPixelInfo(pattern,TileVirtualPixelMethod,x+
pattern->tile_offset.x,y+pattern->tile_offset.y,stroke,exception);
return(status);
}
PixelInfo
target;
- (void) GetOneVirtualMagickPixel(image,TileVirtualPixelMethod,x,y,
+ (void) GetOneVirtualPixelInfo(image,TileVirtualPixelMethod,x,y,
&target,exception);
if (primitive_info->method == FillToBorderMethod)
{
PixelInfo
target;
- (void) GetOneVirtualMagickPixel(image,TileVirtualPixelMethod,x,y,
+ (void) GetOneVirtualPixelInfo(image,TileVirtualPixelMethod,x,y,
&target,exception);
if (primitive_info->method == FillToBorderMethod)
{
#define GetOneCacheViewVirtualMethodPixel PrependMagickMethod(GetOneCacheViewVirtualMethodPixel)
#define GetOneCacheViewVirtualPixel PrependMagickMethod(GetOneCacheViewVirtualPixel)
#define GetOnePixel PrependMagickMethod(GetOnePixel)
-#define GetOneVirtualMagickPixel PrependMagickMethod(GetOneVirtualMagickPixel)
+#define GetOneVirtualPixelInfo PrependMagickMethod(GetOneVirtualPixelInfo)
#define GetOneVirtualMethodPixel PrependMagickMethod(GetOneVirtualMethodPixel)
#define GetOneVirtualPixel PrependMagickMethod(GetOneVirtualPixel)
#define GetOptimalKernelWidth1D PrependMagickMethod(GetOptimalKernelWidth1D)
+++ /dev/null
-/*
- Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
- dedicated to making software imaging solutions freely available.
-
- You may not use this file except in compliance with the License.
- obtain a copy of the License at
-
- http://www.imagemagick.org/script/license.php
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- MagickCore image pixel private methods.
-*/
-#ifndef _MAGICKCORE_PIXEL_PRIVATE_H
-#define _MAGICKCORE_PIXEL_PRIVATE_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <magick/exception-private.h>
-#include <magick/image.h>
-#include <magick/color.h>
-#include <magick/image-private.h>
-#include <magick/quantum-private.h>
-
-static inline MagickPixelInfo *CloneMagickPixelInfo(
- const MagickPixelInfo *pixel)
-{
- MagickPixelInfo
- *clone_pixel;
-
- clone_pixel=(MagickPixelInfo *) AcquireMemory(sizeof(*clone_pixel));
- if (clone_pixel == (MagickPixelInfo *) NULL)
- ThrowFatalException(ResourceLimitFatalError,"MemoryAllocationFailed");
- *clone_pixel=(*pixel);
- return(clone_pixel);
-}
-
-static inline MagickBooleanType IsGrayPixel(const PixelInfo *pixel)
-{
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- if ((GetPixelRed(pixel) == GetPixelGreen(pixel)) &&
- (GetPixelGreen(pixel) == GetPixelBlue(pixel)))
- return(MagickTrue);
-#else
- {
- double
- alpha,
- beta;
-
- alpha=GetPixelRed(pixel)-GetPixelGreen(pixel);
- beta=GetPixelGreen(pixel)-GetPixelBlue(pixel);
- if ((fabs(alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
- return(MagickTrue);
- }
-#endif
- return(MagickFalse);
-}
-
-static inline MagickBooleanType IsMonochromePixel(const PixelInfo *pixel)
-{
-#if !defined(MAGICKCORE_HDRI_SUPPORT)
- if (((GetPixelRed(pixel) == 0) ||
- (GetPixelRed(pixel) == (Quantum) QuantumRange)) &&
- (GetPixelRed(pixel) == GetPixelGreen(pixel)) &&
- (GetPixelGreen(pixel) == GetPixelBlue(pixel)))
- return(MagickTrue);
-#else
- {
- double
- alpha,
- beta;
-
- alpha=GetPixelRed(pixel)-GetPixelGreen(pixel);
- beta=GetPixelGreen(pixel)-GetPixelBlue(pixel);
- if (((fabs(GetPixelRed(pixel)) <= MagickEpsilon) ||
- (fabs(GetPixelRed(pixel)-QuantumRange) <= MagickEpsilon)) &&
- (fabs(alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
- return(MagickTrue);
- }
-#endif
- return(MagickFalse);
-}
-
-static inline void GetPixelInfo(const Image *image,
- const MagickPixelInfo *pixel,PixelInfo *color,IndexPacket *index)
-{
- SetPixelRed(color,ClampToQuantum(pixel->red));
- SetPixelGreen(color,ClampToQuantum(pixel->green));
- SetPixelBlue(color,ClampToQuantum(pixel->blue));
- if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
- SetPixelAlpha(color,ClampToQuantum(pixel->alpha));
- if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
- SetPixelBlack(index,ClampToQuantum(pixel->black));
- if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
- SetPixelIndex(index,ClampToQuantum(pixel->index));
-}
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif
/*
Show center pixel color.
*/
- (void) GetOneVirtualMagickPixel(windows->image.image,TileVirtualPixelMethod,
+ (void) GetOneVirtualPixelInfo(windows->image.image,TileVirtualPixelMethod,
(ssize_t) windows->magnify.x,(ssize_t) windows->magnify.y,&pixel,exception);
(void) FormatLocaleString(tuple,MaxTextExtent,"%d,%d: ",
windows->magnify.x,windows->magnify.y);
ThrowWandException(WandError,"ContainsNoImages",wand->name);
draw_info=CloneDrawInfo(wand->image_info,(DrawInfo *) NULL);
PixelGetQuantumPacket(fill,&draw_info->fill);
- (void) GetOneVirtualMagickPixel(wand->images,TileVirtualPixelMethod,x %
+ (void) GetOneVirtualPixelInfo(wand->images,TileVirtualPixelMethod,x %
wand->images->columns,y % wand->images->rows,&target,wand->exception);
if (bordercolor != (PixelWand *) NULL)
PixelGetMagickColor(bordercolor,&target);
&geometry,&exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
&exception);
break;
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
&exception);
break;
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
&exception);
break;
&geometry,&exception);
if ((flags & HeightValue) == 0)
geometry.height=geometry.width;
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
&exception);
break;
if (LocaleCompare(keyword,"x") == 0)
{
geometry.x=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
&exception);
break;
if (LocaleCompare(keyword,"y") == 0)
{
geometry.y=StringToLong(value);
- (void) GetOneVirtualMagickPixel(msl_info->image[n],
+ (void) GetOneVirtualPixelInfo(msl_info->image[n],
TileVirtualPixelMethod,geometry.x,geometry.y,&target,
&exception);
break;