2 Copyright 1999-2012 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/image.h>
34 static inline double CompandsRGB(const double intensity)
36 if (intensity <= 0.0031308)
37 return(intensity*12.92);
38 return(1.055*pow(intensity,1.0/2.4)-0.055);
41 static inline double DecompandsRGB(const double intensity)
43 if (intensity <= 0.04045)
44 return(intensity/12.92);
45 return(pow((intensity+0.055)/1.055,2.4));
48 static inline Quantum GetPixelAlpha(const Image *restrict image,
49 const Quantum *restrict pixel)
51 if (image->channel_map[AlphaPixelChannel].traits == UndefinedPixelTrait)
53 return(pixel[image->channel_map[AlphaPixelChannel].offset]);
56 static inline PixelTrait GetPixelAlphaTraits(const Image *restrict image)
58 return(image->channel_map[AlphaPixelChannel].traits);
61 static inline Quantum GetPixelBlack(const Image *restrict image,
62 const Quantum *restrict pixel)
64 if (image->channel_map[BlackPixelChannel].traits == UndefinedPixelTrait)
66 return(pixel[image->channel_map[BlackPixelChannel].offset]);
69 static inline PixelTrait GetPixelBlackTraits(const Image *restrict image)
71 return(image->channel_map[BlackPixelChannel].traits);
74 static inline Quantum GetPixelBlue(const Image *restrict image,
75 const Quantum *restrict pixel)
77 return(pixel[image->channel_map[BluePixelChannel].offset]);
80 static inline PixelTrait GetPixelBlueTraits(const Image *restrict image)
82 return(image->channel_map[BluePixelChannel].traits);
85 static inline Quantum GetPixelCb(const Image *restrict image,
86 const Quantum *restrict pixel)
88 return(pixel[image->channel_map[CbPixelChannel].offset]);
91 static inline PixelTrait GetPixelCbTraits(const Image *restrict image)
93 return(image->channel_map[CbPixelChannel].traits);
96 static inline Quantum GetPixelChannel(const Image *restrict image,
97 const PixelChannel channel,const Quantum *restrict pixel)
99 if (image->channel_map[channel].traits == UndefinedPixelTrait)
101 return(pixel[image->channel_map[channel].offset]);
104 static inline PixelChannel GetPixelChannelMapChannel(
105 const Image *restrict image,const ssize_t offset)
107 return(image->channel_map[offset].channel);
110 static inline ssize_t GetPixelChannelMapOffset(const Image *restrict image,
111 const PixelChannel channel)
113 return(image->channel_map[channel].offset);
116 static inline PixelTrait GetPixelChannelMapTraits(const Image *restrict image,
117 const PixelChannel channel)
119 return(image->channel_map[channel].traits);
122 static inline size_t GetPixelChannels(const Image *restrict image)
124 return(image->number_channels);
127 static inline Quantum GetPixelCr(const Image *restrict image,
128 const Quantum *restrict pixel)
130 return(pixel[image->channel_map[CrPixelChannel].offset]);
133 static inline PixelTrait GetPixelCrTraits(const Image *restrict image)
135 return(image->channel_map[CrPixelChannel].traits);
138 static inline Quantum GetPixelCyan(const Image *restrict image,
139 const Quantum *restrict pixel)
141 return(pixel[image->channel_map[CyanPixelChannel].offset]);
144 static inline PixelTrait GetPixelCyanTraits(const Image *restrict image)
146 return(image->channel_map[CyanPixelChannel].traits);
149 static inline Quantum GetPixelGray(const Image *restrict image,
150 const Quantum *restrict pixel)
152 return(pixel[image->channel_map[GrayPixelChannel].offset]);
155 static inline PixelTrait GetPixelGrayTraits(const Image *restrict image)
157 return(image->channel_map[GrayPixelChannel].traits);
160 static inline Quantum GetPixelGreen(const Image *restrict image,
161 const Quantum *restrict pixel)
163 return(pixel[image->channel_map[GreenPixelChannel].offset]);
166 static inline PixelTrait GetPixelGreenTraits(const Image *restrict image)
168 return(image->channel_map[GreenPixelChannel].traits);
171 static inline Quantum GetPixelIndex(const Image *restrict image,
172 const Quantum *restrict pixel)
174 if (image->channel_map[IndexPixelChannel].traits == UndefinedPixelTrait)
176 return(pixel[image->channel_map[IndexPixelChannel].offset]);
179 static inline PixelTrait GetPixelIndexTraits(const Image *restrict image)
181 return(image->channel_map[IndexPixelChannel].traits);
184 static inline Quantum GetPixelInfoIntensity(
185 const PixelInfo *restrict pixel_info)
192 if (pixel_info->colorspace != sRGBColorspace)
195 green=pixel_info->green;
196 blue=pixel_info->blue;
200 red=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->red);
201 green=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->green);
202 blue=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->blue);
204 #if !defined(MAGICKCORE_HDRI_SUPPORT)
205 return((Quantum) (0.298839*red+0.586811*green+0.114350*blue+0.5));
207 return((Quantum) (0.298839*red+0.586811*green+0.114350*blue));
211 static inline Quantum GetPixelInfoLuminance(
212 const PixelInfo *restrict pixel_info)
222 if (pixel_info->colorspace != sRGBColorspace)
225 green=pixel_info->green;
226 blue=pixel_info->blue;
230 red=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->red);
231 green=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->green);
232 blue=QuantumRange*DecompandsRGB(QuantumScale*pixel_info->blue);
234 #if !defined(MAGICKCORE_HDRI_SUPPORT)
235 luminance=(Quantum) (0.21267*red+0.71516*green+0.07217*blue+0.5);
237 luminance=(Quantum) (0.21267*red+0.71516*green+0.07217*blue);
239 return((Quantum) luminance);
242 static inline Quantum GetPixelIntensity(const Image *restrict image,
243 const Quantum *restrict pixel)
250 if (image->colorspace == GRAYColorspace)
251 return(pixel[image->channel_map[GrayPixelChannel].offset]);
252 if (image->colorspace != sRGBColorspace)
254 red=(double) pixel[image->channel_map[RedPixelChannel].offset];
255 green=(double) pixel[image->channel_map[GreenPixelChannel].offset];
256 blue=(double) pixel[image->channel_map[BluePixelChannel].offset];
260 red=QuantumRange*DecompandsRGB(QuantumScale*
261 pixel[image->channel_map[RedPixelChannel].offset]);
262 green=QuantumRange*DecompandsRGB(QuantumScale*
263 pixel[image->channel_map[GreenPixelChannel].offset]);
264 blue=QuantumRange*DecompandsRGB(QuantumScale*
265 pixel[image->channel_map[BluePixelChannel].offset]);
267 #if !defined(MAGICKCORE_HDRI_SUPPORT)
268 return((Quantum) (0.298839*red+0.586811*green+0.114350*blue+0.5));
275 alpha=red-(double) green;
276 beta=green-(double) blue;
277 if ((fabs((double) alpha) <= MagickEpsilon) &&
278 (fabs(beta) <= MagickEpsilon))
280 return((Quantum) (0.298839*red+0.586811*green+0.114350*blue));
285 static inline Quantum GetPixelLuminance(const Image *restrict image,
286 const Quantum *restrict pixel)
293 if (image->colorspace != sRGBColorspace)
295 red=(double) pixel[image->channel_map[RedPixelChannel].offset];
296 green=(double) pixel[image->channel_map[GreenPixelChannel].offset];
297 blue=(double) pixel[image->channel_map[BluePixelChannel].offset];
301 red=QuantumRange*DecompandsRGB(QuantumScale*
302 pixel[image->channel_map[RedPixelChannel].offset]);
303 green=QuantumRange*DecompandsRGB(QuantumScale*
304 pixel[image->channel_map[GreenPixelChannel].offset]);
305 blue=QuantumRange*DecompandsRGB(QuantumScale*
306 pixel[image->channel_map[BluePixelChannel].offset]);
308 #if !defined(MAGICKCORE_HDRI_SUPPORT)
309 return((Quantum) (0.21267*red+0.71516*green+0.07217*blue+0.5));
311 return((Quantum) (0.21267*red+0.71516*green+0.07217*blue));
315 static inline Quantum GetPixelMagenta(const Image *restrict image,
316 const Quantum *restrict pixel)
318 return(pixel[image->channel_map[MagentaPixelChannel].offset]);
321 static inline PixelTrait GetPixelMagentaTraits(const Image *restrict image)
323 return(image->channel_map[MagentaPixelChannel].traits);
326 static inline Quantum GetPixelMask(const Image *restrict image,
327 const Quantum *restrict pixel)
329 if (image->channel_map[MaskPixelChannel].traits == UndefinedPixelTrait)
331 return(pixel[image->channel_map[MaskPixelChannel].offset]);
334 static inline PixelTrait GetPixelMaskTraits(const Image *restrict image)
336 return(image->channel_map[MaskPixelChannel].traits);
339 static inline size_t GetPixelMetaChannels(const Image *restrict image)
341 return(image->number_meta_channels);
344 static inline size_t GetPixelMetacontentExtent(const Image *restrict image)
346 return(image->metacontent_extent);
349 static inline Quantum GetPixelOpacity(const Image *restrict image,
350 const Quantum *restrict pixel)
352 if (image->channel_map[AlphaPixelChannel].traits == UndefinedPixelTrait)
353 return(QuantumRange-OpaqueAlpha);
354 return(QuantumRange-pixel[image->channel_map[AlphaPixelChannel].offset]);
357 static inline Quantum GetPixelRed(const Image *restrict image,
358 const Quantum *restrict pixel)
360 return(pixel[image->channel_map[RedPixelChannel].offset]);
363 static inline PixelTrait GetPixelRedTraits(const Image *restrict image)
365 return(image->channel_map[RedPixelChannel].traits);
368 static inline void GetPixelInfoPixel(const Image *restrict image,
369 const Quantum *restrict pixel,PixelInfo *restrict pixel_info)
371 pixel_info->red=(double)
372 pixel[image->channel_map[RedPixelChannel].offset];
373 pixel_info->green=(double)
374 pixel[image->channel_map[GreenPixelChannel].offset];
375 pixel_info->blue=(double)
376 pixel[image->channel_map[BluePixelChannel].offset];
378 if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
379 pixel_info->black=(double)
380 pixel[image->channel_map[BlackPixelChannel].offset];
381 pixel_info->alpha=OpaqueAlpha;
382 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
383 pixel_info->alpha=(double)
384 pixel[image->channel_map[AlphaPixelChannel].offset];
386 if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
387 pixel_info->index=(double)
388 pixel[image->channel_map[IndexPixelChannel].offset];
391 static inline PixelTrait GetPixelTraits(const Image *restrict image,
392 const PixelChannel channel)
394 return(image->channel_map[channel].traits);
397 static inline Quantum GetPixelY(const Image *restrict image,
398 const Quantum *restrict pixel)
400 return(pixel[image->channel_map[YPixelChannel].offset]);
403 static inline PixelTrait GetPixelYTraits(const Image *restrict image)
405 return(image->channel_map[YPixelChannel].traits);
408 static inline Quantum GetPixelYellow(const Image *restrict image,
409 const Quantum *restrict pixel)
411 return(pixel[image->channel_map[YellowPixelChannel].offset]);
414 static inline PixelTrait GetPixelYellowTraits(const Image *restrict image)
416 return(image->channel_map[YellowPixelChannel].traits);
419 static inline MagickBooleanType IsPixelEquivalent(const Image *restrict image,
420 const Quantum *restrict p,const PixelInfo *restrict q)
422 if (((double) p[image->channel_map[RedPixelChannel].offset] == q->red) &&
423 ((double) p[image->channel_map[GreenPixelChannel].offset] == q->green) &&
424 ((double) p[image->channel_map[BluePixelChannel].offset] == q->blue))
429 static inline MagickBooleanType IsPixelGray(const Image *restrict image,
430 const Quantum *restrict pixel)
432 #if !defined(MAGICKCORE_HDRI_SUPPORT)
433 if ((pixel[image->channel_map[RedPixelChannel].offset] ==
434 pixel[image->channel_map[GreenPixelChannel].offset]) &&
435 (pixel[image->channel_map[GreenPixelChannel].offset] ==
436 pixel[image->channel_map[BluePixelChannel].offset]))
444 alpha=pixel[image->channel_map[RedPixelChannel].offset]-(double)
445 pixel[image->channel_map[GreenPixelChannel].offset];
446 beta=pixel[image->channel_map[GreenPixelChannel].offset]-(double)
447 pixel[image->channel_map[BluePixelChannel].offset];
448 if ((fabs((double) alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
455 static inline MagickBooleanType IsPixelInfoEquivalent(
456 const PixelInfo *restrict p,const PixelInfo *restrict q)
458 if ((p->matte != MagickFalse) && (q->matte == MagickFalse) &&
459 (fabs(p->alpha-OpaqueAlpha) > 0.5))
461 if ((q->matte != MagickFalse) && (p->matte == MagickFalse) &&
462 (fabs(q->alpha-OpaqueAlpha)) > 0.5)
464 if ((p->matte != MagickFalse) && (q->matte != MagickFalse))
466 if (fabs(p->alpha-q->alpha) > 0.5)
468 if (fabs(p->alpha-TransparentAlpha) <= 0.5)
471 if (fabs(p->red-q->red) > 0.5)
473 if (fabs(p->green-q->green) > 0.5)
475 if (fabs(p->blue-q->blue) > 0.5)
477 if ((p->colorspace == CMYKColorspace) && (fabs(p->black-q->black) > 0.5))
482 static inline MagickBooleanType IsPixelMonochrome(const Image *restrict image,
483 const Quantum *restrict pixel)
485 #if !defined(MAGICKCORE_HDRI_SUPPORT)
486 if (((pixel[image->channel_map[RedPixelChannel].offset] == 0) ||
487 (pixel[image->channel_map[RedPixelChannel].offset] == (Quantum) QuantumRange)) &&
488 (pixel[image->channel_map[RedPixelChannel].offset] ==
489 pixel[image->channel_map[GreenPixelChannel].offset]) &&
490 (pixel[image->channel_map[GreenPixelChannel].offset] ==
491 pixel[image->channel_map[BluePixelChannel].offset]))
499 alpha=pixel[image->channel_map[RedPixelChannel].offset]-(double)
500 pixel[image->channel_map[GreenPixelChannel].offset];
501 beta=pixel[image->channel_map[GreenPixelChannel].offset]-(double)
502 pixel[image->channel_map[BluePixelChannel].offset];
503 if (((fabs(pixel[image->channel_map[RedPixelChannel].offset]) <= MagickEpsilon) ||
504 (fabs(pixel[image->channel_map[RedPixelChannel].offset]-QuantumRange) <= MagickEpsilon)) &&
505 (fabs((double) alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
512 static inline MagickBooleanType IsPixelInfoGray(
513 const PixelInfo *restrict pixel_info)
515 if ((IsGrayColorspace(pixel_info->colorspace) == MagickFalse) &&
516 (IsRGBColorspace(pixel_info->colorspace) == MagickFalse))
518 #if !defined(MAGICKCORE_HDRI_SUPPORT)
519 if ((pixel_info->red == pixel_info->green) &&
520 (pixel_info->green == pixel_info->blue))
528 alpha=pixel_info->red-(double) pixel_info->green;
529 beta=pixel_info->green-(double) pixel_info->blue;
530 if ((fabs((double) alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
537 static inline MagickBooleanType IsPixelInfoMonochrome(
538 const PixelInfo *restrict pixel_info)
540 #if !defined(MAGICKCORE_HDRI_SUPPORT)
541 if (((pixel_info->red == 0) || (pixel_info->red == (Quantum) QuantumRange)) &&
542 (pixel_info->red == pixel_info->green) &&
543 (pixel_info->green == pixel_info->blue))
551 alpha=pixel_info->red-(double) pixel_info->green;
552 beta=pixel_info->green-(double) pixel_info->blue;
553 if (((fabs(pixel_info->red) <= MagickEpsilon) ||
554 (fabs(pixel_info->red-QuantumRange) <= MagickEpsilon)) &&
555 (fabs((double) alpha) <= MagickEpsilon) && (fabs(beta) <= MagickEpsilon))
562 static inline void SetPixelAlpha(const Image *restrict image,
563 const Quantum alpha,Quantum *restrict pixel)
565 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
566 pixel[image->channel_map[AlphaPixelChannel].offset]=alpha;
569 static inline void SetPixelAlphaTraits(Image *image,const PixelTrait traits)
571 image->channel_map[AlphaPixelChannel].traits=traits;
574 static inline void SetPixelBlack(const Image *restrict image,
575 const Quantum black,Quantum *restrict pixel)
577 if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
578 pixel[image->channel_map[BlackPixelChannel].offset]=black;
581 static inline void SetPixelBlackTraits(Image *image,const PixelTrait traits)
583 image->channel_map[BlackPixelChannel].traits=traits;
586 static inline void SetPixelBlue(const Image *restrict image,const Quantum blue,
587 Quantum *restrict pixel)
589 pixel[image->channel_map[BluePixelChannel].offset]=blue;
592 static inline void SetPixelBlueTraits(Image *image,const PixelTrait traits)
594 image->channel_map[BluePixelChannel].traits=traits;
597 static inline void SetPixelCb(const Image *restrict image,const Quantum cb,
598 Quantum *restrict pixel)
600 pixel[image->channel_map[CbPixelChannel].offset]=cb;
603 static inline void SetPixelCbTraits(Image *image,const PixelTrait traits)
605 image->channel_map[CbPixelChannel].traits=traits;
608 static inline void SetPixelChannel(const Image *restrict image,
609 const PixelChannel channel,const Quantum quantum,Quantum *restrict pixel)
611 if (image->channel_map[channel].traits != UndefinedPixelTrait)
612 pixel[image->channel_map[channel].offset]=quantum;
615 static inline void SetPixelChannelMapChannel(const Image *restrict image,
616 const PixelChannel channel,const ssize_t offset)
618 image->channel_map[offset].channel=channel;
619 image->channel_map[channel].offset=offset;
622 static inline void SetPixelChannelMap(const Image *restrict image,
623 const PixelChannel channel,const PixelTrait traits,const ssize_t offset)
625 image->channel_map[offset].channel=channel;
626 image->channel_map[channel].offset=offset;
627 image->channel_map[channel].traits=traits;
630 static inline void SetPixelChannels(Image *image,const size_t number_channels)
632 image->number_channels=number_channels;
635 static inline void SetPixelChannelTraits(Image *image,
636 const PixelChannel channel,const PixelTrait traits)
638 image->channel_map[channel].traits=traits;
641 static inline void SetPixelChannelMapTraits(Image *image,
642 const PixelChannel channel,const PixelTrait traits)
644 image->channel_map[channel].traits=traits;
647 static inline void SetPixelCr(const Image *restrict image,const Quantum cr,
648 Quantum *restrict pixel)
650 pixel[image->channel_map[CrPixelChannel].offset]=cr;
653 static inline void SetPixelCrTraits(Image *image,const PixelTrait traits)
655 image->channel_map[CrPixelChannel].traits=traits;
658 static inline void SetPixelCyan(const Image *restrict image,const Quantum cyan,
659 Quantum *restrict pixel)
661 pixel[image->channel_map[CyanPixelChannel].offset]=cyan;
664 static inline void SetPixelGray(const Image *restrict image,const Quantum gray,
665 Quantum *restrict pixel)
667 pixel[image->channel_map[GrayPixelChannel].offset]=gray;
670 static inline void SetPixelGrayTraits(Image *image,const PixelTrait traits)
672 image->channel_map[GrayPixelChannel].traits=traits;
675 static inline void SetPixelGreen(const Image *restrict image,
676 const Quantum green,Quantum *restrict pixel)
678 pixel[image->channel_map[GreenPixelChannel].offset]=green;
681 static inline void SetPixelGreenTraits(Image *image,const PixelTrait traits)
683 image->channel_map[GreenPixelChannel].traits=traits;
686 static inline void SetPixelIndex(const Image *restrict image,
687 const Quantum index,Quantum *restrict pixel)
689 if (image->channel_map[IndexPixelChannel].traits != UndefinedPixelTrait)
690 pixel[image->channel_map[IndexPixelChannel].offset]=index;
693 static inline void SetPixelIndexTraits(Image *image,const PixelTrait traits)
695 image->channel_map[IndexPixelChannel].traits=traits;
698 static inline void SetPixelInfoPixel(const Image *restrict image,
699 const PixelInfo *restrict pixel_info,Quantum *restrict pixel)
701 pixel[image->channel_map[RedPixelChannel].offset]=
702 ClampToQuantum(pixel_info->red);
703 pixel[image->channel_map[GreenPixelChannel].offset]=
704 ClampToQuantum(pixel_info->green);
705 pixel[image->channel_map[BluePixelChannel].offset]=
706 ClampToQuantum(pixel_info->blue);
707 if (image->channel_map[BlackPixelChannel].traits != UndefinedPixelTrait)
708 pixel[image->channel_map[BlackPixelChannel].offset]=
709 ClampToQuantum(pixel_info->black);
710 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
711 pixel[image->channel_map[AlphaPixelChannel].offset]=pixel_info->matte ==
712 MagickFalse ? OpaqueAlpha : ClampToQuantum(pixel_info->alpha);
715 static inline void SetPixelMagenta(const Image *restrict image,
716 const Quantum magenta,Quantum *restrict pixel)
718 pixel[image->channel_map[MagentaPixelChannel].offset]=magenta;
721 static inline void SetPixelMagentaTraits(Image *image,const PixelTrait traits)
723 image->channel_map[MagentaPixelChannel].traits=traits;
726 static inline void SetPixelMask(const Image *restrict image,
727 const Quantum mask,Quantum *restrict pixel)
729 if (image->channel_map[MaskPixelChannel].traits != UndefinedPixelTrait)
730 pixel[image->channel_map[MaskPixelChannel].offset]=mask;
733 static inline void SetPixelMetacontentExtent(Image *image,const size_t extent)
735 image->metacontent_extent=extent;
738 static inline void SetPixelOpacity(const Image *restrict image,
739 const Quantum alpha,Quantum *restrict pixel)
741 if (image->channel_map[AlphaPixelChannel].traits != UndefinedPixelTrait)
742 pixel[image->channel_map[AlphaPixelChannel].offset]=QuantumRange-alpha;
745 static inline void SetPixelRed(const Image *restrict image,const Quantum red,
746 Quantum *restrict pixel)
748 pixel[image->channel_map[RedPixelChannel].offset]=red;
751 static inline void SetPixelRedTraits(Image *image,const PixelTrait traits)
753 image->channel_map[RedPixelChannel].traits=traits;
756 static inline void SetPixelYellow(const Image *restrict image,
757 const Quantum yellow,Quantum *restrict pixel)
759 pixel[image->channel_map[YellowPixelChannel].offset]=yellow;
762 static inline void SetPixelYellowTraits(Image *image,const PixelTrait traits)
764 image->channel_map[YellowPixelChannel].traits=traits;
767 static inline void SetPixelY(const Image *restrict image,const Quantum y,
768 Quantum *restrict pixel)
770 pixel[image->channel_map[YPixelChannel].offset]=y;
773 static inline void SetPixelYTraits(Image *image,const PixelTrait traits)
775 image->channel_map[YPixelChannel].traits=traits;
778 #if defined(__cplusplus) || defined(c_plusplus)