18 #ifndef MAGICKCORE_PIXEL_ACCESSOR_H
19 #define MAGICKCORE_PIXEL_ACCESSOR_H
30 #if defined(__cplusplus) || defined(c_plusplus)
42 #if !defined(MAGICKCORE_HDRI_SUPPORT)
116 return(pixel[image->channel_map[channel].offset]);
122 return(image->channel_map[offset].channel);
128 return(image->channel_map[channel].offset);
134 return(image->channel_map[channel].traits);
139 return(image->number_channels);
232 sign=x < 0.0 ? -1.0 : 1.0;
246 intensity=(
MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+
247 0.072186f*pixel->blue);
264 intensity=(
MagickRealType) (0.212656f*pixel->red+0.715158f*pixel->green+
265 0.072186f*pixel->blue);
358 return(image->number_meta_channels);
364 return(image->metacontent_extent);
395 if (image != (
Image *) NULL)
397 pixel_info->storage_class=image->storage_class;
398 pixel_info->colorspace=image->colorspace;
399 pixel_info->fuzz=image->fuzz;
400 pixel_info->depth=image->depth;
401 pixel_info->alpha_trait=image->alpha_trait;
429 return(image->channel_map[channel].traits);
457 return(x < 0.0f ? -x : x);
468 #if !defined(MAGICKCORE_HDRI_SUPPORT)
605 red_green=pixel_info->red-pixel_info->green;
606 green_blue=pixel_info->green-pixel_info->blue;
701 pixel[image->channel_map[channel].offset]=quantum;
710 image->channel_map[offset].channel=channel;
711 image->channel_map[channel].offset=offset;
712 image->channel_map[channel].traits=traits;
718 image->channel_map[offset].channel=channel;
719 image->channel_map[channel].offset=offset;
886 #if defined(__cplusplus) || defined(c_plusplus)
static void SetPixelChannelChannel(const Image *magick_restrict image, const PixelChannel channel, const ssize_t offset)
Definition: pixel-accessor.h:715
#define magick_restrict
Definition: MagickCore.h:41
MagickExport MagickRealType EncodePixelGamma(const MagickRealType pixel)
Definition: pixel.c:446
static size_t GetPixelMetacontentExtent(const Image *magick_restrict image)
Definition: pixel-accessor.h:361
MagickDoubleType MagickRealType
Definition: magick-type.h:120
static void SetPixelChannelAttributes(const Image *magick_restrict image, const PixelChannel channel, const PixelTrait traits, const ssize_t offset)
Definition: pixel-accessor.h:704
static Quantum GetPixelCyan(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:161
#define TransparentAlpha
Definition: image.h:26
static ssize_t GetPixelChannelOffset(const Image *magick_restrict image, const PixelChannel channel)
Definition: pixel-accessor.h:125
static PixelTrait GetPixelYTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:438
static void SetPixelBlackTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:669
static void SetPixelY(const Image *magick_restrict image, const Quantum y, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:875
static void SetPixelYTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:881
static PixelTrait GetPixelBlackTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:83
static void SetPixelBackgoundColor(const Image *magick_restrict image, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:639
static Quantum GetPixelAlpha(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:55
static PixelTrait GetPixelRedTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:381
static Quantum GetPixelCr(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:150
static void SetPixelMetacontentExtent(Image *image, const size_t extent)
Definition: pixel-accessor.h:841
Definition: colorspace.h:50
static void SetPixelOpacity(const Image *magick_restrict image, const Quantum alpha, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:846
static PixelTrait GetPixelIndexTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:203
static PixelTrait GetPixelAlphaTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:63
static Quantum GetPixelRed(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:375
static void SetPixelGrayTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:763
static Quantum GetPixelGray(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:172
static void SetPixelYellowTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:870
static void SetPixelGray(const Image *magick_restrict image, const Quantum gray, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:757
#define OpaqueAlpha
Definition: image.h:25
static Quantum GetPixelChannel(const Image *magick_restrict image, const PixelChannel channel, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:111
static PixelTrait GetPixelChannelTraits(const Image *magick_restrict image, const PixelChannel channel)
Definition: pixel-accessor.h:131
Definition: magick-type.h:154
static MagickRealType AbsolutePixelValue(const MagickRealType x)
Definition: pixel-accessor.h:455
static void SetPixelViaPixelInfo(const Image *magick_restrict image, const PixelInfo *magick_restrict pixel_info, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:791
static Quantum GetPixelReadMask(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:334
static MagickBooleanType IsPixelMonochrome(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:563
static Quantum GetPixela(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:49
static void SetPixela(const Image *magick_restrict image, const Quantum a, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:613
static PixelTrait GetPixelCbTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:106
#define MAGICKCORE_QUANTUM_DEPTH
Definition: magick-type.h:28
static Quantum GetPixelb(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:69
static MagickRealType GetPixelLuma(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:286
#define MagickEpsilon
Definition: magick-type.h:110
static MagickBooleanType IsPixelInfoEquivalent(const PixelInfo *magick_restrict p, const PixelInfo *magick_restrict q)
Definition: pixel-accessor.h:533
MagickExport MagickRealType DecodePixelGamma(const MagickRealType pixel)
Definition: pixel.c:319
static void SetPixelChannelTraits(Image *image, const PixelChannel channel, const PixelTrait traits)
Definition: pixel-accessor.h:727
static MagickBooleanType IsPixelEquivalent(const Image *magick_restrict image, const Quantum *magick_restrict p, const PixelInfo *magick_restrict q)
Definition: pixel-accessor.h:478
static Quantum ClampPixel(const MagickRealType pixel)
Definition: pixel-accessor.h:36
static void SetPixelRedTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:859
static MagickBooleanType IsPixelInfoMonochrome(const PixelInfo *magick_restrict pixel_info)
Definition: pixel-accessor.h:595
static Quantum GetPixelY(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:432
static void SetPixelAlphaTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:627
MagickBooleanType
Definition: magick-type.h:158
static double PerceptibleReciprocal(const double x)
Definition: pixel-accessor.h:224
MagickExport void * ResetMagickMemory(void *memory, int byte, const size_t size)
Definition: memory.c:1195
static Quantum GetPixelWriteMask(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:342
static void SetPixelChannels(Image *image, const size_t number_channels)
Definition: pixel-accessor.h:722
static void SetPixelL(const Image *magick_restrict image, const Quantum L, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:809
static PixelTrait GetPixelReadMaskTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:350
static Quantum GetPixelOpacity(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:367
static Quantum GetPixelMagenta(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:322
static void SetPixelMagentaTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:822
static MagickBooleanType IsPixelAtDepth(const Quantum pixel, const QuantumAny range)
Definition: pixel-accessor.h:460
static PixelTrait GetPixelCrTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:156
Definition: magick-type.h:161
static Quantum GetPixelGreen(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:183
static void GetPixelInfoPixel(const Image *magick_restrict image, const Quantum *magick_restrict pixel, PixelInfo *magick_restrict pixel_info)
Definition: pixel-accessor.h:386
static PixelTrait GetPixelCyanTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:167
static Quantum GetPixelIndex(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:195
static Quantum GetPixelBlack(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:75
static void SetPixelCr(const Image *magick_restrict image, const Quantum cr, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:740
static void SetPixelIndexTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:786
static MagickBooleanType IsPixelGray(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:515
static void SetPixelMagenta(const Image *magick_restrict image, const Quantum magenta, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:816
static PixelTrait GetPixelGreenTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:189
static PixelTrait GetPixelGrayTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:178
static void SetPixelBlue(const Image *magick_restrict image, const Quantum blue, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:674
Definition: colorspace.h:29
static void SetPixelWriteMask(const Image *magick_restrict image, const Quantum mask, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:834
PixelChannel
Definition: pixel.h:67
static void SetPixelCbTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:691
static size_t GetPixelChannels(const Image *magick_restrict image)
Definition: pixel-accessor.h:137
static void SetPixelCompositeMask(const Image *magick_restrict image, const Quantum mask, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:733
static void SetPixelCyan(const Image *magick_restrict image, const Quantum cyan, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:751
static Quantum ClampToQuantum(const MagickRealType value)
Definition: quantum.h:84
static PixelChannel GetPixelChannelChannel(const Image *magick_restrict image, const ssize_t offset)
Definition: pixel-accessor.h:119
static MagickRealType GetPixelInfoChannel(const PixelInfo *magick_restrict pixel_info, const PixelChannel channel)
Definition: pixel-accessor.h:209
Definition: magick-type.h:160
static void SetPixelCrTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:746
static PixelTrait GetPixelMagentaTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:328
unsigned short Quantum
Definition: magick-type.h:82
static size_t GetPixelMetaChannels(const Image *magick_restrict image)
Definition: pixel-accessor.h:356
static MagickBooleanType IsPixelInfoGray(const PixelInfo *magick_restrict pixel)
Definition: pixel-accessor.h:586
static Quantum GetPixelCb(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:100
static void SetPixelIndex(const Image *magick_restrict image, const Quantum index, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:779
size_t number_channels
Definition: image.h:283
static void SetPixelChannel(const Image *magick_restrict image, const PixelChannel channel, const Quantum quantum, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:696
static void SetPixelYellow(const Image *magick_restrict image, const Quantum yellow, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:864
static PixelTrait GetPixelTraits(const Image *magick_restrict image, const PixelChannel channel)
Definition: pixel-accessor.h:426
static Quantum GetPixelCompositeMask(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:142
static void SetPixelAlpha(const Image *magick_restrict image, const Quantum alpha, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:620
static MagickRealType GetPixelInfoLuminance(const PixelInfo *magick_restrict pixel)
Definition: pixel-accessor.h:256
size_t metacontent_extent
Definition: image.h:283
#define MaxPixelChannels
Definition: pixel.h:27
static void SetPixelGreenTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:774
static MagickRealType GetPixelLuminance(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:299
static PixelTrait GetPixelYellowTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:449
static ssize_t GetPixelLabel(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:280
static void SetPixelRed(const Image *magick_restrict image, const Quantum red, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:853
static MagickRealType GetPixelInfoLuma(const PixelInfo *magick_restrict pixel)
Definition: pixel-accessor.h:238
PixelTrait traits
Definition: pixel.h:164
static void SetPixelb(const Image *magick_restrict image, const Quantum b, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:632
static Quantum GetPixelYellow(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:443
static void SetPixelBlack(const Image *magick_restrict image, const Quantum black, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:662
static Quantum GetPixelBlue(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:89
PixelTrait
Definition: pixel.h:135
MagickSizeType QuantumAny
Definition: magick-type.h:144
static void SetPixelReadMask(const Image *magick_restrict image, const Quantum mask, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:827
static Quantum GetPixelL(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:274
static void SetPixelBlueTraits(Image *image, const PixelTrait traits)
Definition: pixel-accessor.h:680
static void SetPixelCb(const Image *magick_restrict image, const Quantum cb, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:685
#define QuantumRange
Definition: magick-type.h:83
PixelChannelMap * channel_map
Definition: image.h:291
static void SetPixelGreen(const Image *magick_restrict image, const Quantum green, Quantum *magick_restrict pixel)
Definition: pixel-accessor.h:768
static PixelTrait GetPixelBlueTraits(const Image *magick_restrict image)
Definition: pixel-accessor.h:95