49#include "wand/studio.h"
50#include "wand/MagickWand.h"
51#include "wand/magick-wand-private.h"
52#include "wand/pixel-wand-private.h"
58#define PixelWandId "PixelWand"
109WandExport
void ClearPixelWand(
PixelWand *wand)
112 assert(wand->signature == WandSignature);
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 == WandSignature);
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,MaxTextExtent,
"%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=WandSignature;
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 == WandSignature);
234 if (wand->debug != MagickFalse)
235 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
236 wand->exception=DestroyExceptionInfo(wand->exception);
237 wand->signature=(~WandSignature);
238 RelinquishWandId(wand->id);
239 wand=(
PixelWand *) RelinquishMagickMemory(wand);
270 const size_t number_wands)
277 assert((*wand)->signature == WandSignature);
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 == WandSignature);
320 if (p->debug != MagickFalse)
321 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",p->name);
323 assert(q->signature == WandSignature);
324 if (q->debug != MagickFalse)
325 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",q->name);
328 return(IsMagickColorSimilar(&p->pixel,&q->pixel));
353WandExport MagickBooleanType IsPixelWand(
const PixelWand *wand)
357 if (wand->signature != WandSignature)
359 if (LocaleNCompare(wand->name,PixelWandId,strlen(PixelWandId)) != 0)
393 depth=MAGICKCORE_QUANTUM_DEPTH;
394 quantum=GetMagickQuantumDepth(&depth);
395 if (depth != MAGICKCORE_QUANTUM_DEPTH)
396 ThrowWandFatalException(WandError,
"QuantumDepthMismatch",quantum);
397 wand=(
PixelWand *) AcquireCriticalMemory(
sizeof(*wand));
398 (void) memset(wand,0,
sizeof(*wand));
399 wand->id=AcquireWandId();
400 (void) FormatLocaleString(wand->name,MaxTextExtent,
"%s-%.20g",PixelWandId,
402 wand->exception=AcquireExceptionInfo();
403 GetMagickPixelPacket((Image *) NULL,&wand->pixel);
404 wand->debug=IsEventLogging();
405 if (wand->debug != MagickFalse)
406 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
407 wand->signature=WandSignature;
433WandExport
PixelWand **NewPixelWands(
const size_t number_wands)
441 wands=(
PixelWand **) AcquireCriticalMemory((
size_t) number_wands*
443 for (i=0; i < (ssize_t) number_wands; i++)
444 wands[i]=NewPixelWand();
470WandExport MagickBooleanType PixelClearException(
PixelWand *wand)
473 assert(wand->signature == WandSignature);
474 if (wand->debug != MagickFalse)
475 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
476 ClearMagickException(wand->exception);
502WandExport
double PixelGetAlpha(
const PixelWand *wand)
504 assert(wand != (
const PixelWand *) NULL);
505 assert(wand->signature == WandSignature);
506 if (wand->debug != MagickFalse)
507 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
508 return(QuantumScale*((
double) QuantumRange-(
double) wand->pixel.opacity));
533WandExport Quantum PixelGetAlphaQuantum(
const PixelWand *wand)
535 assert(wand != (
const PixelWand *) NULL);
536 assert(wand->signature == WandSignature);
537 if (wand->debug != MagickFalse)
538 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
539 return(QuantumRange-ClampToQuantum(wand->pixel.opacity));
564WandExport
double PixelGetBlack(
const PixelWand *wand)
566 assert(wand != (
const PixelWand *) NULL);
567 assert(wand->signature == WandSignature);
568 if (wand->debug != MagickFalse)
569 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
570 return((
double) QuantumScale*wand->pixel.index);
595WandExport Quantum PixelGetBlackQuantum(
const PixelWand *wand)
597 assert(wand != (
const PixelWand *) NULL);
598 assert(wand->signature == WandSignature);
599 if (wand->debug != MagickFalse)
600 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
601 return(ClampToQuantum(wand->pixel.index));
626WandExport
double PixelGetBlue(
const PixelWand *wand)
628 assert(wand != (
const PixelWand *) NULL);
629 assert(wand->signature == WandSignature);
630 if (wand->debug != MagickFalse)
631 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
632 return((
double) QuantumScale*wand->pixel.blue);
657WandExport Quantum PixelGetBlueQuantum(
const PixelWand *wand)
659 assert(wand != (
const PixelWand *) NULL);
660 assert(wand->signature == WandSignature);
661 if (wand->debug != MagickFalse)
662 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
663 return(ClampToQuantum(wand->pixel.blue));
688WandExport
char *PixelGetColorAsString(
const PixelWand *wand)
696 assert(wand != (
const PixelWand *) NULL);
697 assert(wand->signature == WandSignature);
698 if (wand->debug != MagickFalse)
699 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
701 color=AcquireString((
const char *) NULL);
702 GetColorTuple(&pixel,MagickFalse,color);
729WandExport
char *PixelGetColorAsNormalizedString(
const PixelWand *wand)
732 color[2*MaxTextExtent];
734 assert(wand != (
const PixelWand *) NULL);
735 assert(wand->signature == WandSignature);
736 if (wand->debug != MagickFalse)
737 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
738 (void) FormatLocaleString(color,MaxTextExtent,
"%g,%g,%g",
739 (
double) (QuantumScale*wand->pixel.red),
740 (
double) (QuantumScale*wand->pixel.green),
741 (
double) (QuantumScale*wand->pixel.blue));
742 if (wand->pixel.colorspace == CMYKColorspace)
743 (void) FormatLocaleString(color+strlen(color),MaxTextExtent,
",%g",
744 (
double) (QuantumScale*wand->pixel.index));
745 if (wand->pixel.matte != MagickFalse)
746 (void) FormatLocaleString(color+strlen(color),MaxTextExtent,
",%g",
747 (
double) (QuantumScale*wand->pixel.opacity));
748 return(ConstantString(color));
773WandExport
size_t PixelGetColorCount(
const PixelWand *wand)
775 assert(wand != (
const PixelWand *) NULL);
776 assert(wand->signature == WandSignature);
777 if (wand->debug != MagickFalse)
778 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
804WandExport
double PixelGetCyan(
const PixelWand *wand)
806 assert(wand != (
const PixelWand *) NULL);
807 assert(wand->signature == WandSignature);
808 if (wand->debug != MagickFalse)
809 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
810 return((
double) QuantumScale*wand->pixel.red);
835WandExport Quantum PixelGetCyanQuantum(
const PixelWand *wand)
837 assert(wand != (
const PixelWand *) NULL);
838 assert(wand->signature == WandSignature);
839 if (wand->debug != MagickFalse)
840 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
841 return(ClampToQuantum(wand->pixel.red));
869WandExport
char *PixelGetException(
const PixelWand *wand,
870 ExceptionType *severity)
875 assert(wand != (
const PixelWand *) NULL);
876 assert(wand->signature == WandSignature);
877 if (wand->debug != MagickFalse)
878 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
879 assert(severity != (ExceptionType *) NULL);
880 *severity=wand->exception->severity;
881 description=(
char *) AcquireQuantumMemory(2UL*MaxTextExtent,
882 sizeof(*description));
883 if (description == (
char *) NULL)
884 ThrowWandFatalException(ResourceLimitFatalError,
"MemoryAllocationFailed",
887 if (wand->exception->reason != (
char *) NULL)
888 (void) CopyMagickString(description,GetLocaleExceptionMessage(
889 wand->exception->severity,wand->exception->reason),MaxTextExtent);
890 if (wand->exception->description != (
char *) NULL)
892 (void) ConcatenateMagickString(description,
" (",MaxTextExtent);
893 (void) ConcatenateMagickString(description,GetLocaleExceptionMessage(
894 wand->exception->severity,wand->exception->description),MaxTextExtent);
895 (void) ConcatenateMagickString(description,
")",MaxTextExtent);
923WandExport ExceptionType PixelGetExceptionType(
const PixelWand *wand)
925 assert(wand != (
const PixelWand *) NULL);
926 assert(wand->signature == WandSignature);
927 if (wand->debug != MagickFalse)
928 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
929 return(wand->exception->severity);
954WandExport
double PixelGetFuzz(
const PixelWand *wand)
956 assert(wand != (
const PixelWand *) NULL);
957 assert(wand->signature == WandSignature);
958 if (wand->debug != MagickFalse)
959 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
960 return((
double) wand->pixel.fuzz);
985WandExport
double PixelGetGreen(
const PixelWand *wand)
987 assert(wand != (
const PixelWand *) NULL);
988 assert(wand->signature == WandSignature);
989 if (wand->debug != MagickFalse)
990 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
991 return((
double) QuantumScale*wand->pixel.green);
1016WandExport Quantum PixelGetGreenQuantum(
const PixelWand *wand)
1018 assert(wand != (
const PixelWand *) NULL);
1019 assert(wand->signature == WandSignature);
1020 if (wand->debug != MagickFalse)
1021 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1022 return(ClampToQuantum(wand->pixel.green));
1051WandExport
void PixelGetHSL(
const PixelWand *wand,
double *hue,
1052 double *saturation,
double *lightness)
1054 assert(wand != (
const PixelWand *) NULL);
1055 assert(wand->signature == WandSignature);
1056 if (wand->debug != MagickFalse)
1057 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1058 ConvertRGBToHSL(ClampToQuantum(wand->pixel.red),ClampToQuantum(
1059 wand->pixel.green),ClampToQuantum(wand->pixel.blue),hue,saturation,
1085WandExport IndexPacket PixelGetIndex(
const PixelWand *wand)
1087 assert(wand != (
const PixelWand *) NULL);
1088 assert(wand->signature == WandSignature);
1089 if (wand->debug != MagickFalse)
1090 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1091 return((IndexPacket) wand->pixel.index);
1116WandExport
double PixelGetMagenta(
const PixelWand *wand)
1118 assert(wand != (
const PixelWand *) NULL);
1119 assert(wand->signature == WandSignature);
1120 if (wand->debug != MagickFalse)
1121 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1122 return((
double) QuantumScale*wand->pixel.green);
1147WandExport Quantum PixelGetMagentaQuantum(
const PixelWand *wand)
1149 assert(wand != (
const PixelWand *) NULL);
1150 assert(wand->signature == WandSignature);
1151 if (wand->debug != MagickFalse)
1152 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1153 return(ClampToQuantum(wand->pixel.green));
1180WandExport
void PixelGetMagickColor(
const PixelWand *wand,
1181 MagickPixelPacket *color)
1183 assert(wand != (
const PixelWand *) NULL);
1184 assert(wand->signature == WandSignature);
1185 if (wand->debug != MagickFalse)
1186 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1187 assert(color != (MagickPixelPacket *) NULL);
1213WandExport
double PixelGetOpacity(
const PixelWand *wand)
1215 assert(wand != (
const PixelWand *) NULL);
1216 assert(wand->signature == WandSignature);
1217 if (wand->debug != MagickFalse)
1218 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1219 return((
double) QuantumScale*wand->pixel.opacity);
1244WandExport Quantum PixelGetOpacityQuantum(
const PixelWand *wand)
1246 assert(wand != (
const PixelWand *) NULL);
1247 assert(wand->signature == WandSignature);
1248 if (wand->debug != MagickFalse)
1249 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1250 return(ClampToQuantum(wand->pixel.opacity));
1277WandExport
void PixelGetQuantumColor(
const PixelWand *wand,PixelPacket *color)
1279 assert(wand != (
const PixelWand *) NULL);
1280 assert(wand->signature == WandSignature);
1281 if (wand->debug != MagickFalse)
1282 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1283 assert(color != (PixelPacket *) NULL);
1284 color->opacity=ClampToQuantum(wand->pixel.opacity);
1285 if (wand->pixel.colorspace == CMYKColorspace)
1287 color->red=ClampToQuantum((
double) QuantumRange-
1288 (wand->pixel.red*((
double) QuantumRange-wand->pixel.index)+
1289 wand->pixel.index));
1290 color->green=ClampToQuantum((
double) QuantumRange-
1291 (wand->pixel.green*((
double) QuantumRange-wand->pixel.index)+
1292 wand->pixel.index));
1293 color->blue=ClampToQuantum((
double) QuantumRange-
1294 (wand->pixel.blue*((
double) QuantumRange-wand->pixel.index)+
1295 wand->pixel.index));
1298 color->red=ClampToQuantum(wand->pixel.red);
1299 color->green=ClampToQuantum(wand->pixel.green);
1300 color->blue=ClampToQuantum(wand->pixel.blue);
1325WandExport
double PixelGetRed(
const PixelWand *wand)
1327 assert(wand != (
const PixelWand *) NULL);
1328 assert(wand->signature == WandSignature);
1329 if (wand->debug != MagickFalse)
1330 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1331 return((
double) QuantumScale*wand->pixel.red);
1356WandExport Quantum PixelGetRedQuantum(
const PixelWand *wand)
1358 assert(wand != (
const PixelWand *) NULL);
1359 assert(wand->signature == WandSignature);
1360 if (wand->debug != MagickFalse)
1361 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1362 return(ClampToQuantum(wand->pixel.red));
1387WandExport
double PixelGetYellow(
const PixelWand *wand)
1389 assert(wand != (
const PixelWand *) NULL);
1390 assert(wand->signature == WandSignature);
1391 if (wand->debug != MagickFalse)
1392 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1393 return((
double) QuantumScale*wand->pixel.blue);
1418WandExport Quantum PixelGetYellowQuantum(
const PixelWand *wand)
1420 assert(wand != (
const PixelWand *) NULL);
1421 assert(wand->signature == WandSignature);
1422 if (wand->debug != MagickFalse)
1423 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1424 return(ClampToQuantum(wand->pixel.blue));
1452WandExport
void PixelSetAlpha(
PixelWand *wand,
const double alpha)
1454 assert(wand != (
const PixelWand *) NULL);
1455 assert(wand->signature == WandSignature);
1456 if (wand->debug != MagickFalse)
1457 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1458 wand->pixel.opacity=(MagickRealType) (QuantumRange-
1459 ClampToQuantum((MagickRealType) QuantumRange*alpha));
1487WandExport
void PixelSetAlphaQuantum(
PixelWand *wand,
const Quantum opacity)
1489 assert(wand != (
const PixelWand *) NULL);
1490 assert(wand->signature == WandSignature);
1491 if (wand->debug != MagickFalse)
1492 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1493 wand->pixel.opacity=(MagickRealType) (QuantumRange-opacity);
1520WandExport
void PixelSetBlack(
PixelWand *wand,
const double black)
1522 assert(wand != (
const PixelWand *) NULL);
1523 assert(wand->signature == WandSignature);
1524 if (wand->debug != MagickFalse)
1525 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1526 wand->pixel.index=(MagickRealType) ClampToQuantum((MagickRealType)
1527 QuantumRange*black);
1554WandExport
void PixelSetBlackQuantum(
PixelWand *wand,
const Quantum black)
1556 assert(wand != (
const PixelWand *) NULL);
1557 assert(wand->signature == WandSignature);
1558 if (wand->debug != MagickFalse)
1559 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1560 wand->pixel.index=(MagickRealType) black;
1587WandExport
void PixelSetBlue(
PixelWand *wand,
const double blue)
1589 assert(wand != (
const PixelWand *) NULL);
1590 assert(wand->signature == WandSignature);
1591 if (wand->debug != MagickFalse)
1592 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1593 wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
1621WandExport
void PixelSetBlueQuantum(
PixelWand *wand,
const Quantum blue)
1623 assert(wand != (
const PixelWand *) NULL);
1624 assert(wand->signature == WandSignature);
1625 if (wand->debug != MagickFalse)
1626 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1627 wand->pixel.blue=(MagickRealType) blue;
1655WandExport MagickBooleanType PixelSetColor(
PixelWand *wand,
const char *color)
1663 assert(wand != (
const PixelWand *) NULL);
1664 assert(wand->signature == WandSignature);
1665 if (wand->debug != MagickFalse)
1666 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1667 status=QueryMagickColor(color,&pixel,wand->exception);
1668 if (status != MagickFalse)
1697WandExport
void PixelSetColorCount(
PixelWand *wand,
const size_t count)
1699 assert(wand != (
const PixelWand *) NULL);
1700 assert(wand->signature == WandSignature);
1701 if (wand->debug != MagickFalse)
1702 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1732 assert(wand != (
const PixelWand *) NULL);
1733 assert(wand->signature == WandSignature);
1734 if (wand->debug != MagickFalse)
1735 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1736 assert(color != (
const PixelWand *) NULL);
1737 wand->pixel=color->pixel;
1764WandExport
void PixelSetCyan(
PixelWand *wand,
const double cyan)
1766 assert(wand != (
const PixelWand *) NULL);
1767 assert(wand->signature == WandSignature);
1768 if (wand->debug != MagickFalse)
1769 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1770 wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
1798WandExport
void PixelSetCyanQuantum(
PixelWand *wand,
const Quantum cyan)
1800 assert(wand != (
const PixelWand *) NULL);
1801 assert(wand->signature == WandSignature);
1802 if (wand->debug != MagickFalse)
1803 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1804 wand->pixel.red=(MagickRealType) cyan;
1831WandExport
void PixelSetFuzz(
PixelWand *wand,
const double fuzz)
1833 assert(wand != (
const PixelWand *) NULL);
1834 assert(wand->signature == WandSignature);
1835 if (wand->debug != MagickFalse)
1836 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1837 wand->pixel.fuzz=(MagickRealType) fuzz;
1864WandExport
void PixelSetGreen(
PixelWand *wand,
const double green)
1866 assert(wand != (
const PixelWand *) NULL);
1867 assert(wand->signature == WandSignature);
1868 if (wand->debug != MagickFalse)
1869 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1870 wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
1871 QuantumRange*green);
1898WandExport
void PixelSetGreenQuantum(
PixelWand *wand,
const Quantum green)
1900 assert(wand != (
const PixelWand *) NULL);
1901 assert(wand->signature == WandSignature);
1902 if (wand->debug != MagickFalse)
1903 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1904 wand->pixel.green=(MagickRealType) green;
1933WandExport
void PixelSetHSL(
PixelWand *wand,
const double hue,
1934 const double saturation,
const double lightness)
1941 assert(wand != (
const PixelWand *) NULL);
1942 assert(wand->signature == WandSignature);
1943 if (wand->debug != MagickFalse)
1944 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1945 ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
1946 wand->pixel.red=(MagickRealType) red;
1947 wand->pixel.green=(MagickRealType) green;
1948 wand->pixel.blue=(MagickRealType) blue;
1975WandExport
void PixelSetIndex(
PixelWand *wand,
const IndexPacket index)
1977 assert(wand != (
const PixelWand *) NULL);
1978 assert(wand->signature == WandSignature);
1979 if (wand->debug != MagickFalse)
1980 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1981 wand->pixel.index=(MagickRealType) index;
2008WandExport
void PixelSetMagenta(
PixelWand *wand,
const double magenta)
2010 assert(wand != (
const PixelWand *) NULL);
2011 assert(wand->signature == WandSignature);
2012 if (wand->debug != MagickFalse)
2013 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2014 wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
2015 QuantumRange*magenta);
2043WandExport
void PixelSetMagentaQuantum(
PixelWand *wand,
const Quantum magenta)
2045 assert(wand != (
const PixelWand *) NULL);
2046 assert(wand->signature == WandSignature);
2047 if (wand->debug != MagickFalse)
2048 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2049 wand->pixel.green=(MagickRealType) magenta;
2076WandExport
void PixelSetMagickColor(
PixelWand *wand,
2077 const MagickPixelPacket *color)
2079 assert(wand != (
const PixelWand *) NULL);
2080 assert(wand->signature == WandSignature);
2081 if (wand->debug != MagickFalse)
2082 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2083 assert(color != (
const MagickPixelPacket *) NULL);
2084 wand->pixel=(*color);
2111WandExport
void PixelSetOpacity(
PixelWand *wand,
const double opacity)
2113 assert(wand != (
const PixelWand *) NULL);
2114 assert(wand->signature == WandSignature);
2115 if (wand->debug != MagickFalse)
2116 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2117 wand->pixel.matte=MagickTrue;
2118 wand->pixel.opacity=(MagickRealType) ClampToQuantum((MagickRealType)
2119 QuantumRange*opacity);
2147WandExport
void PixelSetOpacityQuantum(
PixelWand *wand,
const Quantum opacity)
2149 assert(wand != (
const PixelWand *) NULL);
2150 assert(wand->signature == WandSignature);
2151 if (wand->debug != MagickFalse)
2152 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2153 wand->pixel.opacity=(MagickRealType) opacity;
2180WandExport
void PixelSetQuantumColor(
PixelWand *wand,
const PixelPacket *color)
2182 assert(wand != (
const PixelWand *) NULL);
2183 assert(wand->signature == WandSignature);
2184 if (wand->debug != MagickFalse)
2185 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2186 assert(color != (PixelPacket *) NULL);
2187 wand->pixel.red=(MagickRealType) color->red;
2188 wand->pixel.green=(MagickRealType) color->green;
2189 wand->pixel.blue=(MagickRealType) color->blue;
2190 wand->pixel.opacity=(MagickRealType) color->opacity;
2191 wand->pixel.matte=color->opacity != OpaqueOpacity ? MagickTrue : MagickFalse;
2218WandExport
void PixelSetRed(
PixelWand *wand,
const double red)
2220 assert(wand != (
const PixelWand *) NULL);
2221 assert(wand->signature == WandSignature);
2222 if (wand->debug != MagickFalse)
2223 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2224 wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
2252WandExport
void PixelSetRedQuantum(
PixelWand *wand,
const Quantum red)
2254 assert(wand != (
const PixelWand *) NULL);
2255 assert(wand->signature == WandSignature);
2256 if (wand->debug != MagickFalse)
2257 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2258 wand->pixel.red=(MagickRealType) red;
2285WandExport
void PixelSetYellow(
PixelWand *wand,
const double yellow)
2287 assert(wand != (
const PixelWand *) NULL);
2288 assert(wand->signature == WandSignature);
2289 if (wand->debug != MagickFalse)
2290 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2291 wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
2292 QuantumRange*yellow);
2319WandExport
void PixelSetYellowQuantum(
PixelWand *wand,
const Quantum yellow)
2321 assert(wand != (
const PixelWand *) NULL);
2322 assert(wand->signature == WandSignature);
2323 if (wand->debug != MagickFalse)
2324 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2325 wand->pixel.blue=(MagickRealType) yellow;