49 #include "wand/studio.h"
50 #include "wand/MagickWand.h"
51 #include "wand/magick-wand-private.h"
52 #include "wand/pixel-wand-private.h"
53 #include "wand/wand.h"
58 #define PixelWandId "PixelWand"
109 WandExport
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));
353 WandExport 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;
433 WandExport
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();
470 WandExport 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);
502 WandExport
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((
double) QuantumScale*(QuantumRange-wand->pixel.opacity));
533 WandExport 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));
564 WandExport
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);
595 WandExport 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));
626 WandExport
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);
657 WandExport 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));
688 WandExport
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);
729 WandExport
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));
773 WandExport
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);
804 WandExport
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);
835 WandExport 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));
869 WandExport
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);
923 WandExport 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);
954 WandExport
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);
985 WandExport
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);
1016 WandExport 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));
1051 WandExport
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,
1085 WandExport 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);
1116 WandExport
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);
1147 WandExport 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));
1180 WandExport
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);
1213 WandExport
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);
1244 WandExport 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));
1277 WandExport
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((MagickRealType) QuantumRange-
1288 (wand->pixel.red*(QuantumRange-wand->pixel.index)+wand->pixel.index));
1289 color->green=ClampToQuantum((MagickRealType) QuantumRange-
1290 (wand->pixel.green*(QuantumRange-wand->pixel.index)+
1291 wand->pixel.index));
1292 color->blue=ClampToQuantum((MagickRealType) QuantumRange-
1293 (wand->pixel.blue*(QuantumRange-wand->pixel.index)+wand->pixel.index));
1296 color->red=ClampToQuantum(wand->pixel.red);
1297 color->green=ClampToQuantum(wand->pixel.green);
1298 color->blue=ClampToQuantum(wand->pixel.blue);
1323 WandExport
double PixelGetRed(
const PixelWand *wand)
1325 assert(wand != (
const PixelWand *) NULL);
1326 assert(wand->signature == WandSignature);
1327 if (wand->debug != MagickFalse)
1328 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1329 return((
double) QuantumScale*wand->pixel.red);
1354 WandExport Quantum PixelGetRedQuantum(
const PixelWand *wand)
1356 assert(wand != (
const PixelWand *) NULL);
1357 assert(wand->signature == WandSignature);
1358 if (wand->debug != MagickFalse)
1359 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1360 return(ClampToQuantum(wand->pixel.red));
1385 WandExport
double PixelGetYellow(
const PixelWand *wand)
1387 assert(wand != (
const PixelWand *) NULL);
1388 assert(wand->signature == WandSignature);
1389 if (wand->debug != MagickFalse)
1390 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1391 return((
double) QuantumScale*wand->pixel.blue);
1416 WandExport Quantum PixelGetYellowQuantum(
const PixelWand *wand)
1418 assert(wand != (
const PixelWand *) NULL);
1419 assert(wand->signature == WandSignature);
1420 if (wand->debug != MagickFalse)
1421 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1422 return(ClampToQuantum(wand->pixel.blue));
1450 WandExport
void PixelSetAlpha(
PixelWand *wand,
const double alpha)
1452 assert(wand != (
const PixelWand *) NULL);
1453 assert(wand->signature == WandSignature);
1454 if (wand->debug != MagickFalse)
1455 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1456 wand->pixel.opacity=(MagickRealType) (QuantumRange-
1457 ClampToQuantum((MagickRealType) QuantumRange*alpha));
1485 WandExport
void PixelSetAlphaQuantum(
PixelWand *wand,
const Quantum opacity)
1487 assert(wand != (
const PixelWand *) NULL);
1488 assert(wand->signature == WandSignature);
1489 if (wand->debug != MagickFalse)
1490 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1491 wand->pixel.opacity=(MagickRealType) (QuantumRange-opacity);
1518 WandExport
void PixelSetBlack(
PixelWand *wand,
const double black)
1520 assert(wand != (
const PixelWand *) NULL);
1521 assert(wand->signature == WandSignature);
1522 if (wand->debug != MagickFalse)
1523 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1524 wand->pixel.index=(MagickRealType) ClampToQuantum((MagickRealType)
1525 QuantumRange*black);
1552 WandExport
void PixelSetBlackQuantum(
PixelWand *wand,
const Quantum black)
1554 assert(wand != (
const PixelWand *) NULL);
1555 assert(wand->signature == WandSignature);
1556 if (wand->debug != MagickFalse)
1557 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1558 wand->pixel.index=(MagickRealType) black;
1585 WandExport
void PixelSetBlue(
PixelWand *wand,
const double blue)
1587 assert(wand != (
const PixelWand *) NULL);
1588 assert(wand->signature == WandSignature);
1589 if (wand->debug != MagickFalse)
1590 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1591 wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
1619 WandExport
void PixelSetBlueQuantum(
PixelWand *wand,
const Quantum blue)
1621 assert(wand != (
const PixelWand *) NULL);
1622 assert(wand->signature == WandSignature);
1623 if (wand->debug != MagickFalse)
1624 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1625 wand->pixel.blue=(MagickRealType) blue;
1653 WandExport MagickBooleanType PixelSetColor(
PixelWand *wand,
const char *color)
1661 assert(wand != (
const PixelWand *) NULL);
1662 assert(wand->signature == WandSignature);
1663 if (wand->debug != MagickFalse)
1664 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1665 status=QueryMagickColor(color,&pixel,wand->exception);
1666 if (status != MagickFalse)
1695 WandExport
void PixelSetColorCount(
PixelWand *wand,
const size_t count)
1697 assert(wand != (
const PixelWand *) NULL);
1698 assert(wand->signature == WandSignature);
1699 if (wand->debug != MagickFalse)
1700 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1730 assert(wand != (
const PixelWand *) NULL);
1731 assert(wand->signature == WandSignature);
1732 if (wand->debug != MagickFalse)
1733 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1734 assert(color != (
const PixelWand *) NULL);
1735 wand->pixel=color->pixel;
1762 WandExport
void PixelSetCyan(
PixelWand *wand,
const double cyan)
1764 assert(wand != (
const PixelWand *) NULL);
1765 assert(wand->signature == WandSignature);
1766 if (wand->debug != MagickFalse)
1767 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1768 wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
1796 WandExport
void PixelSetCyanQuantum(
PixelWand *wand,
const Quantum cyan)
1798 assert(wand != (
const PixelWand *) NULL);
1799 assert(wand->signature == WandSignature);
1800 if (wand->debug != MagickFalse)
1801 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1802 wand->pixel.red=(MagickRealType) cyan;
1829 WandExport
void PixelSetFuzz(
PixelWand *wand,
const double fuzz)
1831 assert(wand != (
const PixelWand *) NULL);
1832 assert(wand->signature == WandSignature);
1833 if (wand->debug != MagickFalse)
1834 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1835 wand->pixel.fuzz=(MagickRealType) fuzz;
1862 WandExport
void PixelSetGreen(
PixelWand *wand,
const double green)
1864 assert(wand != (
const PixelWand *) NULL);
1865 assert(wand->signature == WandSignature);
1866 if (wand->debug != MagickFalse)
1867 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1868 wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
1869 QuantumRange*green);
1896 WandExport
void PixelSetGreenQuantum(
PixelWand *wand,
const Quantum green)
1898 assert(wand != (
const PixelWand *) NULL);
1899 assert(wand->signature == WandSignature);
1900 if (wand->debug != MagickFalse)
1901 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1902 wand->pixel.green=(MagickRealType) green;
1931 WandExport
void PixelSetHSL(
PixelWand *wand,
const double hue,
1932 const double saturation,
const double lightness)
1939 assert(wand != (
const PixelWand *) NULL);
1940 assert(wand->signature == WandSignature);
1941 if (wand->debug != MagickFalse)
1942 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1943 ConvertHSLToRGB(hue,saturation,lightness,&red,&green,&blue);
1944 wand->pixel.red=(MagickRealType) red;
1945 wand->pixel.green=(MagickRealType) green;
1946 wand->pixel.blue=(MagickRealType) blue;
1973 WandExport
void PixelSetIndex(
PixelWand *wand,
const IndexPacket index)
1975 assert(wand != (
const PixelWand *) NULL);
1976 assert(wand->signature == WandSignature);
1977 if (wand->debug != MagickFalse)
1978 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
1979 wand->pixel.index=(MagickRealType) index;
2006 WandExport
void PixelSetMagenta(
PixelWand *wand,
const double magenta)
2008 assert(wand != (
const PixelWand *) NULL);
2009 assert(wand->signature == WandSignature);
2010 if (wand->debug != MagickFalse)
2011 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2012 wand->pixel.green=(MagickRealType) ClampToQuantum((MagickRealType)
2013 QuantumRange*magenta);
2041 WandExport
void PixelSetMagentaQuantum(
PixelWand *wand,
const Quantum magenta)
2043 assert(wand != (
const PixelWand *) NULL);
2044 assert(wand->signature == WandSignature);
2045 if (wand->debug != MagickFalse)
2046 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2047 wand->pixel.green=(MagickRealType) magenta;
2074 WandExport
void PixelSetMagickColor(
PixelWand *wand,
2075 const MagickPixelPacket *color)
2077 assert(wand != (
const PixelWand *) NULL);
2078 assert(wand->signature == WandSignature);
2079 if (wand->debug != MagickFalse)
2080 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2081 assert(color != (
const MagickPixelPacket *) NULL);
2082 wand->pixel=(*color);
2109 WandExport
void PixelSetOpacity(
PixelWand *wand,
const double opacity)
2111 assert(wand != (
const PixelWand *) NULL);
2112 assert(wand->signature == WandSignature);
2113 if (wand->debug != MagickFalse)
2114 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2115 wand->pixel.matte=MagickTrue;
2116 wand->pixel.opacity=(MagickRealType) ClampToQuantum((MagickRealType)
2117 QuantumRange*opacity);
2145 WandExport
void PixelSetOpacityQuantum(
PixelWand *wand,
const Quantum opacity)
2147 assert(wand != (
const PixelWand *) NULL);
2148 assert(wand->signature == WandSignature);
2149 if (wand->debug != MagickFalse)
2150 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2151 wand->pixel.opacity=(MagickRealType) opacity;
2178 WandExport
void PixelSetQuantumColor(
PixelWand *wand,
const PixelPacket *color)
2180 assert(wand != (
const PixelWand *) NULL);
2181 assert(wand->signature == WandSignature);
2182 if (wand->debug != MagickFalse)
2183 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2184 assert(color != (PixelPacket *) NULL);
2185 wand->pixel.red=(MagickRealType) color->red;
2186 wand->pixel.green=(MagickRealType) color->green;
2187 wand->pixel.blue=(MagickRealType) color->blue;
2188 wand->pixel.opacity=(MagickRealType) color->opacity;
2189 wand->pixel.matte=color->opacity != OpaqueOpacity ? MagickTrue : MagickFalse;
2216 WandExport
void PixelSetRed(
PixelWand *wand,
const double red)
2218 assert(wand != (
const PixelWand *) NULL);
2219 assert(wand->signature == WandSignature);
2220 if (wand->debug != MagickFalse)
2221 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2222 wand->pixel.red=(MagickRealType) ClampToQuantum((MagickRealType)
2250 WandExport
void PixelSetRedQuantum(
PixelWand *wand,
const Quantum red)
2252 assert(wand != (
const PixelWand *) NULL);
2253 assert(wand->signature == WandSignature);
2254 if (wand->debug != MagickFalse)
2255 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2256 wand->pixel.red=(MagickRealType) red;
2283 WandExport
void PixelSetYellow(
PixelWand *wand,
const double yellow)
2285 assert(wand != (
const PixelWand *) NULL);
2286 assert(wand->signature == WandSignature);
2287 if (wand->debug != MagickFalse)
2288 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2289 wand->pixel.blue=(MagickRealType) ClampToQuantum((MagickRealType)
2290 QuantumRange*yellow);
2317 WandExport
void PixelSetYellowQuantum(
PixelWand *wand,
const Quantum yellow)
2319 assert(wand != (
const PixelWand *) NULL);
2320 assert(wand->signature == WandSignature);
2321 if (wand->debug != MagickFalse)
2322 (void) LogMagickEvent(WandEvent,GetMagickModule(),
"%s",wand->name);
2323 wand->pixel.blue=(MagickRealType) yellow;