MagickCore 6.9.12
pixel-accessor.h File Reference
#include <math.h>
#include "magick/gem.h"
#include "magick/pixel.h"
Include dependency graph for pixel-accessor.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ClampPixelRed(pixel)   ClampToQuantum((pixel)->red)
 
#define ClampPixelGreen(pixel)   ClampToQuantum((pixel)->green)
 
#define ClampPixelBlue(pixel)   ClampToQuantum((pixel)->blue)
 
#define ClampPixelIndex(indexes)   ClampToQuantum(*(indexes))
 
#define ClampPixelOpacity(pixel)   ClampToQuantum((pixel)->opacity)
 
#define GetPixela(pixel)   ((pixel)->green)
 
#define GetPixelb(pixel)   ((pixel)->blue)
 
#define GetPixelAlpha(pixel)   (QuantumRange-(pixel)->opacity)
 
#define GetPixelBlack(indexes)   (*(indexes))
 
#define GetPixelBlue(pixel)   ((pixel)->blue)
 
#define GetPixelCb(pixel)   ((pixel)->green)
 
#define GetPixelCr(pixel)   ((pixel)->blue)
 
#define GetPixelCyan(pixel)   ((pixel)->red)
 
#define GetPixelGray(pixel)   ((pixel)->red)
 
#define GetPixelGreen(pixel)   ((pixel)->green)
 
#define GetPixelIndex(indexes)   (*(indexes))
 
#define GetPixelL(pixel)   ((pixel)->red)
 
#define GetPixelLabel(pixel)   ((ssize_t) (pixel)->red)
 
#define GetPixelMagenta(pixel)   ((pixel)->green)
 
#define GetPixelNext(pixel)   ((pixel)+1)
 
#define GetPixelOpacity(pixel)   ((pixel)->opacity)
 
#define GetPixelRed(pixel)   ((pixel)->red)
 
#define GetPixelRGB(pixel, packet)
 
#define GetPixelRGBO(pixel, packet)
 
#define GetPixelY(pixel)   ((pixel)->red)
 
#define GetPixelYellow(pixel)   ((pixel)->blue)
 
#define SetPixela(pixel, value)   ((pixel)->green=(Quantum) (value))
 
#define SetPixelAlpha(pixel, value)    ((pixel)->opacity=(Quantum) (QuantumRange-(value)))
 
#define SetPixelb(pixel, value)   ((pixel)->blue=(Quantum) (value))
 
#define SetPixelBlack(indexes, value)   (*(indexes)=(Quantum) (value))
 
#define SetPixelBlue(pixel, value)   ((pixel)->blue=(Quantum) (value))
 
#define SetPixelCb(pixel, value)   ((pixel)->green=(Quantum) (value))
 
#define SetPixelCr(pixel, value)   ((pixel)->blue=(Quantum) (value))
 
#define SetPixelCyan(pixel, value)   ((pixel)->red=(Quantum) (value))
 
#define SetPixelGray(pixel, value)    ((pixel)->red=(pixel)->green=(pixel)->blue=(Quantum) (value))
 
#define SetPixelGreen(pixel, value)   ((pixel)->green=(Quantum) (value))
 
#define SetPixelIndex(indexes, value)   (*(indexes)=(IndexPacket) (value))
 
#define SetPixelL(pixel, value)   ((pixel)->red=(Quantum) (value))
 
#define SetPixelMagenta(pixel, value)   ((pixel)->green=(Quantum) (value))
 
#define SetPixelOpacity(pixel, value)   ((pixel)->opacity=(Quantum) (value))
 
#define SetPixelRed(pixel, value)   ((pixel)->red=(Quantum) (value))
 
#define SetPixelRgb(pixel, packet)
 
#define SetPixelRGBA(pixel, packet)
 
#define SetPixelRGBO(pixel, packet)
 
#define SetPixelYellow(pixel, value)   ((pixel)->blue=(Quantum) (value))
 
#define SetPixelY(pixel, value)   ((pixel)->red=(Quantum) (value))
 

Functions

static MagickRealType AbsolutePixelValue (const MagickRealType x)
 
static Quantum ClampPixel (const MagickRealType value)
 
static double PerceptibleReciprocal (const double x)
 
static MagickRealType GetPixelLuma (const Image *magick_restrict image, const PixelPacket *magick_restrict pixel)
 
static MagickRealType GetPixelLuminance (const Image *magick_restrict image, const PixelPacket *magick_restrict pixel)
 
static MagickBooleanType IsPixelAtDepth (const Quantum pixel, const QuantumAny range)
 
static MagickBooleanType IsPixelGray (const PixelPacket *pixel)
 
static MagickBooleanType IsPixelMonochrome (const PixelPacket *pixel)
 
static Quantum PixelPacketIntensity (const PixelPacket *pixel)
 
static void SetPixelViaMagickPixel (const Image *magick_restrict image, const MagickPixelPacket *magick_restrict magick_pixel, PixelPacket *magick_restrict pixel)
 

Macro Definition Documentation

◆ ClampPixelBlue

#define ClampPixelBlue (   pixel)    ClampToQuantum((pixel)->blue)

Definition at line 31 of file pixel-accessor.h.

◆ ClampPixelGreen

#define ClampPixelGreen (   pixel)    ClampToQuantum((pixel)->green)

Definition at line 30 of file pixel-accessor.h.

◆ ClampPixelIndex

#define ClampPixelIndex (   indexes)    ClampToQuantum(*(indexes))

Definition at line 32 of file pixel-accessor.h.

◆ ClampPixelOpacity

#define ClampPixelOpacity (   pixel)    ClampToQuantum((pixel)->opacity)

Definition at line 33 of file pixel-accessor.h.

◆ ClampPixelRed

#define ClampPixelRed (   pixel)    ClampToQuantum((pixel)->red)

Definition at line 29 of file pixel-accessor.h.

◆ GetPixela

#define GetPixela (   pixel)    ((pixel)->green)

Definition at line 34 of file pixel-accessor.h.

◆ GetPixelAlpha

#define GetPixelAlpha (   pixel)    (QuantumRange-(pixel)->opacity)

Definition at line 36 of file pixel-accessor.h.

◆ GetPixelb

#define GetPixelb (   pixel)    ((pixel)->blue)

Definition at line 35 of file pixel-accessor.h.

◆ GetPixelBlack

#define GetPixelBlack (   indexes)    (*(indexes))

Definition at line 37 of file pixel-accessor.h.

◆ GetPixelBlue

#define GetPixelBlue (   pixel)    ((pixel)->blue)

Definition at line 38 of file pixel-accessor.h.

◆ GetPixelCb

#define GetPixelCb (   pixel)    ((pixel)->green)

Definition at line 39 of file pixel-accessor.h.

◆ GetPixelCr

#define GetPixelCr (   pixel)    ((pixel)->blue)

Definition at line 40 of file pixel-accessor.h.

◆ GetPixelCyan

#define GetPixelCyan (   pixel)    ((pixel)->red)

Definition at line 41 of file pixel-accessor.h.

◆ GetPixelGray

#define GetPixelGray (   pixel)    ((pixel)->red)

Definition at line 42 of file pixel-accessor.h.

◆ GetPixelGreen

#define GetPixelGreen (   pixel)    ((pixel)->green)

Definition at line 43 of file pixel-accessor.h.

◆ GetPixelIndex

#define GetPixelIndex (   indexes)    (*(indexes))

Definition at line 44 of file pixel-accessor.h.

◆ GetPixelL

#define GetPixelL (   pixel)    ((pixel)->red)

Definition at line 45 of file pixel-accessor.h.

◆ GetPixelLabel

#define GetPixelLabel (   pixel)    ((ssize_t) (pixel)->red)

Definition at line 46 of file pixel-accessor.h.

◆ GetPixelMagenta

#define GetPixelMagenta (   pixel)    ((pixel)->green)

Definition at line 47 of file pixel-accessor.h.

◆ GetPixelNext

#define GetPixelNext (   pixel)    ((pixel)+1)

Definition at line 48 of file pixel-accessor.h.

◆ GetPixelOpacity

#define GetPixelOpacity (   pixel)    ((pixel)->opacity)

Definition at line 49 of file pixel-accessor.h.

◆ GetPixelRed

#define GetPixelRed (   pixel)    ((pixel)->red)

Definition at line 50 of file pixel-accessor.h.

◆ GetPixelRGB

#define GetPixelRGB (   pixel,
  packet 
)
Value:
{ \
(packet)->red=GetPixelRed((pixel)); \
(packet)->green=GetPixelGreen((pixel)); \
(packet)->blue=GetPixelBlue((pixel)); \
}
#define GetPixelBlue(pixel)
#define GetPixelRed(pixel)
#define GetPixelGreen(pixel)

Definition at line 51 of file pixel-accessor.h.

◆ GetPixelRGBO

#define GetPixelRGBO (   pixel,
  packet 
)
Value:
{ \
(packet)->red=GetPixelRed((pixel)); \
(packet)->green=GetPixelGreen((pixel)); \
(packet)->blue=GetPixelBlue((pixel)); \
(packet)->opacity=GetPixelOpacity((pixel)); \
}
#define GetPixelOpacity(pixel)

Definition at line 57 of file pixel-accessor.h.

◆ GetPixelY

#define GetPixelY (   pixel)    ((pixel)->red)

Definition at line 64 of file pixel-accessor.h.

◆ GetPixelYellow

#define GetPixelYellow (   pixel)    ((pixel)->blue)

Definition at line 65 of file pixel-accessor.h.

◆ SetPixela

#define SetPixela (   pixel,
  value 
)    ((pixel)->green=(Quantum) (value))

Definition at line 66 of file pixel-accessor.h.

◆ SetPixelAlpha

#define SetPixelAlpha (   pixel,
  value 
)     ((pixel)->opacity=(Quantum) (QuantumRange-(value)))

Definition at line 67 of file pixel-accessor.h.

◆ SetPixelb

#define SetPixelb (   pixel,
  value 
)    ((pixel)->blue=(Quantum) (value))

Definition at line 69 of file pixel-accessor.h.

◆ SetPixelBlack

#define SetPixelBlack (   indexes,
  value 
)    (*(indexes)=(Quantum) (value))

Definition at line 70 of file pixel-accessor.h.

◆ SetPixelBlue

#define SetPixelBlue (   pixel,
  value 
)    ((pixel)->blue=(Quantum) (value))

Definition at line 71 of file pixel-accessor.h.

◆ SetPixelCb

#define SetPixelCb (   pixel,
  value 
)    ((pixel)->green=(Quantum) (value))

Definition at line 72 of file pixel-accessor.h.

◆ SetPixelCr

#define SetPixelCr (   pixel,
  value 
)    ((pixel)->blue=(Quantum) (value))

Definition at line 73 of file pixel-accessor.h.

◆ SetPixelCyan

#define SetPixelCyan (   pixel,
  value 
)    ((pixel)->red=(Quantum) (value))

Definition at line 74 of file pixel-accessor.h.

◆ SetPixelGray

#define SetPixelGray (   pixel,
  value 
)     ((pixel)->red=(pixel)->green=(pixel)->blue=(Quantum) (value))

Definition at line 75 of file pixel-accessor.h.

◆ SetPixelGreen

#define SetPixelGreen (   pixel,
  value 
)    ((pixel)->green=(Quantum) (value))

Definition at line 77 of file pixel-accessor.h.

◆ SetPixelIndex

#define SetPixelIndex (   indexes,
  value 
)    (*(indexes)=(IndexPacket) (value))

Definition at line 78 of file pixel-accessor.h.

◆ SetPixelL

#define SetPixelL (   pixel,
  value 
)    ((pixel)->red=(Quantum) (value))

Definition at line 79 of file pixel-accessor.h.

◆ SetPixelMagenta

#define SetPixelMagenta (   pixel,
  value 
)    ((pixel)->green=(Quantum) (value))

Definition at line 80 of file pixel-accessor.h.

◆ SetPixelOpacity

#define SetPixelOpacity (   pixel,
  value 
)    ((pixel)->opacity=(Quantum) (value))

Definition at line 81 of file pixel-accessor.h.

◆ SetPixelRed

#define SetPixelRed (   pixel,
  value 
)    ((pixel)->red=(Quantum) (value))

Definition at line 82 of file pixel-accessor.h.

◆ SetPixelRgb

#define SetPixelRgb (   pixel,
  packet 
)
Value:
{ \
SetPixelRed(pixel,(packet)->red); \
SetPixelGreen(pixel,(packet)->green); \
SetPixelBlue(pixel,(packet)->blue); \
}

Definition at line 83 of file pixel-accessor.h.

◆ SetPixelRGBA

#define SetPixelRGBA (   pixel,
  packet 
)
Value:
{ \
SetPixelRed(pixel,(packet)->red); \
SetPixelGreen(pixel,(packet)->green); \
SetPixelBlue(pixel,(packet)->blue); \
SetPixelAlpha(pixel,(QuantumRange-(packet)->opacity)); \
}
#define QuantumRange
Definition: magick-type.h:86

Definition at line 89 of file pixel-accessor.h.

◆ SetPixelRGBO

#define SetPixelRGBO (   pixel,
  packet 
)
Value:
{ \
SetPixelRed(pixel,(packet)->red); \
SetPixelGreen(pixel,(packet)->green); \
SetPixelBlue(pixel,(packet)->blue); \
SetPixelOpacity(pixel,(packet)->opacity); \
}

Definition at line 96 of file pixel-accessor.h.

◆ SetPixelY

#define SetPixelY (   pixel,
  value 
)    ((pixel)->red=(Quantum) (value))

Definition at line 104 of file pixel-accessor.h.

◆ SetPixelYellow

#define SetPixelYellow (   pixel,
  value 
)    ((pixel)->blue=(Quantum) (value))

Definition at line 103 of file pixel-accessor.h.

Function Documentation

◆ AbsolutePixelValue()

static MagickRealType AbsolutePixelValue ( const MagickRealType  x)
inlinestatic

◆ ClampPixel()

◆ GetPixelLuma()

static MagickRealType GetPixelLuma ( const Image *magick_restrict  image,
const PixelPacket *magick_restrict  pixel 
)
inlinestatic

◆ GetPixelLuminance()

static MagickRealType GetPixelLuminance ( const Image *magick_restrict  image,
const PixelPacket *magick_restrict  pixel 
)
inlinestatic

Definition at line 150 of file pixel-accessor.h.

References DecodePixelGamma(), and sRGBColorspace.

◆ IsPixelAtDepth()

static MagickBooleanType IsPixelAtDepth ( const Quantum  pixel,
const QuantumAny  range 
)
inlinestatic

Definition at line 168 of file pixel-accessor.h.

References MagickFalse, MagickTrue, and QuantumRange.

Referenced by GetImageChannelDepth(), and GetImageChannelStatistics().

◆ IsPixelGray()

◆ IsPixelMonochrome()

◆ PerceptibleReciprocal()

static double PerceptibleReciprocal ( const double  x)
inlinestatic

Definition at line 124 of file pixel-accessor.h.

References MagickEpsilon.

Referenced by AcquireResizeFilter(), AdaptiveBlurImageChannel(), AdaptiveSharpenImageChannel(), ApplyEvaluateOperator(), ApplyFunction(), ApplyPixelCompositeMask(), AutoThresholdImage(), ColorBurn(), ColorDodge(), ComplexImages(), CompositeDarken(), CompositeDifference(), CompositeIn(), CompositeLighten(), CompositeLinearDodge(), CompositeMinus(), CompositeModulusAdd(), CompositeModulusSubtract(), CompositeOut(), CompositeXor(), ConvertLuvToXYZ(), ConvertRGBToCMYK(), ConvertRGBToHSL(), ConvertRGBToHSV(), ConvertRGBToxyY(), ConvertxyYToRGB(), ConvertXYZToLuv(), DefineImageColormap(), DistortImage(), Divide(), DrawDashPolygon(), DrawGradientImage(), EmbossImage(), FilterImageChannel(), FxEvaluateSubexpression(), FxGetSymbol(), GammaImageChannel(), GaussJordanElimination(), GenerateDifferentialNoise(), GetCubeInfo(), GetImageChannelFeatures(), GetImageChannelMoments(), GetImageChannelStatistics(), GetImageQuantizeError(), GetMagickProperty(), GetMeanErrorPerPixel(), GetNormalizedCrossCorrelationDistortion(), GetOpacityPixel(), GetOptimalKernelWidth1D(), GetOptimalKernelWidth2D(), GetResizeFilterWeight(), GetStopColorOffset(), HorizontalFilter(), ImplodeImage(), ImportQuantumPixels(), InterpolateMagickPixelPacket(), InterpolatePixelColor(), InverseAffineMatrix(), InvertAffineCoefficients(), InvertPerspectiveCoefficients(), IsImagesEqual(), LevelPixel(), MagickCompositeOver(), MagickPixelCompositeOver(), MagickPixelCompositePlus(), MeanShiftImage(), MorphologyPrimitive(), MotionBlurImageChannel(), OptimalTau(), OptimizeLayerFrames(), ParseGeometry(), ParseMetaGeometry(), PegtopLight(), RemoveDuplicateLayers(), RGBTransformImage(), RotationalBlurImageChannel(), ScaleAnyToQuantum(), ScaleImage(), ScaleResampleFilter(), SelectiveBlurImageChannel(), SetImageAlphaChannel(), SharpenImageChannel(), SoftLight(), TraceArcPath(), TraceEllipse(), TraceStrokePolygon(), TransformRGBImage(), VerticalFilter(), VividLight(), and WaveImage().

◆ PixelPacketIntensity()

static Quantum PixelPacketIntensity ( const PixelPacket pixel)
inlinestatic

◆ SetPixelViaMagickPixel()

static void SetPixelViaMagickPixel ( const Image *magick_restrict  image,
const MagickPixelPacket *magick_restrict  magick_pixel,
PixelPacket *magick_restrict  pixel 
)
inlinestatic

Definition at line 232 of file pixel-accessor.h.

References ClampToQuantum(), and MagickFalse.