2 Copyright 1999-2013 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License.
6 obtain a copy of the License at
8 http://www.imagemagick.org/script/license.php
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
16 MagickCore pixel accessor methods.
18 #ifndef _MAGICKCORE_PIXEL_ACCESSOR_H
19 #define _MAGICKCORE_PIXEL_ACCESSOR_H
21 #if defined(__cplusplus) || defined(c_plusplus)
26 #include "MagickCore/cache.h"
27 #include "MagickCore/cache-view.h"
28 #include "MagickCore/color.h"
29 #include "MagickCore/colorspace.h"
30 #include "MagickCore/gem.h"
31 #include "MagickCore/image.h"
35 static inline Quantum GetPixela(const Image *restrict image,
36 const Quantum *restrict pixel)
38 return(pixel[image->channel_map[aPixelChannel].offset]);
41 static inline Quantum GetPixelAlpha(const Image *restrict image,
42 const Quantum *restrict pixel)
44 if (image->channel_map[AlphaPixelChannel].traits == UndefinedPixelTrait)
46 return(pixel[image->channel_map[AlphaPixelChannel].offset]);
49 static inline PixelTrait GetPixelAlphaTraits(const Image *restrict image)
51 return(image->channel_map[AlphaPixelChannel].traits);
54 static inline Quantum GetPixelb(const Image *restrict image,
55 const Quantum *restrict pixel)
57 return(pixel[image->channel_map[bPixelChannel].offset]);
60 static inline Quantum GetPixelBlack(const Image *restrict image,
61 const Quantum *restrict pixel)
63 if (image->channel_map[BlackPixelChannel].traits == UndefinedPixelTrait)
65 return(pixel[image->channel_map[BlackPixelChannel].offset]);
68 static inline PixelTrait GetPixelBlackTraits(const Image *restrict image)
70 return(image->channel_map[BlackPixelChannel].traits);
73 static inline Quantum GetPixelBlue(const Image *restrict image,
74 const Quantum *restrict pixel)
76 return(pixel[image->channel_map[BluePixelChannel].offset]);
79 static inline PixelTrait GetPixelBlueTraits(const Image *restrict image)
81 return(image->channel_map[BluePixelChannel].traits);
84 static inline Quantum GetPixelCb(const Image *restrict image,
85 const Quantum *restrict pixel)
87 return(pixel[image->channel_map[CbPixelChannel].offset]);
90 static inline PixelTrait GetPixelCbTraits(const Image *restrict image)
92 return(image->channel_map[CbPixelChannel].traits);
95 static inline Quantum GetPixelChannel(const Image *restrict image,
96 const PixelChannel channel,const Quantum *restrict pixel)
98 if (image->channel_map[channel].traits == UndefinedPixelTrait)
100 return(pixel[image->channel_map[channel].offset]);
103 static inline PixelChannel GetPixelChannelChannel(const Image *restrict image,
104 const ssize_t offset)
106 return(image->channel_map[offset].channel);
109 static inline ssize_t GetPixelChannelOffset(const Image *restrict image,
110 const PixelChannel channel)
112 return(image->channel_map[channel].offset);
115 static inline PixelTrait GetPixelChannelTraits(const Image *restrict image,
116 const PixelChannel channel)
118 return(image->channel_map[channel].traits);
121 static inline size_t GetPixelChannels(const Image *restrict image)
123 return(image->number_channels);
126 static inline Quantum GetPixelCr(const Image *restrict image,
127 const Quantum *restrict pixel)
129 return(pixel[image->channel_map[CrPixelChannel].offset]);
132 static inline PixelTrait GetPixelCrTraits(const Image *restrict image)
134 return(image->channel_map[CrPixelChannel].traits);
137 static inline Quantum GetPixelCyan(const Image *restrict image,
138 const Quantum *restrict pixel)
140 return(pixel[image->channel_map[CyanPixelChannel].offset]);
143 static inline PixelTrait GetPixelCyanTraits(const Image *restrict image)
145 return(image->channel_map[CyanPixelChannel].traits);
148 static inline Quantum GetPixelGray(const Image *restrict image,
149 const Quantum *restrict pixel)
151 return(pixel[image->channel_map[GrayPixelChannel].offset]);
154 static inline PixelTrait GetPixelGrayTraits(const Image *restrict image)
156 return(image->channel_map[GrayPixelChannel].traits);
159 static inline Quantum GetPixelGreen(const Image *restrict image,
160 const Quantum *restrict pixel)
162 return(pixel[image->channel_map[GreenPixelChannel].offset]);
165 static inline PixelTrait GetPixelGreenTraits(const Image *restrict image)
167 return(image->channel_map[GreenPixelChannel].traits);
170 static inline Quantum GetPixelIndex(const Image *restrict image,
171 const Quantum *restrict pixel)
173 if (image->channel_map[IndexPixelChannel].traits == UndefinedPixelTrait)
175 return(pixel[image->channel_map[IndexPixelChannel].offset]);
178 static inline PixelTrait GetPixelIndexTraits(const Image *restrict image)
180 return(image->channel_map[IndexPixelChannel].traits);
183 static inline MagickRealType GetPixelInfoChannel(
184 const PixelInfo *restrict pixel_info,const PixelChannel channel)
188 case RedPixelChannel: return(pixel_info->red);
189 case GreenPixelChannel: return(pixel_info->green);
190 case BluePixelChannel: return(pixel_info->blue);
191 case BlackPixelChannel: return(pixel_info->black);
192 case AlphaPixelChannel: return(pixel_info->alpha);
193 case IndexPixelChannel: return(pixel_info->index);
194 default: return((MagickRealType) 0.0);
198 static inline MagickRealType GetPixelInfoIntensity(
199 const PixelInfo *restrict pixel_info)
206 if (pixel_info->colorspace == GRAYColorspace)
207 return(pixel_info->red);
208 if (pixel_info->colorspace != sRGBColorspace)
209 return(0.298839f*pixel_info->red+0.586811f*pixel_info->green+
210 0.114350f*pixel_info->blue);
211 red=DecodePixelGamma(pixel_info->red);
212 green=DecodePixelGamma(pixel_info->green);
213 blue=DecodePixelGamma(pixel_info->blue);
214 return(0.298839f*red+0.586811f*green+0.114350f*blue);
217 static inline MagickRealType GetPixelInfoLuminance(
218 const PixelInfo *restrict pixel_info)
225 if (pixel_info->colorspace == GRAYColorspace)
226 return(pixel_info->red);
227 if (pixel_info->colorspace != sRGBColorspace)
228 return(0.21267f*pixel_info->red+0.71516f*pixel_info->green+
229 0.07217f*pixel_info->blue);
230 red=DecodePixelGamma(pixel_info->red);
231 green=DecodePixelGamma(pixel_info->green);
232 blue=DecodePixelGamma(pixel_info->blue);
233 return(0.21267f*red+0.71516f*green+0.07217f*blue);
236 static inline MagickRealType GetPixelIntensity(const Image *restrict image,
237 const Quantum *restrict pixel)
244 if (image->colorspace == GRAYColorspace)
245 return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
246 if (image->colorspace != sRGBColorspace)
247 return(0.298839f*pixel[image->channel_map[RedPixelChannel].offset]+
248 0.586811f*pixel[image->channel_map[GreenPixelChannel].offset]+
249 0.114350f*pixel[image->channel_map[BluePixelChannel].offset]);
250 red=DecodePixelGamma((MagickRealType)
251 pixel[image->channel_map[RedPixelChannel].offset]);
252 green=DecodePixelGamma((MagickRealType)
253 pixel[image->channel_map[GreenPixelChannel].offset]);
254 blue=DecodePixelGamma((MagickRealType)
255 pixel[image->channel_map[BluePixelChannel].offset]);
256 return(0.298839f*red+0.586811f*green+0.114350f*blue);
259 static inline Quantum GetPixelL(const Image *restrict image,
260 const Quantum *restrict pixel)
262 return(pixel[image->channel_map[LPixelChannel].offset]);
265 static inline MagickRealType GetPixelLuminance(const Image *restrict image,
266 const Quantum *restrict pixel)
273 if (image->colorspace == GRAYColorspace)
274 return((MagickRealType) pixel[image->channel_map[GrayPixelChannel].offset]);
275 if (image->colorspace != sRGBColorspace)
276 return(0.298839f*pixel[image->channel_map[RedPixelChannel].offset]+
277 0.586811f*pixel[image->channel_map[GreenPixelChannel].offset]+
278 0.114350f*pixel[image->channel_map[BluePixelChannel].offset]);
279 red=DecodePixelGamma((MagickRealType)
280 pixel[image->channel_map[RedPixelChannel].offset]);
281 green=DecodePixelGamma((MagickRealType)
282 pixel[image->channel_map[GreenPixelChannel].offset]);
283 blue=DecodePixelGamma((MagickRealType)
284 pixel[image->channel_map[BluePixelChannel].offset]);
285 return(0.21267f*red+0.71516f*green+0.07217f*blue);
288 static inline Quantum GetPixelMagenta(const Image *restrict image,
289 const Quantum *restrict pixel)
291 return(pixel[image->channel_map[MagentaPixelChannel].offset]);
294 static inline PixelTrait GetPixelMagentaTraits(const Image *restrict image)
296 return(image->channel_map[MagentaPixelChannel].traits);
299 static inline Quantum GetPixelMask(const Image *restrict image,
300 const Quantum *restrict pixel)
302 if (image->channel_map[MaskPixelChannel].traits == UndefinedPixelTrait)
304 return(pixel[image->channel_map[MaskPixelChannel].offset]);
307 static inline PixelTrait GetPixelMaskTraits(const Image *restrict image)
309 return(image->channel_map[MaskPixelChannel].traits);
312 static inline size_t GetPixelMetaChannels(const Image *restrict image)
314 return(image->number_meta_channels);
317 static inline size_t GetPixelMetacontentExtent(const Image *restrict image)
319 return(image->metacontent_extent);
322 static inline Quantum GetPixelOpacity(const Image *restrict image,
323 const Quantum *restrict pixel)
325 if (image->channel_map[AlphaPixelChannel].traits == UndefinedPixelTrait)
326 return(QuantumRange-OpaqueAlpha);
327 return(QuantumRange-pixel[image->channel_map[AlphaPixelChannel].offset]);
330 static inline Quantum GetPixelRed(const Image *restrict image,
331 const Quantum *restrict pixel)
333 return(pixel[image->channel_map[RedPixelChannel].offset]);
336 static inline PixelTrait GetPixelRedTraits(const Image *restrict image)
338 return(image->channel_map[RedPixelChannel].traits);
341 static inline void GetPixelInfoPixel(const Image *restrict image,
342 const Quantum *restrict pixel,PixelInfo *restrict pixel_info)
344 pixel_info->red=(MagickRealType)
345 pixel[image->channel_map[RedPixelChannel].offset];
346 pixel_info->green=(MagickRealType)
347 pixel[image->channel_map[GreenPixelChannel].offset];
348 pixel_info->blue=(MagickRealType)
349 pixel[image->channel_map[BluePixelChannel].offset];
350 pixel_info->black=0.0f;
351 if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
352 pixel_info->black=(MagickRealType)
353 pixel[image->channel_map[BlackPixelChannel].offset];
354 pixel_info->alpha=(MagickRealType) OpaqueAlpha;
355 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
356 pixel_info->alpha=(MagickRealType)
357 pixel[image->channel_map[AlphaPixelChannel].offset];
358 pixel_info->index=0.0f;
359 if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
360 pixel_info->index=(MagickRealType)
361 pixel[image->channel_map[IndexPixelChannel].offset];
364 static inline PixelTrait GetPixelTraits(const Image *restrict image,
365 const PixelChannel channel)
367 return(image->channel_map[channel].traits);
370 static inline Quantum GetPixelY(const Image *restrict image,
371 const Quantum *restrict pixel)
373 return(pixel[image->channel_map[YPixelChannel].offset]);
376 static inline PixelTrait GetPixelYTraits(const Image *restrict image)
378 return(image->channel_map[YPixelChannel].traits);
381 static inline Quantum GetPixelYellow(const Image *restrict image,
382 const Quantum *restrict pixel)
384 return(pixel[image->channel_map[YellowPixelChannel].offset]);
387 static inline PixelTrait GetPixelYellowTraits(const Image *restrict image)
389 return(image->channel_map[YellowPixelChannel].traits);
392 static inline MagickRealType AbsolutePixelValue(const MagickRealType x)
394 return(x < 0.0f ? -x : x);
397 static inline MagickBooleanType IsPixelEquivalent(const Image *restrict image,
398 const Quantum *restrict p,const PixelInfo *restrict q)
405 red=(MagickRealType) p[image->channel_map[RedPixelChannel].offset];
406 green=(MagickRealType) p[image->channel_map[GreenPixelChannel].offset];
407 blue=(MagickRealType) p[image->channel_map[BluePixelChannel].offset];
408 if ((AbsolutePixelValue(red-q->red) < MagickEpsilon) &&
409 (AbsolutePixelValue(green-q->green) < MagickEpsilon) &&
410 (AbsolutePixelValue(blue-q->blue) < MagickEpsilon))
415 static inline MagickBooleanType IsPixelGray(const Image *restrict image,
416 const Quantum *restrict pixel)
423 red=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset];
424 green=(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset];
425 blue=(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset];
426 if ((AbsolutePixelValue(red-green) < MagickEpsilon) &&
427 (AbsolutePixelValue(green-blue) < MagickEpsilon))
432 static inline MagickBooleanType IsPixelInfoEquivalent(
433 const PixelInfo *restrict p,const PixelInfo *restrict q)
435 if ((p->alpha_trait == BlendPixelTrait) &&
436 (q->alpha_trait != BlendPixelTrait) &&
437 (AbsolutePixelValue(p->alpha-OpaqueAlpha) >= MagickEpsilon))
439 if ((q->alpha_trait == BlendPixelTrait) &&
440 (p->alpha_trait != BlendPixelTrait) &&
441 (AbsolutePixelValue(q->alpha-OpaqueAlpha)) >= MagickEpsilon)
443 if ((p->alpha_trait == BlendPixelTrait) &&
444 (q->alpha_trait == BlendPixelTrait))
446 if (AbsolutePixelValue(p->alpha-q->alpha) >= MagickEpsilon)
448 if (AbsolutePixelValue(p->alpha-TransparentAlpha) < MagickEpsilon)
451 if (AbsolutePixelValue(p->red-q->red) >= MagickEpsilon)
453 if (AbsolutePixelValue(p->green-q->green) >= MagickEpsilon)
455 if (AbsolutePixelValue(p->blue-q->blue) >= MagickEpsilon)
457 if ((p->colorspace == CMYKColorspace) &&
458 (AbsolutePixelValue(p->black-q->black) >= MagickEpsilon))
463 static inline MagickBooleanType IsPixelMonochrome(const Image *restrict image,
464 const Quantum *restrict pixel)
471 red=(MagickRealType) pixel[image->channel_map[RedPixelChannel].offset];
472 if ((AbsolutePixelValue(red) >= MagickEpsilon) ||
473 (AbsolutePixelValue(red-QuantumRange) >= MagickEpsilon))
475 green=(MagickRealType) pixel[image->channel_map[GreenPixelChannel].offset];
476 blue=(MagickRealType) pixel[image->channel_map[BluePixelChannel].offset];
477 if ((AbsolutePixelValue(red-green) < MagickEpsilon) &&
478 (AbsolutePixelValue(green-blue) < MagickEpsilon))
483 static inline MagickBooleanType IsPixelInfoGray(
484 const PixelInfo *restrict pixel_info)
486 if ((pixel_info->colorspace != GRAYColorspace) &&
487 (pixel_info->colorspace != RGBColorspace))
489 if ((AbsolutePixelValue(pixel_info->red-pixel_info->green) < MagickEpsilon) &&
490 (AbsolutePixelValue(pixel_info->green-pixel_info->blue) < MagickEpsilon))
495 static inline MagickBooleanType IsPixelInfoMonochrome(
496 const PixelInfo *restrict pixel_info)
498 if ((pixel_info->colorspace != GRAYColorspace) &&
499 (pixel_info->colorspace != RGBColorspace))
501 if ((AbsolutePixelValue(pixel_info->red) >= MagickEpsilon) ||
502 (AbsolutePixelValue(pixel_info->red-QuantumRange) >= MagickEpsilon))
504 if ((AbsolutePixelValue(pixel_info->red-pixel_info->green) < MagickEpsilon) &&
505 (AbsolutePixelValue(pixel_info->green-pixel_info->blue) < MagickEpsilon))
510 static inline void SetPixela(const Image *restrict image,
511 const Quantum a,Quantum *restrict pixel)
513 if (image->channel_map[aPixelChannel].traits != UndefinedPixelTrait)
514 pixel[image->channel_map[aPixelChannel].offset]=a;
517 static inline void SetPixelAlpha(const Image *restrict image,
518 const Quantum alpha,Quantum *restrict pixel)
520 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
521 pixel[image->channel_map[AlphaPixelChannel].offset]=alpha;
524 static inline void SetPixelAlphaTraits(Image *image,const PixelTrait traits)
526 image->channel_map[AlphaPixelChannel].traits=traits;
529 static inline void SetPixelb(const Image *restrict image,
530 const Quantum b,Quantum *restrict pixel)
532 if (image->channel_map[bPixelChannel].traits != UndefinedPixelTrait)
533 pixel[image->channel_map[bPixelChannel].offset]=b;
536 static inline void SetPixelBlack(const Image *restrict image,
537 const Quantum black,Quantum *restrict pixel)
539 if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
540 pixel[image->channel_map[BlackPixelChannel].offset]=black;
543 static inline void SetPixelBlackTraits(Image *image,const PixelTrait traits)
545 image->channel_map[BlackPixelChannel].traits=traits;
548 static inline void SetPixelBlue(const Image *restrict image,const Quantum blue,
549 Quantum *restrict pixel)
551 pixel[image->channel_map[BluePixelChannel].offset]=blue;
554 static inline void SetPixelBlueTraits(Image *image,const PixelTrait traits)
556 image->channel_map[BluePixelChannel].traits=traits;
559 static inline void SetPixelCb(const Image *restrict image,const Quantum cb,
560 Quantum *restrict pixel)
562 pixel[image->channel_map[CbPixelChannel].offset]=cb;
565 static inline void SetPixelCbTraits(Image *image,const PixelTrait traits)
567 image->channel_map[CbPixelChannel].traits=traits;
570 static inline void SetPixelChannel(const Image *restrict image,
571 const PixelChannel channel,const Quantum quantum,Quantum *restrict pixel)
573 if (image->channel_map[channel].traits != UndefinedPixelTrait)
574 pixel[image->channel_map[channel].offset]=quantum;
577 static inline void SetPixelChannelAttributes(const Image *restrict image,
578 const PixelChannel channel,const PixelTrait traits,const ssize_t offset)
580 image->channel_map[offset].channel=channel;
581 image->channel_map[channel].offset=offset;
582 image->channel_map[channel].traits=traits;
585 static inline void SetPixelChannelChannel(const Image *restrict image,
586 const PixelChannel channel,const ssize_t offset)
588 image->channel_map[offset].channel=channel;
589 image->channel_map[channel].offset=offset;
592 static inline void SetPixelChannels(Image *image,const size_t number_channels)
594 image->number_channels=number_channels;
597 static inline void SetPixelChannelTraits(Image *image,
598 const PixelChannel channel,const PixelTrait traits)
600 image->channel_map[channel].traits=traits;
603 static inline void SetPixelCr(const Image *restrict image,const Quantum cr,
604 Quantum *restrict pixel)
606 pixel[image->channel_map[CrPixelChannel].offset]=cr;
609 static inline void SetPixelCrTraits(Image *image,const PixelTrait traits)
611 image->channel_map[CrPixelChannel].traits=traits;
614 static inline void SetPixelCyan(const Image *restrict image,const Quantum cyan,
615 Quantum *restrict pixel)
617 pixel[image->channel_map[CyanPixelChannel].offset]=cyan;
620 static inline void SetPixelGray(const Image *restrict image,const Quantum gray,
621 Quantum *restrict pixel)
623 pixel[image->channel_map[GrayPixelChannel].offset]=gray;
626 static inline void SetPixelGrayTraits(Image *image,const PixelTrait traits)
628 image->channel_map[GrayPixelChannel].traits=traits;
631 static inline void SetPixelGreen(const Image *restrict image,
632 const Quantum green,Quantum *restrict pixel)
634 pixel[image->channel_map[GreenPixelChannel].offset]=green;
637 static inline void SetPixelGreenTraits(Image *image,const PixelTrait traits)
639 image->channel_map[GreenPixelChannel].traits=traits;
642 static inline void SetPixelIndex(const Image *restrict image,
643 const Quantum index,Quantum *restrict pixel)
645 if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
646 pixel[image->channel_map[IndexPixelChannel].offset]=index;
649 static inline void SetPixelIndexTraits(Image *image,const PixelTrait traits)
651 image->channel_map[IndexPixelChannel].traits=traits;
654 static inline void SetPixelInfoPixel(const Image *restrict image,
655 const PixelInfo *restrict pixel_info,Quantum *restrict pixel)
657 pixel[image->channel_map[RedPixelChannel].offset]=
658 ClampToQuantum(pixel_info->red);
659 pixel[image->channel_map[GreenPixelChannel].offset]=
660 ClampToQuantum(pixel_info->green);
661 pixel[image->channel_map[BluePixelChannel].offset]=
662 ClampToQuantum(pixel_info->blue);
663 if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
664 pixel[image->channel_map[BlackPixelChannel].offset]=
665 ClampToQuantum(pixel_info->black);
666 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
667 pixel[image->channel_map[AlphaPixelChannel].offset]=
668 pixel_info->alpha_trait != BlendPixelTrait ? OpaqueAlpha :
669 ClampToQuantum(pixel_info->alpha);
672 static inline void SetPixelL(const Image *restrict image,const Quantum L,
673 Quantum *restrict pixel)
675 if (image->channel_map[LPixelChannel].traits != UndefinedPixelTrait)
676 pixel[image->channel_map[LPixelChannel].offset]=L;
679 static inline void SetPixelMagenta(const Image *restrict image,
680 const Quantum magenta,Quantum *restrict pixel)
682 pixel[image->channel_map[MagentaPixelChannel].offset]=magenta;
685 static inline void SetPixelMagentaTraits(Image *image,const PixelTrait traits)
687 image->channel_map[MagentaPixelChannel].traits=traits;
690 static inline void SetPixelMask(const Image *restrict image,
691 const Quantum mask,Quantum *restrict pixel)
693 if (image->channel_map[MaskPixelChannel].traits != UndefinedPixelTrait)
694 pixel[image->channel_map[MaskPixelChannel].offset]=mask;
697 static inline void SetPixelMetacontentExtent(Image *image,const size_t extent)
699 image->metacontent_extent=extent;
702 static inline void SetPixelOpacity(const Image *restrict image,
703 const Quantum alpha,Quantum *restrict pixel)
705 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
706 pixel[image->channel_map[AlphaPixelChannel].offset]=QuantumRange-alpha;
709 static inline void SetPixelRed(const Image *restrict image,const Quantum red,
710 Quantum *restrict pixel)
712 pixel[image->channel_map[RedPixelChannel].offset]=red;
715 static inline void SetPixelRedTraits(Image *image,const PixelTrait traits)
717 image->channel_map[RedPixelChannel].traits=traits;
720 static inline void SetPixelYellow(const Image *restrict image,
721 const Quantum yellow,Quantum *restrict pixel)
723 pixel[image->channel_map[YellowPixelChannel].offset]=yellow;
726 static inline void SetPixelYellowTraits(Image *image,const PixelTrait traits)
728 image->channel_map[YellowPixelChannel].traits=traits;
731 static inline void SetPixelY(const Image *restrict image,const Quantum y,
732 Quantum *restrict pixel)
734 pixel[image->channel_map[YPixelChannel].offset]=y;
737 static inline void SetPixelYTraits(Image *image,const PixelTrait traits)
739 image->channel_map[YPixelChannel].traits=traits;
742 #if defined(__cplusplus) || defined(c_plusplus)