49#include "MagickWand/studio.h"
50#include "MagickWand/MagickWand.h"
51#include "MagickWand/magick-wand-private.h"
52#include "MagickWand/pixel-wand-private.h"
53#include "MagickWand/wand.h"
58#define PixelWandId "PixelWand"
69 name[MagickPathExtent];
109WandExport
void ClearPixelWand(
PixelWand *wand)
112 assert(wand->signature == MagickWandSignature);
113 if (wand->debug != MagickFalse)
114 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
115 ClearMagickException(wand->exception);
116 wand->pixel.colorspace=sRGBColorspace;
117 wand->debug=IsEventLogging();
148 assert(wand->signature == MagickWandSignature);
149 if (wand->debug != MagickFalse)
150 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
151 clone_wand=(
PixelWand *) AcquireCriticalMemory(
sizeof(*clone_wand));
152 (void) memset(clone_wand,0,
sizeof(*clone_wand));
153 clone_wand->id=AcquireWandId();
154 (void) FormatLocaleString(clone_wand->name,MagickPathExtent,
"%s-%.20g",
155 PixelWandId,(
double) clone_wand->id);
156 clone_wand->exception=AcquireExceptionInfo();
157 InheritException(clone_wand->exception,wand->exception);
158 clone_wand->pixel=wand->pixel;
159 clone_wand->count=wand->count;
160 clone_wand->debug=IsEventLogging();
161 if (clone_wand->debug != MagickFalse)
162 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",clone_wand->name);
163 clone_wand->signature=MagickWandSignature;
193 const size_t number_wands)
201 clone_wands=(
PixelWand **) AcquireCriticalMemory((
size_t) number_wands*
202 sizeof(*clone_wands));
203 for (i=0; i < (ssize_t) number_wands; i++)
204 clone_wands[i]=ClonePixelWand(wands[i]);
233 assert(wand->signature == MagickWandSignature);
234 if (wand->debug != MagickFalse)
235 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
236 wand->exception=DestroyExceptionInfo(wand->exception);
237 wand->signature=(~MagickWandSignature);
238 RelinquishWandId(wand->id);
239 wand=(
PixelWand *) RelinquishMagickMemory(wand);
270 const size_t number_wands)
277 assert((*wand)->signature == MagickWandSignature);
278 if ((*wand)->debug != MagickFalse)
279 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",(*wand)->name);
280 for (i=(ssize_t) number_wands-1; i >= 0; i--)
281 wand[i]=DestroyPixelWand(wand[i]);
282 wand=(
PixelWand **) RelinquishMagickMemory(wand);
319 assert(p->signature == MagickWandSignature);
320 if (p->debug != MagickFalse)
321 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",p->name);
323 assert(q->signature == MagickWandSignature);
324 if (q->debug != MagickFalse)
325 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",q->name);
328 return(IsFuzzyEquivalencePixelInfo(&p->pixel,&q->pixel));
353WandExport MagickBooleanType IsPixelWand(
const PixelWand *wand)
357 if (wand->signature != MagickWandSignature)
359 if (LocaleNCompare(wand->name,PixelWandId,strlen(PixelWandId)) != 0)
387 CheckMagickCoreCompatibility();
388 wand=(
PixelWand *) AcquireCriticalMemory(
sizeof(*wand));
389 (void) memset(wand,0,
sizeof(*wand));
390 wand->id=AcquireWandId();
391 (void) FormatLocaleString(wand->name,MagickPathExtent,
"%s-%.20g",PixelWandId,
393 wand->exception=AcquireExceptionInfo();
394 GetPixelInfo((Image *) NULL,&wand->pixel);
395 wand->debug=IsEventLogging();
396 if (wand->debug != MagickFalse)
397 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
398 wand->signature=MagickWandSignature;
424WandExport
PixelWand **NewPixelWands(
const size_t number_wands)
432 wands=(
PixelWand **) AcquireCriticalMemory((
size_t) number_wands*
434 for (i=0; i < (ssize_t) number_wands; i++)
435 wands[i]=NewPixelWand();
461WandExport MagickBooleanType PixelClearException(
PixelWand *wand)
464 assert(wand->signature == MagickWandSignature);
465 if (wand->debug != MagickFalse)
466 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
467 ClearMagickException(wand->exception);
493WandExport
double PixelGetAlpha(
const PixelWand *wand)
495 assert(wand != (
const PixelWand *) NULL);
496 assert(wand->signature == MagickWandSignature);
497 if (wand->debug != MagickFalse)
498 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
499 return(QuantumScale*(
double) wand->pixel.alpha);
524WandExport Quantum PixelGetAlphaQuantum(
const PixelWand *wand)
526 assert(wand != (
const PixelWand *) NULL);
527 assert(wand->signature == MagickWandSignature);
528 if (wand->debug != MagickFalse)
529 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
530 return(ClampToQuantum(wand->pixel.alpha));
555WandExport
double PixelGetBlack(
const PixelWand *wand)
557 assert(wand != (
const PixelWand *) NULL);
558 assert(wand->signature == MagickWandSignature);
559 if (wand->debug != MagickFalse)
560 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
561 return(QuantumScale*(
double) wand->pixel.black);
586WandExport Quantum PixelGetBlackQuantum(
const PixelWand *wand)
588 assert(wand != (
const PixelWand *) NULL);
589 assert(wand->signature == MagickWandSignature);
590 if (wand->debug != MagickFalse)
591 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
592 return(ClampToQuantum(wand->pixel.black));
617WandExport
double PixelGetBlue(
const PixelWand *wand)
619 assert(wand != (
const PixelWand *) NULL);
620 assert(wand->signature == MagickWandSignature);
621 if (wand->debug != MagickFalse)
622 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
623 return(QuantumScale*(
double) wand->pixel.blue);
648WandExport Quantum PixelGetBlueQuantum(
const PixelWand *wand)
650 assert(wand != (
const PixelWand *) NULL);
651 assert(wand->signature == MagickWandSignature);
652 if (wand->debug != MagickFalse)
653 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
654 return(ClampToQuantum(wand->pixel.blue));
679WandExport
char *PixelGetColorAsString(
const PixelWand *wand)
687 assert(wand != (
const PixelWand *) NULL);
688 assert(wand->signature == MagickWandSignature);
689 if (wand->debug != MagickFalse)
690 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
692 color=AcquireString((
const char *) NULL);
693 GetColorTuple(&pixel,MagickFalse,color);
720WandExport
char *PixelGetColorAsNormalizedString(
const PixelWand *wand)
723 color[2*MagickPathExtent];
725 assert(wand != (
const PixelWand *) NULL);
726 assert(wand->signature == MagickWandSignature);
727 if (wand->debug != MagickFalse)
728 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
729 (void) FormatLocaleString(color,MagickPathExtent,
"%g,%g,%g",(
double)
730 (QuantumScale*wand->pixel.red),(
double) (QuantumScale*wand->pixel.green),
731 (
double) (QuantumScale*wand->pixel.blue));
732 if (wand->pixel.colorspace == CMYKColorspace)
733 (void) FormatLocaleString(color+strlen(color),MagickPathExtent,
",%g",
734 (
double) (QuantumScale*wand->pixel.black));
735 if (wand->pixel.alpha_trait != UndefinedPixelTrait)
736 (void) FormatLocaleString(color+strlen(color),MagickPathExtent,
",%g",
737 (
double) (QuantumScale*wand->pixel.alpha));
738 return(ConstantString(color));
763WandExport
size_t PixelGetColorCount(
const PixelWand *wand)
765 assert(wand != (
const PixelWand *) NULL);
766 assert(wand->signature == MagickWandSignature);
767 if (wand->debug != MagickFalse)
768 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
794WandExport
double PixelGetCyan(
const PixelWand *wand)
796 assert(wand != (
const PixelWand *) NULL);
797 assert(wand->signature == MagickWandSignature);
798 if (wand->debug != MagickFalse)
799 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
800 return(QuantumScale*(
double) wand->pixel.red);
825WandExport Quantum PixelGetCyanQuantum(
const PixelWand *wand)
827 assert(wand != (
const PixelWand *) NULL);
828 assert(wand->signature == MagickWandSignature);
829 if (wand->debug != MagickFalse)
830 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
831 return(ClampToQuantum(wand->pixel.red));
859WandExport
char *PixelGetException(
const PixelWand *wand,
860 ExceptionType *severity)
865 assert(wand != (
const PixelWand *) NULL);
866 assert(wand->signature == MagickWandSignature);
867 if (wand->debug != MagickFalse)
868 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
869 assert(severity != (ExceptionType *) NULL);
870 *severity=wand->exception->severity;
871 description=(
char *) AcquireQuantumMemory(2UL*MagickPathExtent,
872 sizeof(*description));
873 if (description == (
char *) NULL)
874 ThrowWandFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",
877 if (wand->exception->reason != (
char *) NULL)
878 (void) CopyMagickString(description,GetLocaleExceptionMessage(
879 wand->exception->severity,wand->exception->reason),MagickPathExtent);
880 if (wand->exception->description != (
char *) NULL)
882 (void) ConcatenateMagickString(description,
" (",MagickPathExtent);
883 (void) ConcatenateMagickString(description,GetLocaleExceptionMessage(
884 wand->exception->severity,wand->exception->description),
886 (void) ConcatenateMagickString(description,
")",MagickPathExtent);
914WandExport ExceptionType PixelGetExceptionType(
const PixelWand *wand)
916 assert(wand != (
const PixelWand *) NULL);
917 assert(wand->signature == MagickWandSignature);
918 if (wand->debug != MagickFalse)
919 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
920 return(wand->exception->severity);
945WandExport
double PixelGetFuzz(
const PixelWand *wand)
947 assert(wand != (
const PixelWand *) NULL);
948 assert(wand->signature == MagickWandSignature);
949 if (wand->debug != MagickFalse)
950 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
951 return((
double) wand->pixel.fuzz);
976WandExport
double PixelGetGreen(
const PixelWand *wand)
978 assert(wand != (
const PixelWand *) NULL);
979 assert(wand->signature == MagickWandSignature);
980 if (wand->debug != MagickFalse)
981 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
982 return(QuantumScale*(
double) wand->pixel.green);
1007WandExport Quantum PixelGetGreenQuantum(
const PixelWand *wand)
1009 assert(wand != (
const PixelWand *) NULL);
1010 assert(wand->signature == MagickWandSignature);
1011 if (wand->debug != MagickFalse)
1012 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1013 return(ClampToQuantum(wand->pixel.green));
1042WandExport
void PixelGetHSL(
const PixelWand *wand,
double *hue,
1043 double *saturation,
double *lightness)
1045 assert(wand != (
const PixelWand *) NULL);
1046 assert(wand->signature == MagickWandSignature);
1047 if (wand->debug != MagickFalse)
1048 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1049 ConvertRGBToHSL((
double) ClampToQuantum(wand->pixel.red),(
double)
1050 ClampToQuantum(wand->pixel.green),(
double) ClampToQuantum(wand->pixel.blue),
1051 hue,saturation,lightness);
1076WandExport Quantum PixelGetIndex(
const PixelWand *wand)
1078 assert(wand != (
const PixelWand *) NULL);
1079 assert(wand->signature == MagickWandSignature);
1080 if (wand->debug != MagickFalse)
1081 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1082 return((Quantum) wand->pixel.index);
1107WandExport
double PixelGetMagenta(
const PixelWand *wand)
1109 assert(wand != (
const PixelWand *) NULL);
1110 assert(wand->signature == MagickWandSignature);
1111 if (wand->debug != MagickFalse)
1112 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1113 return(QuantumScale*(
double) wand->pixel.green);
1138WandExport Quantum PixelGetMagentaQuantum(
const PixelWand *wand)
1140 assert(wand != (
const PixelWand *) NULL);
1141 assert(wand->signature == MagickWandSignature);
1142 if (wand->debug != MagickFalse)
1143 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1144 return(ClampToQuantum(wand->pixel.green));
1171WandExport
void PixelGetMagickColor(
const PixelWand *wand,
1174 assert(wand != (
const PixelWand *) NULL);
1175 assert(wand->signature == MagickWandSignature);
1176 if (wand->debug != MagickFalse)
1177 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1178 assert(color != (PixelInfo *) NULL);
1204WandExport PixelInfo PixelGetPixel(
const PixelWand *wand)
1206 assert(wand != (
const PixelWand *) NULL);
1207 assert(wand->signature == MagickWandSignature);
1208 if (wand->debug != MagickFalse)
1209 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1210 return(wand->pixel);
1237WandExport
void PixelGetQuantumPacket(
const PixelWand *wand,PixelInfo *packet)
1239 assert(wand != (
const PixelWand *) NULL);
1240 assert(wand->signature == MagickWandSignature);
1241 if (wand->debug != MagickFalse)
1242 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1243 assert(packet != (PixelInfo *) NULL);
1244 packet->storage_class=wand->pixel.storage_class;
1245 packet->colorspace=wand->pixel.colorspace;
1246 packet->depth=wand->pixel.depth;
1247 packet->fuzz=wand->pixel.fuzz;
1248 packet->count=wand->pixel.count;
1249 packet->index=wand->pixel.index;
1250 packet->alpha=(double) ClampToQuantum(wand->pixel.alpha);
1251 packet->alpha_trait=wand->pixel.alpha_trait;
1252 if (wand->pixel.colorspace == CMYKColorspace)
1254 packet->red=(double) ClampToQuantum((
double) QuantumRange-(wand->pixel.red*
1255 ((
double) QuantumRange-wand->pixel.black)+wand->pixel.black));
1256 packet->green=(double) ClampToQuantum((
double) QuantumRange-(wand->pixel.green*
1257 ((
double) QuantumRange-wand->pixel.black)+wand->pixel.black));
1258 packet->blue=(double) ClampToQuantum((
double) QuantumRange-(wand->pixel.blue*
1259 ((
double) QuantumRange-wand->pixel.black)+wand->pixel.black));
1260 packet->black=(double) ClampToQuantum(wand->pixel.black);
1263 packet->red=(double) ClampToQuantum(wand->pixel.red);
1264 packet->green=(double) ClampToQuantum(wand->pixel.green);
1265 packet->blue=(double) ClampToQuantum(wand->pixel.blue);
1293WandExport
void PixelGetQuantumPixel(
const Image *image,
const PixelWand *wand,
1296 assert(wand != (
const PixelWand *) NULL);
1297 assert(wand->signature == MagickWandSignature);
1298 if (wand->debug != MagickFalse)
1299 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1300 assert(pixel != (Quantum *) NULL);
1301 SetPixelAlpha(image,ClampToQuantum(wand->pixel.alpha),pixel);
1302 if (wand->pixel.colorspace == CMYKColorspace)
1304 SetPixelRed(image,ClampToQuantum((
double) QuantumRange-
1305 (wand->pixel.red*((
double) QuantumRange-wand->pixel.black)+
1306 wand->pixel.black)),pixel);
1307 SetPixelGreen(image,ClampToQuantum((
double) QuantumRange-
1308 (wand->pixel.green*((
double) QuantumRange-wand->pixel.black)+
1309 wand->pixel.black)),pixel);
1310 SetPixelBlue(image,ClampToQuantum((
double) QuantumRange-
1311 (wand->pixel.blue*((
double) QuantumRange-wand->pixel.black)+
1312 wand->pixel.black)),pixel);
1313 SetPixelBlack(image,ClampToQuantum(wand->pixel.black),pixel);
1316 SetPixelRed(image,ClampToQuantum(wand->pixel.red),pixel);
1317 SetPixelGreen(image,ClampToQuantum(wand->pixel.green),pixel);
1318 SetPixelBlue(image,ClampToQuantum(wand->pixel.blue),pixel);
1343WandExport
double PixelGetRed(
const PixelWand *wand)
1345 assert(wand != (
const PixelWand *) NULL);
1346 assert(wand->signature == MagickWandSignature);
1347 if (wand->debug != MagickFalse)
1348 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1349 return(QuantumScale*(
double) wand->pixel.red);
1374WandExport Quantum PixelGetRedQuantum(
const PixelWand *wand)
1376 assert(wand != (
const PixelWand *) NULL);
1377 assert(wand->signature == MagickWandSignature);
1378 if (wand->debug != MagickFalse)
1379 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1380 return(ClampToQuantum(wand->pixel.red));
1405WandExport
double PixelGetYellow(
const PixelWand *wand)
1407 assert(wand != (
const PixelWand *) NULL);
1408 assert(wand->signature == MagickWandSignature);
1409 if (wand->debug != MagickFalse)
1410 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1411 return(QuantumScale*(
double) wand->pixel.blue);
1436WandExport Quantum PixelGetYellowQuantum(
const PixelWand *wand)
1438 assert(wand != (
const PixelWand *) NULL);
1439 assert(wand->signature == MagickWandSignature);
1440 if (wand->debug != MagickFalse)
1441 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1442 return(ClampToQuantum(wand->pixel.blue));
1470WandExport
void PixelSetAlpha(
PixelWand *wand,
const double alpha)
1472 assert(wand != (
const PixelWand *) NULL);
1473 assert(wand->signature == MagickWandSignature);
1474 if (wand->debug != MagickFalse)
1475 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1476 wand->pixel.alpha=(double) ClampToQuantum((
double) QuantumRange*alpha);
1503WandExport
void PixelSetAlphaQuantum(
PixelWand *wand,
const Quantum alpha)
1505 assert(wand != (
const PixelWand *) NULL);
1506 assert(wand->signature == MagickWandSignature);
1507 if (wand->debug != MagickFalse)
1508 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1509 wand->pixel.alpha=(double) alpha;
1536WandExport
void PixelSetBlack(
PixelWand *wand,
const double black)
1538 assert(wand != (
const PixelWand *) NULL);
1539 assert(wand->signature == MagickWandSignature);
1540 if (wand->debug != MagickFalse)
1541 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1542 wand->pixel.black=(double) ClampToQuantum((
double) QuantumRange*black);
1569WandExport
void PixelSetBlackQuantum(
PixelWand *wand,
const Quantum black)
1571 assert(wand != (
const PixelWand *) NULL);
1572 assert(wand->signature == MagickWandSignature);
1573 if (wand->debug != MagickFalse)
1574 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1575 wand->pixel.black=(double) black;
1602WandExport
void PixelSetBlue(
PixelWand *wand,
const double blue)
1604 assert(wand != (
const PixelWand *) NULL);
1605 assert(wand->signature == MagickWandSignature);
1606 if (wand->debug != MagickFalse)
1607 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1608 wand->pixel.blue=(double) ClampToQuantum((
double) QuantumRange*blue);
1635WandExport
void PixelSetBlueQuantum(
PixelWand *wand,
const Quantum blue)
1637 assert(wand != (
const PixelWand *) NULL);
1638 assert(wand->signature == MagickWandSignature);
1639 if (wand->debug != MagickFalse)
1640 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1641 wand->pixel.blue=(double) blue;
1669WandExport MagickBooleanType PixelSetColor(
PixelWand *wand,
const char *color)
1677 assert(wand != (
const PixelWand *) NULL);
1678 assert(wand->signature == MagickWandSignature);
1679 if (wand->debug != MagickFalse)
1680 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1681 status=QueryColorCompliance(color,AllCompliance,&pixel,wand->exception);
1682 if (status != MagickFalse)
1711WandExport
void PixelSetColorCount(
PixelWand *wand,
const size_t count)
1713 assert(wand != (
const PixelWand *) NULL);
1714 assert(wand->signature == MagickWandSignature);
1715 if (wand->debug != MagickFalse)
1716 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1746 assert(wand != (
const PixelWand *) NULL);
1747 assert(wand->signature == MagickWandSignature);
1748 if (wand->debug != MagickFalse)
1749 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1750 assert(color != (
const PixelWand *) NULL);
1751 wand->pixel=color->pixel;
1778WandExport
void PixelSetCyan(
PixelWand *wand,
const double cyan)
1780 assert(wand != (
const PixelWand *) NULL);
1781 assert(wand->signature == MagickWandSignature);
1782 if (wand->debug != MagickFalse)
1783 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1784 wand->pixel.red=(double) ClampToQuantum((
double) QuantumRange*cyan);
1811WandExport
void PixelSetCyanQuantum(
PixelWand *wand,
const Quantum cyan)
1813 assert(wand != (
const PixelWand *) NULL);
1814 assert(wand->signature == MagickWandSignature);
1815 if (wand->debug != MagickFalse)
1816 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1817 wand->pixel.red=(double) cyan;
1844WandExport
void PixelSetFuzz(
PixelWand *wand,
const double fuzz)
1846 assert(wand != (
const PixelWand *) NULL);
1847 assert(wand->signature == MagickWandSignature);
1848 if (wand->debug != MagickFalse)
1849 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1850 wand->pixel.fuzz=(double) fuzz;
1877WandExport
void PixelSetGreen(
PixelWand *wand,
const double green)
1879 assert(wand != (
const PixelWand *) NULL);
1880 assert(wand->signature == MagickWandSignature);
1881 if (wand->debug != MagickFalse)
1882 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1883 wand->pixel.green=(double) ClampToQuantum((
double) QuantumRange*green);
1910WandExport
void PixelSetGreenQuantum(
PixelWand *wand,
const Quantum green)
1912 assert(wand != (
const PixelWand *) NULL);
1913 assert(wand->signature == MagickWandSignature);
1914 if (wand->debug != MagickFalse)
1915 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1916 wand->pixel.green=(double) green;
1945WandExport
void PixelSetHSL(
PixelWand *wand,
const double hue,
1946 const double saturation,
const double lightness)
1953 assert(wand != (
const PixelWand *) NULL);
1954 assert(wand->signature == MagickWandSignature);
1955 if (wand->debug != MagickFalse)
1956 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1957 ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
1958 wand->pixel.red=(double) red;
1959 wand->pixel.green=(double) green;
1960 wand->pixel.blue=(double) blue;
1987WandExport
void PixelSetIndex(
PixelWand *wand,
const Quantum index)
1989 assert(wand != (
const PixelWand *) NULL);
1990 assert(wand->signature == MagickWandSignature);
1991 if (wand->debug != MagickFalse)
1992 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1993 wand->pixel.index=(double) index;
2020WandExport
void PixelSetMagenta(
PixelWand *wand,
const double magenta)
2022 assert(wand != (
const PixelWand *) NULL);
2023 assert(wand->signature == MagickWandSignature);
2024 if (wand->debug != MagickFalse)
2025 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2026 wand->pixel.green=(double) ClampToQuantum((
double) QuantumRange*magenta);
2054WandExport
void PixelSetMagentaQuantum(
PixelWand *wand,
const Quantum magenta)
2056 assert(wand != (
const PixelWand *) NULL);
2057 assert(wand->signature == MagickWandSignature);
2058 if (wand->debug != MagickFalse)
2059 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2060 wand->pixel.green=(double) magenta;
2087WandExport
void PixelSetPixelColor(
PixelWand *wand,
const PixelInfo *color)
2089 assert(wand != (
const PixelWand *) NULL);
2090 assert(wand->signature == MagickWandSignature);
2091 if (wand->debug != MagickFalse)
2092 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2093 assert(color != (
const PixelInfo *) NULL);
2094 wand->pixel=(*color);
2122WandExport
void PixelSetQuantumPixel(
const Image *image,
const Quantum *pixel,
2125 assert(wand != (
const PixelWand *) NULL);
2126 assert(wand->signature == MagickWandSignature);
2127 if (wand->debug != MagickFalse)
2128 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2129 assert(pixel != (Quantum *) NULL);
2130 wand->pixel.red=(double) GetPixelRed(image,pixel);
2131 wand->pixel.green=(double) GetPixelGreen(image,pixel);
2132 wand->pixel.blue=(double) GetPixelBlue(image,pixel);
2133 wand->pixel.black=(double) GetPixelBlack(image,pixel);
2134 wand->pixel.alpha=(double) GetPixelAlpha(image,pixel);
2135 wand->pixel.alpha_trait=GetPixelAlpha(image,pixel) != OpaqueAlpha ?
2136 BlendPixelTrait : UndefinedPixelTrait;
2163WandExport
void PixelSetRed(
PixelWand *wand,
const double red)
2165 assert(wand != (
const PixelWand *) NULL);
2166 assert(wand->signature == MagickWandSignature);
2167 if (wand->debug != MagickFalse)
2168 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2169 wand->pixel.red=(double) ClampToQuantum((
double) QuantumRange*red);
2196WandExport
void PixelSetRedQuantum(
PixelWand *wand,
const Quantum red)
2198 assert(wand != (
const PixelWand *) NULL);
2199 assert(wand->signature == MagickWandSignature);
2200 if (wand->debug != MagickFalse)
2201 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2202 wand->pixel.red=(double) red;
2229WandExport
void PixelSetYellow(
PixelWand *wand,
const double yellow)
2231 assert(wand != (
const PixelWand *) NULL);
2232 assert(wand->signature == MagickWandSignature);
2233 if (wand->debug != MagickFalse)
2234 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2235 wand->pixel.blue=(double) ClampToQuantum((
double) QuantumRange*yellow);
2262WandExport
void PixelSetYellowQuantum(
PixelWand *wand,
const Quantum yellow)
2264 assert(wand != (
const PixelWand *) NULL);
2265 assert(wand->signature == MagickWandSignature);
2266 if (wand->debug != MagickFalse)
2267 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2268 wand->pixel.blue=(double) yellow;