MRaster lib 22.0.0.0
Image Processing Library
Loading...
Searching...
No Matches
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx > Class Template Reference

Template Class used to house colors for ramCanvas objects. More...

#include <MRcolorTpl.hpp>

Classes

class  cs2dFltPalArg
 Compute a color for a point in \(\mathbb{R}^2\) using a continuous color scheme for the phase angle. More...
 
class  cs2dIdxPalArg
 Compute a color for a point in \(\mathbb{R}^2\) using a discrete color scheme for the phase angle. More...
 
class  cs2dRichardson
 Compute a color from Richardson's 2D complex number coloring scheme. More...
 
class  cs2dThaller_tpl
 Template for Thaller 2D color schemes. More...
 
class  csBin_tpl
 Binary color scheme. More...
 
class  csCB_tpl
 Template for Color Brewer 2 variable sized pallets. More...
 
class  csCC_tpl
 Template providing RGB color cube gradiant color schemes. More...
 
class  csCubeHelix_tpl
 Compute a color from Dave Green's cubehelix scheme. More...
 
class  csFP_tpl
 Template for fixed size pallets. More...
 
class  csHSLh_tpl
 Template for HSL color schemes. More...
 
class  csPLY_tpl
 Compute a color from a polynomial space curve in the RGB color space. More...
 
class  csVarToFixed_tpl
 Wrapper for Color Brewer 2 variable sized pallet template to produce a simple fixed color scheme with a numC member. More...
 
class  csWS_tpl
 Template for web safe 216 pallets. More...
 

Public Enums Constants

enum class  cornerColorEnum {
  BLACK , RED , GREEN , BLUE ,
  YELLOW , CYAN , MAGENTA , WHITE
}
 Colors at the corners of the RGB color cube. More...
 
enum class  colorSpaceEnum {
  RGB , HSL , HSV , LAB ,
  XYZ , LCH , NONE
}
 Color spaces. More...
 
enum class  cmfInterpolationEnum {
  FLOOR , CEILING , NEAREST , LINEAR ,
  BUMP
}
 Interpolation methods for emperical color matching functions. More...
 

Public type related types – meta-types? ;)

typedef colorTpl colorType
 This object type.
 
typedef colorTypecolorPtrType
 Pointer to colorTpl.
 
typedef colorTypecolorRefType
 Reference to colorTpl)
 
typedef colorType const & colorCRefType
 Reference to const colorTpl.
 
typedef clrChanT channelType
 Type for the channels (clrChanT)
 

Public types for std::tuple & std::vector containing clrChanT values

typedef std::tuple< clrChanT, clrChanT, clrChanT, clrChanT > clrChanTup6
 
typedef std::tuple< clrChanT, clrChanT, clrChanT, clrChanT > clrChanTup5
 
typedef std::tuple< clrChanT, clrChanT, clrChanT, clrChanT > clrChanTup4
 
typedef std::tuple< clrChanT, clrChanT, clrChanT > clrChanTup3
 
typedef std::tuple< clrChanT, clrChanT > clrChanTup2
 
typedef std::tuple< clrChanT > clrChanTup1
 
typedef std::vector< clrChanT > clrChanVec
 

Public types for for packed integers.

typedef uint32_t packed4Cint
 Used for passing & returning integers with packed 8-bit channels.
 

Public color types related to colorT.

These types are used for things like color space computations and sources for setting channels, etc...

typedef colorTpl< double, 3 > colConDbl3
 Used for color space computations. Type identical to colConRGBdbl, but might not be RGB.
 
typedef colorTpl< double, 3 > colConRGBdbl
 RGB with double channels.
 
typedef colorTpl< double, 4 > colConRGBAdbl
 RGBA with double channels.
 
typedef colorTpl< uint8_t, 3 > colConRGBbyte
 RGB with uint8_t channels.
 
typedef colorTpl< uint8_t, 4 > colConRGBAbyte
 RGBA with uint8_t channels.
 
typedef colorTpl< double, numChan > colConALLdbl
 Color with the same number of challens as colorT, but with double channels.
 
typedef colorTpl< uint8_t, numChan > colConALLbyte
 Color with the same number of challens as colorT, but with uint8_t channels.
 

Public type for argument passing

typedef std::conditional< ptrIsSmaller, colorCRefType, colorType >::type colorArgType
 A type for passing colorTpl objects to functions.
 

2D Color Schemes

template<double cutDepth, double argCuts, double absCuts, bool logAbs>
using cs2dThallerHSL = cs2dThaller_tpl<1, 0, cutDepth, argCuts, absCuts, logAbs>
 Compute a color from Bernd Thaller's 2D complex number coloring scheme with HSL.
 
template<double cutDepth, double argCuts, double absCuts, bool logAbs>
using cs2dThallerHSVm = cs2dThaller_tpl<0, 1, cutDepth, argCuts, absCuts, logAbs>
 Compute a color from Bernd Thaller's 2D complex number coloring scheme with HSV and maximum value.
 
template<double cutDepth, double argCuts, double absCuts, bool logAbs>
using cs2dThallerHSV = cs2dThaller_tpl<0, 0, cutDepth, argCuts, absCuts, logAbs>
 Compute a color from Bernd Thaller's 2D complex number coloring scheme with HSV and dynamic value.
 
template<class csT , class csAT >
colorTplcsSet (csAT csArg)
 
template<class csT , class csAT >
colorTplcsSet (csAT csArg1, csAT csArg2)
 

Private Object Data

union { 
 
   maskType   theInt 
 
   clrChanT   thePartsA [numChan] 
 
theColor 
 Holds the color channel data.
 

Public Constants Related to RGBA channels

static constexpr int noRGBchanIdx = (redChanIdx < 0) && (greenChanIdx < 0) && (blueChanIdx < 0) && (alphaChanIdx < 0)
 
static constexpr int redChan = (noRGBchanIdx && numChan > 0 ? 0 : redChanIdx)
 
static constexpr int greenChan = (noRGBchanIdx && numChan > 1 ? 1 : greenChanIdx)
 
static constexpr int blueChan = (noRGBchanIdx && numChan > 2 ? 2 : blueChanIdx)
 
static constexpr int alphaChan = (noRGBchanIdx && numChan > 3 ? 3 : alphaChanIdx)
 

Public Constants Related to template paramaters

static constexpr int bitsPerChan = (int)(sizeof(clrChanT)*CHAR_BIT)
 Number of bits in clrChanT.
 
static constexpr int bitsPerPixel = numChan*bitsPerChan
 Number of color data bits.
 
static constexpr bool chanIsInt = std::is_integral<clrChanT>::value
 clrChanT is an integral type
 
static constexpr bool chanIsFloat = std::is_floating_point<clrChanT>::value
 clrChanT is a floating pint type
 
static constexpr bool chanIsUnsigned = std::is_unsigned<clrChanT>::value
 clrChanT is an unsigned integral type
 
static constexpr bool chanIsByte = std::is_same<clrChanT, uint8_t>::value
 is clrChanT an 8-bit unsigned int?
 
static constexpr bool chanIsDouble = std::is_same<clrChanT, double>::value
 is clrChanT a double?
 
static constexpr bool goodMask = (sizeof(maskType) >= sizeof(clrChanT)*numChan)
 maskType is big enough
 
static constexpr bool perfectMask = (sizeof(maskType) == sizeof(clrChanT)*numChan)
 maskType is perfectly sized
 
static constexpr bool goodArithD = (chanIsFloat || (sizeof(channelArithDType) >= sizeof(clrChanT)*2))
 channelArithDType is big enough
 
static constexpr bool goodArithSP = (chanIsFloat || (sizeof(channelArithSPType) >= sizeof(clrChanT)*2))
 channelArithSPType is big enough
 
static constexpr bool goodArithSDP = (chanIsFloat || (sizeof(channelArithSDPType) >= sizeof(clrChanT)*4))
 channelArithSDPType is big enough
 
static constexpr bool goodArithFlt = (chanIsFloat || (sizeof(channelArithFltType) > sizeof(clrChanT)))
 channelArithFltType is big enough
 
static constexpr bool goodArithLog = (sizeof(channelArithLogType) == sizeof(clrChanT))
 channelArithLogType is the right size
 
static constexpr int sizeOfColor = (int)(goodMask ? sizeof(maskType) : sizeof(clrChanT)*numChan)
 Size of this object.
 
static constexpr bool ptrIsSmaller = sizeOfColor > (int)sizeof(colorPtrType)
 This object smaller than a pointer.
 
static constexpr clrChanT maxChanVal = (chanIsInt ? std::numeric_limits<clrChanT>::max() : 1)
 maximum value for a channel
 
static constexpr clrChanT minChanVal = (chanIsInt ? std::numeric_limits<clrChanT>::min() : 0)
 maximum value for a channel
 
static constexpr clrChanT meanChanVal = (maxChanVal-minChanVal)/2
 middle value for a channel
 
static constexpr maskType maskAllOne = ~(static_cast<maskType>(0))
 mask value all ones
 
static constexpr maskType maskAllZero = static_cast<maskType>(0)
 mask value all zeros
 
static constexpr int channelCount = numChan
 Number of channels.
 

Color Scheme Constants

static constexpr csIntType chanStepMax = (chanIsInt ? static_cast<csIntType>(maxChanVal) : std::numeric_limits<uint32_t>::max())
 Finite "steps" for a color scheme: [0, chanStepMax].
 
static constexpr int minWavelength = 360
 Minimum wavelength for wavelength conversion.
 
static constexpr int maxWavelength = 830
 Maximum wavelength for wavelength conversion.
 

Default RGB Luminescence Weights

static constexpr double RGBluminanceWeightR = 0.2126
 
static constexpr double RGBluminanceWeightG = 0.7152
 
static constexpr double RGBluminanceWeightB = 0.0722
 

Private utility functions

double hslHelperVal (double n1, double n2, double hue)
 This is a helper function for setRGBfromColorSpace.
 
void setChansToMean ()
 Set all channels to meanChanVal.
 
void setChansToMin ()
 Set all channels to minChanVal.
 
void setChansToMax ()
 Set all channels to maxChanVal.
 
colorTplsetColorFromString (std::string colorString)
 Sets the current color based upon the contents of the given std::string.
 
clrChanT convertByteToChan (uint8_t cVal) const
 Convert a uint8_t to a clrChanT (for integral clrChanT)
 
clrChanT convertByteToChan (uint8_t cVal) const
 Convert a uint8_t to a clrChanT (for floating point clrChanT)
 
clrChanT convertHexStringToChan (std::string hexString) const
 Convert hex CString to clrChanT (for integral clrChanT)
 
clrChanT convertHexStringToChan (std::string hexString) const
 Convert hex CString to clrChanT (for floating point clrChanT)
 
uint8_t convertChanToByte (clrChanT cVal) const
 Convert a clrChanT to a uint8_t (for floating point clrChanT)
 
uint8_t convertChanToByte (clrChanT cVal) const
 Convert a clrChanT to a uint8_t (for integral clrChanT)
 
clrChanT convertDoubleToChan (double cVal) const
 Convert a double to a clrChanT.
 
double convertChanToDouble (clrChanT cVal) const
 Convert a clrChanT to a double.
 
maskType getMaskNC () const
 Return the mask value.
 
void setMaskNC (maskType aMask)
 Set the mask value.
 

Constructors: C++ Utility

 colorTpl ()
 The no arg constructor is a noop so we don't needlessly initialize millions of pixels – compiler warnings are expected.
 
 colorTpl (const colorType &aColor)
 Copy constructor (heavily used for assignment in the ramCanvas library).
 
 colorTpl (std::initializer_list< clrChanT > cVals)
 Initializer list.
 

Constructors: RGB

These all use setChansRGB or setChansRGBA internally; however, these constructors will set any unspecified channels to min.

 colorTpl (clrChanT r, clrChanT g, clrChanT b, clrChanT a)
 
 colorTpl (clrChanT r, clrChanT g, clrChanT b)
 

Constructors: Conversions

These are all guarnteed to set all channels of the object.

 colorTpl (clrChanT cVal)
 Uses setChans() to set all channels to the given value.
 
 colorTpl (cornerColorEnum cornerColor)
 Uses the setToCorner() method to set the initialize the object.
 
 colorTpl (std::string colorString)
 Uses the setColorFromString() method to set the initialize the object.
 
 colorTpl (const char *colorCString)
 Uses the setColorFromString() method to set the initialize the object.
 

Destructor

 ~colorTpl ()
 The destructor for this class is a no-op.
 

Utility Methods

colorTplcopy (colorArgType aCol)
 Copy the contents of the given color object into the current object.
 

Named Channel Access

Provides access to the specified color channel value with compile time index check.

  • _dbl versions work with double values scaled to [0, 1].
  • _byte versions work with uint8_t values scaled to [0, 255]
  • Numbered channel names are 0 indexed.
clrChanT getRed () const
 
clrChanT getBlue () const
 
clrChanT getGreen () const
 
clrChanT getAlpha () const
 
double getRed_dbl () const
 
double getGreen_dbl () const
 
double getBlue_dbl () const
 
double getAlpha_dbl () const
 
uint8_t getRed_byte () const
 
uint8_t getGreen_byte () const
 
uint8_t getBlue_byte () const
 
uint8_t getAlpha_byte () const
 
clrChanT getC0 () const
 
clrChanT getC1 () const
 
clrChanT getC2 () const
 
clrChanT getC3 () const
 
double getC0_dbl () const
 
double getC1_dbl () const
 
double getC2_dbl () const
 
double getC3_dbl () const
 
uint8_t getC0_byte () const
 
uint8_t getC1_byte () const
 
uint8_t getC2_byte () const
 
uint8_t getC3_byte () const
 

Indexed Channel Access

Provides access to an indexed color channel value with run time index check.

The channels are 0 indexed.

  • _dbl versions work with double values scaled to [0, 1].
  • _byte versions work with uint8_t values scaled to [0, 255]
clrChanT getChan (int chan) const
 
double getChan_dbl (int chan) const
 
uint8_t getChan_byte (int chan) const
 

Set Named Channel Value

Provides access to the specified color channel value with compile time index check.

  • _dbl versions work with double values scaled to [0, 1].
  • _byte versions work with uint8_t values scaled to [0, 255]
  • Numbered channel names are 0 indexed.
colorTplsetC0 (clrChanT cVal)
 
colorTplsetC1 (clrChanT cVal)
 
colorTplsetC2 (clrChanT cVal)
 
colorTplsetC3 (clrChanT cVal)
 
colorTplsetC0_dbl (double cVal)
 
colorTplsetC1_dbl (double cVal)
 
colorTplsetC2_dbl (double cVal)
 
colorTplsetC3_dbl (double cVal)
 
colorTplsetC0_byte (uint8_t cVal)
 
colorTplsetC1_byte (uint8_t cVal)
 
colorTplsetC2_byte (uint8_t cVal)
 
colorTplsetC3_byte (uint8_t cVal)
 
colorTplsetRed (clrChanT cVal)
 
colorTplsetBlue (clrChanT cVal)
 
colorTplsetGreen (clrChanT cVal)
 
colorTplsetAlpha (clrChanT cVal)
 
colorTplsetRed_dbl (double cVal)
 
colorTplsetGreen_dbl (double cVal)
 
colorTplsetBlue_dbl (double cVal)
 
colorTplsetAlpha_dbl (double cVal)
 
colorTplsetRed_byte (uint8_t cVal)
 
colorTplsetGreen_byte (uint8_t cVal)
 
colorTplsetBlue_byte (uint8_t cVal)
 
colorTplsetAlpha_byte (uint8_t cVal)
 
colorTplsetChansRGBA (clrChanT r, clrChanT g, clrChanT b, clrChanT a)
 
colorTplsetChansRGB (clrChanT r, clrChanT g, clrChanT b)
 
colorTplsetChansRGBA_dbl (double r, double g, double b, double a)
 
colorTplsetChansRGB_dbl (double r, double g, double b)
 
colorTplsetChansRGBA_byte (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 
colorTplsetChansRGB_byte (uint8_t r, uint8_t g, uint8_t b)
 
colorTplsetChansRGBA (clrChanTup4 chanValues)
 
colorTplsetChansRGB (clrChanTup3 chanValues)
 

Canonical Color Types.

Provide conversions to/from canonical color types.

colorTplsetChans_dbl (colConALLdbl dblColor)
 
colorTplsetChans_byte (colConALLbyte byteColor)
 
colorTplsetChansRGBA_dbl (colConRGBAdbl dblColor)
 
colorTplsetChansRGB_dbl (colConRGBdbl dblColor)
 
colorTplsetChansRGBA_byte (colConRGBAbyte byteColor)
 
colorTplsetChansRGB_byte (colConRGBbyte byteColor)
 
colConALLdbl getColCon_dbl ()
 
colConALLbyte getColCon_byte ()
 
colConRGBAdbl getColConRGBA_dbl ()
 
colConRGBdbl getColConRGB_dbl ()
 
colConRGBAbyte getColConRGBA_byte ()
 
colConRGBbyte getColConRGB_byte ()
 

Best guess for named channel index.

These are used when we wish to get the named channel index, but the current color might not have specified an approprate value.

int bestRedChan ()
 
int bestGreenChan ()
 
int bestBlueChan ()
 
int bestAlphaChan ()
 

Setting a single Channel by Index

Provides access to an indexed color channel value with run time index check.

The channels are 0 indexed.

  • _dbl versions work with double values scaled to [0, 1].
  • _byte versions work with uint8_t values scaled to [0, 255]
colorTplsetChanToMax (int chan)
 
colorTplsetChanToMin (int chan)
 
colorTplsetChan (int chan, clrChanT cVal)
 
colorTplsetChan_dbl (int chan, double cVal)
 
colorTplsetChan_byte (int chan, uint8_t cVal)
 

Set/Get Single Channel values with no index checks.

Warning
These functions are fast, but have no error checking. Use them wrong, and get a segfault!
colorTplsetChanNC (int chan, clrChanT cVal)
 Sets the specified color channel value with no index check.
 
clrChanT getChanNC (int chan) const
 Provides access to an specified color channel value with no index check.
 

Set All Channel Values To One Value

Sets all components of the current object from to cVal.

  • _dbl versions work with double values scaled to [0, 1].
  • _byte versions work with uint8_t values scaled to [0, 255]
colorTplsetChans (clrChanT cVal)
 
colorTplsetChans_dbl (double cVal)
 
colorTplsetChans_byte (uint8_t cVal)
 

Set Channel Value(s) with clrChanT values

colorTplsetChans (clrChanTup4 chanValues)
 Sets the first four channels current object.
 
colorTplsetChans (clrChanTup3 chanValues)
 Sets the first three channels current object.
 
colorTplsetChans (clrChanVec &chanValues)
 This function sets color channels from the data in a std::vector.
 
colorTplsetChans (std::string colorHexString, bool clearUndefinedChannels=false)
 Sets the current color based upon the contents of the given color hex string.
 

Set To Special Colors (RGB Corners)

While the assumed color model is RGB, these functions are generalized beyond RGB in that non-RGB channels are uniformly, and usefully, manipulated.

For example, setToBlack and setToWhite functions set all channels to minimum and maximum respectively – both reasonable definitions for "black" and "white" in many situations. The "primary" colors (red, blue, and green) set all non-RGB channels to minimum, and the "secondary" colors (cyan, yellow, and magenta) set all non-RGB channels to max. The reason for this difference in behavior on non-RGB channels between primary and secondary colors is two fold: 1) It allows the setTo*() functions to complete their work using no more than two assignment statements for channel objects with integer channels and good masks. 2) It makes each secondary an inverse (a logical NOT for integer colors) color from a primary across all channels. Note that the other functions in this group end with a call to one of the setTo*() functions.

colorTplsetToBlack ()
 
colorTplsetToWhite ()
 
colorTplsetToRed ()
 
colorTplsetToBlue ()
 
colorTplsetToGreen ()
 
colorTplsetToCyan ()
 
colorTplsetToYellow ()
 
colorTplsetToMagenta ()
 
colorTplsetToHalf ()
 
colorTplsetToCorner (char cornerColor)
 Set the current color based upon the single character given – 0==black, R, G, B, M, C, Y, W/1==white).
 
colorTplsetToCorner (cornerColorEnum cornerColor)
 Set the color to the given corner color.
 
colorTplsetToCorner (std::string cornerColor)
 Set the color to the named corner color.
 

Color Setting Methods via Logically Packed Integers.

By "logically" we mean as if the integers were written on paper left to right with MSB on the left – the same way they are "written" in C++ source code.

ex: 0x11223344u has 11 as the most significant byte, but it might be placed in memory differently. These functions are very usefully for unpacking integers derived from integer literals in C++ code. setRGBfromLogPackIntARGB() is heavily used for color schemes.

colorTplsetRGBAfromLogPackIntGen (packed4Cint anInt, uint8_t rIdx, uint8_t gIdx, uint8_t bIdx, uint8_t aIdx)
 Set the color based upon the bytes of the given integer ordered from LSB to MSB.
 
colorTplsetRGBfromLogPackIntGen (packed4Cint anInt, uint8_t rIdx, uint8_t gIdx, uint8_t bIdx)
 Just like setRGBAfromLogPackIntGen, but no A.
 
colorTplsetRGBAfromLogPackIntARGB (packed4Cint anInt)
 
colorTplsetRGBfromLogPackIntARGB (packed4Cint anInt)
 
colorTplsetRGBAfromLogPackIntRGBA (packed4Cint anInt)
 
colorTplsetRGBfromLogPackIntRGBA (packed4Cint anInt)
 
colorTplsetRGBAfromLogPackIntABGR (packed4Cint anInt)
 
colorTplsetRGBfromLogPackIntABGR (packed4Cint anInt)
 
colorTplsetRGBAfromLogPackIntBGRA (packed4Cint anInt)
 
colorTplsetRGBfromLogPackIntBGRA (packed4Cint anInt)
 
colorTplsetRGBAfromLogPackIntABRG (packed4Cint anInt)
 
colorTplsetRGBfromLogPackIntABRG (packed4Cint anInt)
 

TGA Height Maps for POVray

colorTplsetRGBcmpGreyTGA16bit (uint32_t tga16val)
 Computes a 24-bit truecolor value intended for use in producing 16-bit greyscale TGA.
 
colorTplsetRGBcmpGreyTGA24bit (uint32_t tga24val)
 Computes a 24-bit truecolor value intended for use in producing 24-bit greyscale TGA.
 

Color Setting Methods via Physically Packed Integers.

By "physically" we mean as the bytes are physically ordered in RAM – which may differ from how we write them on paper or in C++ code.

colorTplsetRGBAfromPackIntGen (packed4Cint anInt, uint8_t rIdx, uint8_t gIdx, uint8_t bIdx, uint8_t aIdx)
 Set the color based upon the bytes of the given integer ordered as in RAM.
 
colorTplsetRGBfromPackIntGen (packed4Cint anInt, uint8_t rIdx, uint8_t gIdx, uint8_t bIdx)
 Just like setRGBAfromPackIntGen, but no A.
 

Setting Colors Based Upon Other Color Spaces

Other Colorspaces.

The most common use case is to think of the image as holding RGB color data, and these functions are designed with that idea in mind. Note that alternate colorspaces computations all take place with double floating point values. Various other tools are also available for manipulating colors in other colorspaces (see: interplColorSpace() and rgb2colorSpace() for example).. See the colorSpaceEnum for details regarding supported colorspaces.

colorTplsetRGBfromUnitHSV (double H, double S, double V)
 Set the color indicated by the given HSV values.
 
colorTplsetRGBfromUnitHSL (double H, double S, double L)
 Set the color indicated by the given HSL values.
 
colorTplsetRGBfromColorSpace (colorSpaceEnum space, double inCh1, double inCh2, double inCh3)
 Set the color indicated by the color space and values.
 
colorTplsetRGBfromColorSpace (colorSpaceEnum space, colConDbl3 inColor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 

Setting Colors Based Upon Spectral Color

colorTplsetRGBfromWavelengthCM (double wavelength, cmfInterpolationEnum interpMethod=cmfInterpolationEnum::LINEAR)
 Set the color indicated by the given wavelength.
 
colorTplsetRGBfromWavelengthLA (double wavelength)
 Set the color indicated by the given wavelength.
 

Color Ramps, Gradients, Interpolation, Binary Thresholds.

Members in this section form the computational foundation for many of the named color schemes found in this class.

colorTplcmpGradiant (csFltType csX, std::vector< csFltType > const &anchors, std::vector< colorType > const &colors)
 Convert a double to a color value based upon a color ramp passing through the given sequence of corner colors at the given anchor points.
 
colorTplcmpGradiant (csFltType csX, std::vector< colorType > const &colors)
 Identical to the other cmpGradiant() function except that equidistant anchors are automatically generated on [0, 1] for the given colors array.
 
colorTplcmpGradiant (csFltType csX, csIntType numColors, const packed4Cint *colors)
 Identical to the other equidistant cmpGradiant() function except that this one works on just the RGB channels and takes an array of packed integers.
 
colorTplcmpRGBcornerCGradiant (csFltType csX, const char *cornerColors)
 This is simply a version of cmpRGBcornerCGradiant() that computes the length of the final argument as a C-string.
 
colorTplcmpRGBcornerDGradiant (csIntType csIdx, const char *cornerColors)
 This is simply a version of cmpRGBcornerDGradiant() that computes the length of the final argument as a C-string.
 
template<typename ccT >
colorTplcmpRGBcornerDGradiant (csIntType csIdx, csIntType numColors, const ccT *cornerColors)
 Color value based upon a color ramp passing through the given sequence of corner colors at equal intervals along [0, (mjr::colorTpl::chanStepMax * (numColors - 1) + 1)].
 
template<typename ccT >
colorTplcmpRGBcornerCGradiant (csFltType csX, csIntType numColors, const ccT *cornerColors)
 Color value based upon a color ramp passing through the given sequence of corner colors at equal intervals along [0.0, 1.0].
 
colorTplinterplColorSpace (colorSpaceEnum space, double aDouble, colorArgType col1, colorArgType col2)
 Set the current color to a value linearly interpolated between the two given colors.
 
clrChanT channelArithFlt2clrChan (channelArithFltType flt)
 Convert a channelArithFltType value into a clrChanT value.
 
colorTplwMean (channelArithFltType w1, channelArithFltType w2, channelArithFltType w3, channelArithFltType w4, colorArgType col1, colorArgType col2, colorArgType col3, colorArgType col4)
 Compute the weighted mean of the given colors.
 
colorTplwMean (channelArithFltType w1, channelArithFltType w2, channelArithFltType w3, colorArgType col1, colorArgType col2, colorArgType col3)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
colorTplwMean (channelArithFltType w1, channelArithFltType w2, colorArgType col1, colorArgType col2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
colorTpluMean (channelArithFltType w1, channelArithFltType w2, channelArithFltType w3, colorArgType col1, colorArgType col2, colorArgType col3, colorArgType col4)
 Compute the unit weighted mean of the given colors – like wMean(), but last weight is computed such that weights sum to 1.0.
 
colorTpluMean (channelArithFltType w1, channelArithFltType w2, colorArgType col1, colorArgType col2, colorArgType col3)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
colorTpluMean (channelArithFltType w1, colorArgType col1, colorArgType col2)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
colorTpllinearInterpolate (double aDouble, colorArgType col1, colorArgType col2)
 Set the current color to a value linearly interpolated between the two given colors.
 
colorTpllinearInterpolateRGB (double aDouble, colorArgType col1, colorArgType col2)
 Set the RGB channels of the current color to a value linearly interpolated between the two given colors.
 

Logical Operators

colorTpltfrmOr (colorArgType aCol)
 Performs a logical OR with the current object and the given object and places the value in the current object.
 
colorTpltfrmOr (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmNor (colorArgType aCol)
 Performs a logical NOR with the current object and the given object and places the value in the current object.
 
colorTpltfrmNor (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmAnd (colorArgType aCol)
 Performs a logical AND with the current object and the given object and places the value in the current object.
 
colorTpltfrmAnd (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmNand (colorArgType aCol)
 Performs a logical NAND with the current object and the given object and places the value in the current object.
 
colorTpltfrmNand (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmXor (colorArgType aCol)
 Performs a logical EXCLUSIVE OR (XOR) with the current object and the given object and places the value in the current object.
 
colorTpltfrmXor (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmNxor (colorArgType aCol)
 Performs a logical NOT EXCLUSIVE OR (NXOR) with the current object and the given object and places the value in the current object.
 
colorTpltfrmNxor (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmNot (void)
 Performs logical (bit-wise) negation of current object.
 
colorTpltfrmNot (void)
 Template specialization member function differing from the above function only in supported template conditions.
 

Arithmetic Operators

colorTpltfrmSqDiff (colorArgType aCol)
 Computes the square of the difference for each channel between the given color and the current color object.
 
colorTpltfrmAbsDiff (colorArgType aCol)
 Computes the absolute value of the difference for each channel between the given color and the current color object.
 
colorTpltfrmAdd (colorArgType aCol)
 Computes the arithmetic sum of the given color and the current one.
 
colorTpltfrmDiv (colorArgType aCol)
 Computes the arithmetic division of the current color by the given color.
 
colorTpltfrmDiv (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmMult (colorArgType aCol)
 Computes the arithmetic product of the given color and the current one.
 
colorTpltfrmMultClamp (colorArgType aCol)
 Computes the product of the given color and the current one.
 
colorTpltfrmSignDiff (colorArgType aCol)
 Computes the component wise scaled sign of the difference between the current color and the given one.
 
colorTpltfrmDiffClamp (colorArgType aCol)
 Computes the arithmetic difference of the given color from the current one.
 
colorTpltfrmNegDiffClamp (colorArgType aCol)
 Computes the negative of the arithmetic difference of the given color from the current one.
 
colorTpltfrmAddClamp (colorArgType aCol)
 Computes the arithmetic sum of the given color from the current one.
 
colorTpltfrmAddDivClamp (colorArgType aCol, colorArgType dCol)
 Computes the arithmetic sum of the current color and aCol, then divids by dCol.
 
colorTpltfrmAddDivClamp (colorArgType aCol, colorArgType dCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmDiff (colorArgType aCol)
 Computes the arithmetic difference of the given color from the current one.
 
colorTpltfrmMod (colorArgType aCol)
 Computes the arithmetic modulus of the current by the given one.
 
colorTpltfrmMod (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmInvert ()
 Transforms the color: r=maxChanVal-r, g=maxChanVal-r, and b=maxChanVal-b.
 

Named Operators

colorTpltfrmPow (double p)
 Power: c=maxChanVal*(c/maxChanVal)^p.
 
colorTpltfrmLn1 ()
 Adds 1.0 and takes the natural logarithm of each channel.
 
colorTpltfrmLn1 ()
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmLn (double scale)
 Computes ln(c)*scale for each channel value c.
 
colorTpltfrmLn (double scale)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmMix (double aDouble, colorArgType tooCol)
 Linearly interpolate between the current color and the given color (at a point scaled the unit interval).
 
colorTpltfrmCopy (colorArgType aCol)
 Copies the given argument into the current color object.
 
colorTpltfrmMaxI (colorArgType aCol)
 Makes the current color the maximum of the current color or the given color.
 
colorTpltfrmMinI (colorArgType aCol)
 Makes the current color the minimum of the current color or the given color.
 
colorTpltfrmMax (colorArgType aCol)
 Makes each component of the current color the maximum of that component and the corresponding component of the given color.
 
colorTpltfrmMin (colorArgType aCol)
 Makes each component of the current color the minimum of that component and the corresponding component of the given color.
 
colorTpltfrmShiftL (colorArgType aCol)
 The Shift Left Transform modifies the current color.
 
colorTpltfrmShiftL (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmShiftR (colorArgType aCol)
 The Shift Right Transform modifies the current color.
 
colorTpltfrmShiftR (colorArgType aCol)
 Template specialization member function differing from the above function only in supported template conditions.
 
colorTpltfrmSaw (colorArgType lowCol, colorArgType highCol)
 The Saw Transform modifies the current color: C_i = ifelse(ra<=C_i<=rb, C_i, 0)
 
colorTpltfrmStep (colorArgType lowCol, colorArgType highCol)
 The Saw Transform modifies the current color: C_i = ifelse(ra<=C_i<=rb, maxChanVal, 0)
 
colorTpltfrmDiracTot (colorArgType aCol)
 The DiracTot (total) Transform modifies the current color: Set current color to white if it equals aCol, and black otherwise.
 
colorTpltfrmDirac (colorArgType aCol)
 The Dirac Transform modifies the current color: C_i = ifelse(C_i==aCol.C_i, maxChanVal, 0)
 
colorTpltfrmFuzzyDirac (colorArgType ctrCol, colorArgType radCol)
 The Fuzzy Dirac Transform modifies the current color: C_i=ifelse(|R-ctrCol.R|<=radCol.R), maxChanVal, 0)
 
colorTpltfrmMean (colorArgType aCol)
 Computes the arithmetic mean of the given color and the current one.
 
colorTpltfrmGmean (colorArgType aCol)
 Computes the geometric mean of the given color and the current one.
 
colorTpltfrmGreyScaleRGB (void)
 Transform the current color by rendering it into a true grey via the same method used by the luminanceRGB() function.
 

Color Reduction Transformations

colorTpltfrmWebSafeRGB ()
 The 216 Palate Web Safe Transform modifies the current color into the closest web safe color from the 216 color web safe pallet.
 

Alternate Color Space Stuff

colConDbl3 rgb2colorSpace (colorSpaceEnum space) const
 Compute channels for given color space coordinates for the current color.
 
std::string colorSpaceToString (colorSpaceEnum space)
 Compute channels for given color space coordinates for the current color.
 

Color Transformation Functions

colorTpltfrmLinearGreyLevelScale (double c, double b)
 The Linear Grey Level Scale transform modifies the current color such that: C_n=c*C_n+b.
 
colorTpltfrmLinearGreyLevelScaleRGB (double rc, double rb, double gc, double gb, double bc, double bb)
 The Linear Grey Level Scale transform modifies the current color such that: R=rc*R+rb, G=gc*G+gb, B=bc*B+bb.
 
colorTpltfrmComplexCut (std::complex< double > z, double cutDepth, double argCuts, double absCuts, bool logAbs=true)
 Perform a tfrmLinearGreyLevelScale based on a complex number.
 
colorTpltfrmStdPow (double p)
 The Standard Power Transform modifies the current color such that: C_i = maxChanVal*(C_i / maxChanVal)**p.
 
colorTpltfrmStdPowRGB (double rp, double gp, double bp)
 The Standard Power Transform modifies the current color such that: R=maxChanVal*(R/maxChanVal)**rp, B=maxChanVal*(B/maxChanVal)**gp, B=maxChanVal*(B/maxChanVal)**bp.
 
colorTpltfrmStdPowSqr (void)
 The Standard Power Transform with p=2.
 
colorTpltfrmStdPowSqrt (void)
 The Standard Power Transform with p=1/2.
 

Mathematical Operations On Color(s)

Members in this section produce non-color results.

i.e. They consume the current, and possibly other colors and arguments, to produce a non-color result.

channelArithFltType rgb2GreyDotProd (channelArithFltType redWt=RGBluminanceWeightR, channelArithFltType greenWt=RGBluminanceWeightG, channelArithFltType blueWt=RGBluminanceWeightB) const
 Use the R, G, & B channels to compute a floating point value representing a grey scale.
 
channelArithFltType luminanceRGB (void) const
 Compute the luminance of the current color via the definition given in the ITU-R Recommendation BT.709.
 
channelArithSPType intensityRGB (void) const
 Compute the unscaled intensity (sum of the R, G, & B components) of the current color.
 
channelArithSPType intensity () const
 Compute the sum of the components.
 
channelArithFltType intensityScaledRGB () const
 Compute the scaled intensity (sum of the first three components divided by the maximum intensity possible) of the current color.
 
channelArithFltType intensityScaled () const
 Compute the scaled intensity (sum of the components divided by the maximum intensity possible) of the current color.
 
clrChanT getMaxC () const
 Returns the value of the largest component.
 
clrChanT getMinC () const
 Returns the value of the smallest component.
 
clrChanT getMaxRGB () const
 Returns the value of the largest component from R, G, and B.
 
clrChanT getMinRGB () const
 Returns the value of the smallest component from R, G, and B.
 
channelArithFltType dotProd (colorArgType aColor) const
 Compute the dot product between the current color and the given color.
 
channelArithFltType distHypot (colorArgType aColor) const
 Distance between current color and given one (sum squares of channel differences – Euclidean distance squared).
 
channelArithSPType distSumAbs (colorArgType aColor) const
 Distance between current color and given one (sum of absolute channel differences).
 
channelArithSPType distMaxAbs (colorArgType aColor) const
 Distance between current color and given one (maximum of absolute value of channel differences).
 
double distDeltaE1976 (colorArgType aColor) const
 LAB Delta E* distance between current color and given one.
 
double distDeltaE1994 (colorArgType aColor) const
 LAB Delta E* 1994 (graphic arts) distance between current color and given one.
 
bool isClose (colorArgType aColor, clrChanT epsilon) const
 Returns non-zero if the current color is close to aColor (the maximum delta between any two channels is less than or equal to epsilon).
 
bool isCloseRGB (colorArgType aColor, clrChanT epsilon) const
 Like isClose(), but only checks the R, G, & B channels.
 
bool isEqual (colorArgType aColor) const
 Returns non-zero if the current color is precicely equal to aColor.
 
bool isEqualRGB (colorArgType aColor) const
 Like isEqual(), but only checks the R, G, & B channels.
 
bool isNotEqual (colorArgType aColor) const
 Returns non-zero if the given color is logically NOT the same as the current color.
 
bool isBlack ()
 Returns non-zero if the given color is black (all componnets are zero)
 
bool isBlackRGB () const
 LIke isBlack(), but only checks the R, G, & B channels.
 

Channel Clipping Functions

template<typename iT >
requires (std::same_as<iT, clrChanT> || std::same_as<iT, channelArithDType> || std::same_as<iT, channelArithSPType> || std::same_as<iT, channelArithSDPType> || std::same_as<iT, channelArithLogType>)
clrChanT clampTop (iT arithValue)
 Clamp a value to (infinity, maxChanVal].
 
template<typename iT >
requires (std::same_as<iT, clrChanT> || std::same_as<iT, channelArithDType> || std::same_as<iT, channelArithSPType> || std::same_as<iT, channelArithSDPType> || std::same_as<iT, channelArithLogType>)
clrChanT clampBot (iT arithValue)
 Clamp a value to [minChanVal, infinity).
 
template<typename iT >
requires (std::same_as<iT, clrChanT> || std::same_as<iT, channelArithDType> || std::same_as<iT, channelArithSPType> || std::same_as<iT, channelArithSDPType> || std::same_as<iT, channelArithLogType>)
clrChanT clampAll (iT arithValue)
 Clamp a value to [minChanVal, maxChanVal].
 

Detailed Description

template<class clrChanT, int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
requires ((numChan>0) && // Must have at least 1 chan (std::is_unsigned<clrChanT>::value || std::is_floating_point<clrChanT>::value) && // unsigned integral or floating point (std::is_floating_point<clrChanT>::value || (sizeof(clrChanT) >= 1)) && // If clrChanT int, then must be >= 1 char size (redChanIdx < numChan) && (blueChanIdx < numChan) && (greenChanIdx < numChan) && (alphaChanIdx < numChan) && (((blueChanIdx < 0) && (redChanIdx < 0) && (greenChanIdx < 0)) || ((blueChanIdx >= 0) && (redChanIdx >= 0) && (greenChanIdx >= 0))) && // R, G, & B all non-negative or all negative ((alphaChanIdx < 0) || (redChanIdx >= 0)) && // If A is non-negative, then all non-negative ((redChanIdx < 0) || ((redChanIdx != greenChanIdx) && (redChanIdx != blueChanIdx) && (redChanIdx != alphaChanIdx) && (greenChanIdx != blueChanIdx) && (greenChanIdx != alphaChanIdx) && (blueChanIdx != alphaChanIdx))))
class mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >

Template Class used to house colors for ramCanvas objects.

This template provides a rich API for color management, and may be used to store colors with a wide range of channel depth and count. This class is intended to be a "small concrete" class (as defined by Bjarne Stroustrup in "The C++ Programming Language"). That is to say, it is intended for use as a "fundamental" type for tools requiring a space efficient and high performance set of concrete objects representing colors. The canonical example is representing an image as a very large, rectangular array of colors.

Size efficiency

While this class supports large channel counts and very deep channels, it is best optimized for colors that take require no more RAM space than the largest hardware supported integer. This is because the library uses an integer to cover color channel array in RAM to make memory operations faster. With a compiler supporting ISO C++, this object should take no more than the maximum of sizeof(clrChanT)*numChan or the mask used to cover the data. More detail on the "mask" is provided later in the section "Memory Layout and Performance".

Passing colors as function arguments

The most common use cases are 24-bit RGB, 32-bit RGBA, and greyscale up to 64-bits deep. All of these types are smaller than a 64-bit pointer, so it is almost always better to pass these values around by value. That said, some types are quite large – an RGBA image with 64-bit floating point channels requires 256 bits of RAM. For these larger color objects, it is more efficient to pass them by reference. Within the library, some care is taken to adapt to the size of the color object, and pass objects to functions by the most efficient means (value or const reference). The class provides a type the end user can employ to use this same strategy: colorArgType.

Memory Layout and Performance

Within this object an integer mask and an array of numChan clrCompT are placed into a union – and thus are stacked upon each other in memory. When an integer type exists that can cover the entire channel array without wasting too much space, we can achieve serious performance gains. The trick is finding an integer big enough, but not so big it wastes space. Big enough means it is at least sizeof(clrChanT)*numChan chars long. The "not too big" constraint is more flexible, and I have elected to make a covering mask only if we waste no more than 1/4 of the RAM for the mask value. Examples:

  • An RGBA color with 8-bit channels (32-bits total) is covered by a uint32_t with no lost space.
  • An RGB color with 8-bit canonical (24-bits total) is also covered with a single uint32_t. One byte per pixel is wasted – i.e. 25% of the space.
  • A 5 channel color with 8-bit channels (40-bits total) is NOT covered by a uint64_t as it would lead to almost 50% wasted space.
  • A 6 channel color with 8-bit channels (48-bits total) is would be covered by a uint64_t – a 25% waste of space.

When we can't cover the channel array, the mask type will be set to a uint8_t to avoid any alignment issues with the union.

Some common diagrams of common cases might help:

  2222222222222222  Cover: 16-bits
  11111111          1x8   Waste 1/2 => No Cover
  1111111122222222  2x8   Waste 0/2 => Cover with 16-bits

  44444444444444444444444444444444  Cover: 32-bits
  111111112222222233333333          3x8   Waste 1/4 => Cover with 32-bits
  11111111222222223333333344444444  4x8   Waste 0/4 => Cover with 32-bits

  8888888888888888888888888888888888888888888888888888888888888888
  1111111122222222333333334444444455555555                          5x8   Waste 3/8 => No cover
  111111112222222233333333444444445555555566666666                  6x8   Waste 2/8 => Cover with 64-bits
  111111111111111122222222222222223333333333333333                  3x16  Waste 2/8 => Cover with 64-bits

  FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
  1111111122222222333333334444444455555555666666667777777788888888999999990000000011111111               11x8 Waste 5/16 => No Cover
  111111112222222233333333444444445555555566666666777777778888888899999999000000001111111122222222       12x8 Waste 4/16 => Cover with uint128_t
  11111111111111112222222222222222333333333333333344444444444444445555555555555555                       5x16 Waste 6/16 == No Cover
  111111111111111122222222222222223333333333333333444444444444444455555555555555556666666666666666       6x16 Waste 4/16 => Cover with uint128_t
  111111111111111111111111111111112222222222222222222222222222222233333333333333333333333333333333       3x32 Waste 4/16 => Cover with uint128_t
Usage

Several methods are provided that access and modify the internal color represented by a color object. In most cases, methods that modify the color object state return a reference to the object after the change. This provides the ability to use the value returned by such a function in the expression in which it appears. So, for example, it is not necessary to use two statements to change a color object's value and then use it in a drawing function. As another example, this provides the ability to do "method chaining" like so: aColor.setToRed().setToBlack() – which will lead to aColor being black. The obvious potential performance impact of returning unused references is generally optimized away by modern compilers.

Several methods are provided that transform the color object as a whole. For example, methods are provided to compute component-wise linear histogram transformations. Note that transformation methods are not provided to transform just one component of an object or a range of components. The philosophy is that the class provides methods that treat the color object as a whole and not methods that operate on single components. Just as we don't have a function to add the second half of two integers together – integers are one "thingy" and so are colors. :)

Construction

Several constructors are provided. All in all, the goal is to make it easy to construct color objects with a specified color.

                    |--------------------------------+---------------------+----------------------------------------|
                    | Type                           | Member Helper       | Cast Application                       |
                    |--------------------------------+---------------------+----------------------------------------|
                    | colorT                         | copy                |                                        |
                    | four clrChanT                  | setChans            |                                        |
                    | three clrChanT                 | setChans            |                                        |
                    | two clrChanT                   | setChans            |                                        |
                    | one clrChanT                   | setChans            | drawPoint(x, y, 128);                  |
                    | Named Corner Colors via string | setColorFromString  | drawPoint(x, y, "Red");                |
                    | Web hex string                 | setColorFromString  | drawPoint(x, y, "#FF0000");            |
                    | Extended web hex string        | setColorFromString  | drawPoint(x, y, "##FFFF00000000");     |
                    | Single character string        | setColorFromString  | drawPoint(x, y, "R");                  |
                    | Named Corner Colors via ENUM   | setToCorner         | drawPoint(x, y, cornerColorEnum::RED); |
                    |--------------------------------+---------------------+----------------------------------------|
Template Parameters
clrChanTType to contain the channel information. This type should be a unsigned integral type, a float, or double.
numChanThe number of channels this color will have. Common choices are 1 for greyscale, 3 for RGB, and 4 for RGBA.
redChanIdxIndex for the Red channel. -1 indicates no Red chan.
blueChanIdxIndex for the Blue channel. -1 indicates no Red channel.
greenChanIdxIndex for the Green channel. -1 indicates no Red channel.
alphaChanIdxIndex for the Alpha channel. -1 indicates no Red channel. If redChanIdx, blueChanIdx, greenChanIdx, & alphaChanIdx are all -1, then they will be assigned to channels 0, 1, 2, & 3 when numChan is >= 4. If they are all negative and numChan == 3, then alphaChanIdx won't be assigned, but red, blue, and green will be.

Definition at line 209 of file MRcolorTpl.hpp.

Member Typedef Documentation

◆ colorType

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorType

This object type.

Definition at line 217 of file MRcolorTpl.hpp.

◆ colorPtrType

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorType* mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorPtrType

Pointer to colorTpl.

Definition at line 219 of file MRcolorTpl.hpp.

◆ colorRefType

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorType& mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorRefType

Reference to colorTpl)

Definition at line 221 of file MRcolorTpl.hpp.

◆ colorCRefType

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorType const& mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorCRefType

Reference to const colorTpl.

Definition at line 223 of file MRcolorTpl.hpp.

◆ channelType

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::channelType

Type for the channels (clrChanT)

Definition at line 225 of file MRcolorTpl.hpp.

◆ clrChanTup6

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::tuple<clrChanT, clrChanT, clrChanT, clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanTup6

Definition at line 231 of file MRcolorTpl.hpp.

◆ clrChanTup5

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::tuple<clrChanT, clrChanT, clrChanT, clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanTup5

Definition at line 232 of file MRcolorTpl.hpp.

◆ clrChanTup4

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::tuple<clrChanT, clrChanT, clrChanT, clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanTup4

Definition at line 233 of file MRcolorTpl.hpp.

◆ clrChanTup3

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::tuple<clrChanT, clrChanT, clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanTup3

Definition at line 234 of file MRcolorTpl.hpp.

◆ clrChanTup2

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::tuple<clrChanT, clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanTup2

Definition at line 235 of file MRcolorTpl.hpp.

◆ clrChanTup1

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::tuple<clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanTup1

Definition at line 236 of file MRcolorTpl.hpp.

◆ clrChanVec

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::vector<clrChanT> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clrChanVec

Definition at line 238 of file MRcolorTpl.hpp.

◆ packed4Cint

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint32_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::packed4Cint

Used for passing & returning integers with packed 8-bit channels.

Definition at line 244 of file MRcolorTpl.hpp.

◆ colConDbl3

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<double, 3> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConDbl3

Used for color space computations. Type identical to colConRGBdbl, but might not be RGB.

Definition at line 251 of file MRcolorTpl.hpp.

◆ colConRGBdbl

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<double, 3> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConRGBdbl

RGB with double channels.

Definition at line 252 of file MRcolorTpl.hpp.

◆ colConRGBAdbl

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<double, 4> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConRGBAdbl

RGBA with double channels.

Definition at line 253 of file MRcolorTpl.hpp.

◆ colConRGBbyte

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<uint8_t, 3> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConRGBbyte

RGB with uint8_t channels.

Definition at line 254 of file MRcolorTpl.hpp.

◆ colConRGBAbyte

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<uint8_t, 4> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConRGBAbyte

RGBA with uint8_t channels.

Definition at line 255 of file MRcolorTpl.hpp.

◆ colConALLdbl

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<double, numChan> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConALLdbl

Color with the same number of challens as colorT, but with double channels.

Definition at line 256 of file MRcolorTpl.hpp.

◆ colConALLbyte

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl<uint8_t, numChan> mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colConALLbyte

Color with the same number of challens as colorT, but with uint8_t channels.

Definition at line 257 of file MRcolorTpl.hpp.

◆ colorArgType

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::conditional<ptrIsSmaller,colorCRefType,colorType>::type mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorArgType

A type for passing colorTpl objects to functions.

WHen the size of a colorTpl object is smaller than a pointer, this type is colorTpl – resulting in pass by value. Otherwise, this type is colorType const& – resulting in pass by refrence.

Definition at line 557 of file MRcolorTpl.hpp.

◆ cs2dThallerHSL

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<double cutDepth, double argCuts, double absCuts, bool logAbs>
using mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cs2dThallerHSL = cs2dThaller_tpl<1, 0, cutDepth, argCuts, absCuts, logAbs>

Compute a color from Bernd Thaller's 2D complex number coloring scheme with HSL.

See: Bernd Thaller (2000); Visual Quantum Mechanics; pp 2-8 This is a continuous, 2D color scheme!

Template Parameters
cutDepthSee: tfrmComplexCut()
argCutsSee: tfrmComplexCut()
absCutsSee: tfrmComplexCut()
logAbsSee: tfrmComplexCut()

Definition at line 5163 of file MRcolorTpl.hpp.

◆ cs2dThallerHSVm

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<double cutDepth, double argCuts, double absCuts, bool logAbs>
using mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cs2dThallerHSVm = cs2dThaller_tpl<0, 1, cutDepth, argCuts, absCuts, logAbs>

Compute a color from Bernd Thaller's 2D complex number coloring scheme with HSV and maximum value.

See: Bernd Thaller (2000); Visual Quantum Mechanics; pp 2-8 This is a continuous, 2D color scheme!

Template Parameters
cutDepthSee: tfrmComplexCut()
argCutsSee: tfrmComplexCut()
absCutsSee: tfrmComplexCut()
logAbsSee: tfrmComplexCut()

Definition at line 5173 of file MRcolorTpl.hpp.

◆ cs2dThallerHSV

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<double cutDepth, double argCuts, double absCuts, bool logAbs>
using mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cs2dThallerHSV = cs2dThaller_tpl<0, 0, cutDepth, argCuts, absCuts, logAbs>

Compute a color from Bernd Thaller's 2D complex number coloring scheme with HSV and dynamic value.

See: Bernd Thaller (2000); Visual Quantum Mechanics; pp 2-8 This is a continuous, 2D color scheme!

Template Parameters
cutDepthSee: tfrmComplexCut()
argCutsSee: tfrmComplexCut()
absCutsSee: tfrmComplexCut()
logAbsSee: tfrmComplexCut()

Definition at line 5183 of file MRcolorTpl.hpp.

Member Enumeration Documentation

◆ cornerColorEnum

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
enum class mjr::colorTpl::cornerColorEnum
strong

Colors at the corners of the RGB color cube.

Enumerator
BLACK 

Color cube corner color with RGB=000.

RED 

Color cube corner color with RGB=100.

GREEN 

Color cube corner color with RGB=010.

BLUE 

Color cube corner color with RGB=001.

YELLOW 

Color cube corner color with RGB=110.

CYAN 

Color cube corner color with RGB=011.

MAGENTA 

Color cube corner color with RGB=101.

WHITE 

Color cube corner color with RGB=111.

Definition at line 600 of file MRcolorTpl.hpp.

◆ colorSpaceEnum

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
enum class mjr::colorTpl::colorSpaceEnum
strong

Color spaces.

This ENUM is used by setRGBfromColorSpace(), interplColorSpace(), and rgb2colorSpace(). In this context these color spaces use double values for each channel. Angles (the H of HSV, HSL, & LCH) are in degrees, and will always be normalized to [0, 360).

Enumerator
RGB 

RGB color space. R in [0, 1]. G in [0, 1]. B in [0, 1].

HSL 

HSL color space. H in [0, 360]. S in [0, 1]. L in [0, 1].

HSV 

HSV color space. H in [0, 360]. S in [0, 1]. V in [0, 1].

LAB 

CIE-L*ab color space. L in [0, 100]. A in REALS. B in REALS.

XYZ 

XYZ color space. X in [0, 1]. Y in [0, 1]. Z in [0, 1].

LCH 

CIE-L*ch color space. L in [0, 100]. C in [0, 100]. H in [0, 360].

NONE 

Used when the color channels don't have an assocaited color space.

Definition at line 612 of file MRcolorTpl.hpp.

◆ cmfInterpolationEnum

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
enum class mjr::colorTpl::cmfInterpolationEnum
strong

Interpolation methods for emperical color matching functions.

Enumerator
FLOOR 

closest lower

CEILING 

closest upper

NEAREST 

closest

LINEAR 

linear interpolation

BUMP 

exponential bump map interpolation

Definition at line 621 of file MRcolorTpl.hpp.

Constructor & Destructor Documentation

◆ colorTpl() [1/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( )
inline

The no arg constructor is a noop so we don't needlessly initialize millions of pixels – compiler warnings are expected.

Definition at line 635 of file MRcolorTpl.hpp.

◆ colorTpl() [2/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( const colorType & aColor)
inline

◆ colorTpl() [3/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( std::initializer_list< clrChanT > cVals)
inline

Initializer list.

Unspecified channels are set ot minChanVal, and extra channel values are ignored.

Definition at line 648 of file MRcolorTpl.hpp.

◆ colorTpl() [4/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( clrChanT r,
clrChanT g,
clrChanT b,
clrChanT a )
inline

Definition at line 665 of file MRcolorTpl.hpp.

◆ colorTpl() [5/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( clrChanT r,
clrChanT g,
clrChanT b )
inline

Definition at line 670 of file MRcolorTpl.hpp.

◆ colorTpl() [6/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( clrChanT cVal)
inline

Uses setChans() to set all channels to the given value.

Parameters
cValThe value to set the channels to

Definition at line 684 of file MRcolorTpl.hpp.

◆ colorTpl() [7/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( cornerColorEnum cornerColor)
inline

Uses the setToCorner() method to set the initialize the object.

Note that no constructor exists taking a character to provide to setToCorner(). Why? Because character literals are integers in C++, and they might be the same as clrChanT – rendering ambiguous overload cases.

Definition at line 689 of file MRcolorTpl.hpp.

◆ colorTpl() [8/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( std::string colorString)
inline

Uses the setColorFromString() method to set the initialize the object.

Definition at line 692 of file MRcolorTpl.hpp.

◆ colorTpl() [9/9]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl ( const char * colorCString)
inline

Uses the setColorFromString() method to set the initialize the object.

Definition at line 695 of file MRcolorTpl.hpp.

◆ ~colorTpl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::~colorTpl ( )
inline

The destructor for this class is a no-op.

Definition at line 702 of file MRcolorTpl.hpp.

Member Function Documentation

◆ hslHelperVal()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::hslHelperVal ( double n1,
double n2,
double hue )
inlineprivate

This is a helper function for setRGBfromColorSpace.

Definition at line 382 of file MRcolorTpl.hpp.

◆ setChansToMean()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
void mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansToMean ( )
inlineprivate

Set all channels to meanChanVal.

Definition at line 395 of file MRcolorTpl.hpp.

◆ setChansToMin()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
void mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansToMin ( )
inlineprivate

Set all channels to minChanVal.

Definition at line 398 of file MRcolorTpl.hpp.

◆ setChansToMax()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
void mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansToMax ( )
inlineprivate

Set all channels to maxChanVal.

Definition at line 406 of file MRcolorTpl.hpp.

◆ setColorFromString()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setColorFromString ( std::string colorString)
inlineprivate

Sets the current color based upon the contents of the given std::string.

This is the guts of the magic constructor taking a string. If colorString starts with a "#", then setChans() will be used. Otherwise setToCorner() will be used

Definition at line 416 of file MRcolorTpl.hpp.

◆ convertByteToChan() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertByteToChan ( uint8_t cVal) const
inlineprivate

Convert a uint8_t to a clrChanT (for integral clrChanT)

Definition at line 435 of file MRcolorTpl.hpp.

◆ convertByteToChan() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertByteToChan ( uint8_t cVal) const
inlineprivate

Convert a uint8_t to a clrChanT (for floating point clrChanT)

Definition at line 443 of file MRcolorTpl.hpp.

◆ convertHexStringToChan() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertHexStringToChan ( std::string hexString) const
inlineprivate

Convert hex CString to clrChanT (for integral clrChanT)

Definition at line 448 of file MRcolorTpl.hpp.

◆ convertHexStringToChan() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertHexStringToChan ( std::string hexString) const
inlineprivate

Convert hex CString to clrChanT (for floating point clrChanT)

Definition at line 456 of file MRcolorTpl.hpp.

◆ convertChanToByte() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertChanToByte ( clrChanT cVal) const
inlineprivate

Convert a clrChanT to a uint8_t (for floating point clrChanT)

Definition at line 464 of file MRcolorTpl.hpp.

◆ convertChanToByte() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertChanToByte ( clrChanT cVal) const
inlineprivate

Convert a clrChanT to a uint8_t (for integral clrChanT)

Definition at line 469 of file MRcolorTpl.hpp.

◆ convertDoubleToChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertDoubleToChan ( double cVal) const
inlineprivate

Convert a double to a clrChanT.

Definition at line 479 of file MRcolorTpl.hpp.

◆ convertChanToDouble()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::convertChanToDouble ( clrChanT cVal) const
inlineprivate

Convert a clrChanT to a double.

Definition at line 488 of file MRcolorTpl.hpp.

◆ getMaskNC()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
maskType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getMaskNC ( ) const
inlineprivate

Return the mask value.

Definition at line 496 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl().

Here is the caller graph for this function:

◆ setMaskNC()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
void mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setMaskNC ( maskType aMask)
inlineprivate

Set the mask value.

Definition at line 508 of file MRcolorTpl.hpp.

◆ copy()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::copy ( colorArgType aCol)
inline

Copy the contents of the given color object into the current object.

When sizeof(colorTpl)<=sizeof(maskType), this function consists of a single assignment statement. Otherwise it is O(numChan).

Returns
Returns a reference to the current color object.

Definition at line 711 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csWS_tpl< colors >::c().

Here is the caller graph for this function:

◆ getRed()

◆ getBlue()

◆ getGreen()

◆ getAlpha()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getAlpha ( ) const
inline

◆ getRed_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getRed_dbl ( ) const
inline

Definition at line 733 of file MRcolorTpl.hpp.

◆ getGreen_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getGreen_dbl ( ) const
inline

Definition at line 734 of file MRcolorTpl.hpp.

◆ getBlue_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getBlue_dbl ( ) const
inline

Definition at line 735 of file MRcolorTpl.hpp.

◆ getAlpha_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getAlpha_dbl ( ) const
inline

Definition at line 736 of file MRcolorTpl.hpp.

◆ getRed_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getRed_byte ( ) const
inline

Definition at line 738 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csWS_tpl< colors >::c().

Here is the caller graph for this function:

◆ getGreen_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getGreen_byte ( ) const
inline

Definition at line 739 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csWS_tpl< colors >::c().

Here is the caller graph for this function:

◆ getBlue_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getBlue_byte ( ) const
inline

Definition at line 740 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csWS_tpl< colors >::c().

Here is the caller graph for this function:

◆ getAlpha_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getAlpha_byte ( ) const
inline

Definition at line 741 of file MRcolorTpl.hpp.

◆ getC0()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC0 ( ) const
inline

◆ getC1()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC1 ( ) const
inline

◆ getC2()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC2 ( ) const
inline

◆ getC3()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC3 ( ) const
inline

Definition at line 746 of file MRcolorTpl.hpp.

◆ getC0_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC0_dbl ( ) const
inline

Definition at line 748 of file MRcolorTpl.hpp.

◆ getC1_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC1_dbl ( ) const
inline

Definition at line 749 of file MRcolorTpl.hpp.

◆ getC2_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC2_dbl ( ) const
inline

Definition at line 750 of file MRcolorTpl.hpp.

◆ getC3_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC3_dbl ( ) const
inline

Definition at line 751 of file MRcolorTpl.hpp.

◆ getC0_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC0_byte ( ) const
inline

Definition at line 753 of file MRcolorTpl.hpp.

◆ getC1_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC1_byte ( ) const
inline

Definition at line 754 of file MRcolorTpl.hpp.

◆ getC2_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC2_byte ( ) const
inline

Definition at line 755 of file MRcolorTpl.hpp.

◆ getC3_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC3_byte ( ) const
inline

Definition at line 756 of file MRcolorTpl.hpp.

◆ getChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChan ( int chan) const
inline

◆ getChan_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChan_dbl ( int chan) const
inline

Definition at line 773 of file MRcolorTpl.hpp.

◆ getChan_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
uint8_t mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChan_byte ( int chan) const
inline

Definition at line 780 of file MRcolorTpl.hpp.

◆ setC0()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC0 ( clrChanT cVal)
inline

Definition at line 799 of file MRcolorTpl.hpp.

◆ setC1()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC1 ( clrChanT cVal)
inline

Definition at line 800 of file MRcolorTpl.hpp.

◆ setC2()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC2 ( clrChanT cVal)
inline

Definition at line 801 of file MRcolorTpl.hpp.

◆ setC3()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC3 ( clrChanT cVal)
inline

Definition at line 802 of file MRcolorTpl.hpp.

◆ setC0_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC0_dbl ( double cVal)
inline

Definition at line 804 of file MRcolorTpl.hpp.

◆ setC1_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC1_dbl ( double cVal)
inline

Definition at line 805 of file MRcolorTpl.hpp.

◆ setC2_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC2_dbl ( double cVal)
inline

Definition at line 806 of file MRcolorTpl.hpp.

◆ setC3_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC3_dbl ( double cVal)
inline

Definition at line 807 of file MRcolorTpl.hpp.

◆ setC0_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC0_byte ( uint8_t cVal)
inline

Definition at line 809 of file MRcolorTpl.hpp.

◆ setC1_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC1_byte ( uint8_t cVal)
inline

Definition at line 810 of file MRcolorTpl.hpp.

◆ setC2_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC2_byte ( uint8_t cVal)
inline

Definition at line 811 of file MRcolorTpl.hpp.

◆ setC3_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setC3_byte ( uint8_t cVal)
inline

Definition at line 812 of file MRcolorTpl.hpp.

◆ setRed()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRed ( clrChanT cVal)
inline

Definition at line 814 of file MRcolorTpl.hpp.

◆ setBlue()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setBlue ( clrChanT cVal)
inline

Definition at line 815 of file MRcolorTpl.hpp.

◆ setGreen()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setGreen ( clrChanT cVal)
inline

Definition at line 816 of file MRcolorTpl.hpp.

◆ setAlpha()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setAlpha ( clrChanT cVal)
inline

Definition at line 817 of file MRcolorTpl.hpp.

◆ setRed_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRed_dbl ( double cVal)
inline

Definition at line 819 of file MRcolorTpl.hpp.

◆ setGreen_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setGreen_dbl ( double cVal)
inline

Definition at line 820 of file MRcolorTpl.hpp.

◆ setBlue_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setBlue_dbl ( double cVal)
inline

Definition at line 821 of file MRcolorTpl.hpp.

◆ setAlpha_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setAlpha_dbl ( double cVal)
inline

Definition at line 822 of file MRcolorTpl.hpp.

◆ setRed_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRed_byte ( uint8_t cVal)
inline

Definition at line 824 of file MRcolorTpl.hpp.

◆ setGreen_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setGreen_byte ( uint8_t cVal)
inline

Definition at line 825 of file MRcolorTpl.hpp.

◆ setBlue_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setBlue_byte ( uint8_t cVal)
inline

Definition at line 826 of file MRcolorTpl.hpp.

◆ setAlpha_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setAlpha_byte ( uint8_t cVal)
inline

Definition at line 827 of file MRcolorTpl.hpp.

◆ setChansRGBA() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGBA ( clrChanT r,
clrChanT g,
clrChanT b,
clrChanT a )
inline

Definition at line 829 of file MRcolorTpl.hpp.

◆ setChansRGB() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGB ( clrChanT r,
clrChanT g,
clrChanT b )
inline

Definition at line 830 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csHSLh_tpl< corner >::c().

Here is the caller graph for this function:

◆ setChansRGBA_dbl() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGBA_dbl ( double r,
double g,
double b,
double a )
inline

Definition at line 832 of file MRcolorTpl.hpp.

◆ setChansRGB_dbl() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGB_dbl ( double r,
double g,
double b )
inline

◆ setChansRGBA_byte() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGBA_byte ( uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a )
inline

Definition at line 835 of file MRcolorTpl.hpp.

◆ setChansRGB_byte() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGB_byte ( uint8_t r,
uint8_t g,
uint8_t b )
inline

Definition at line 836 of file MRcolorTpl.hpp.

◆ setChansRGBA() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGBA ( clrChanTup4 chanValues)
inline

Definition at line 838 of file MRcolorTpl.hpp.

◆ setChansRGB() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGB ( clrChanTup3 chanValues)
inline

Definition at line 839 of file MRcolorTpl.hpp.

◆ setChans_dbl() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans_dbl ( colConALLdbl dblColor)
inline

Definition at line 846 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChanNC().

Here is the call graph for this function:

◆ setChans_byte() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans_byte ( colConALLbyte byteColor)
inline

Definition at line 847 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChanNC().

Here is the call graph for this function:

◆ setChansRGBA_dbl() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGBA_dbl ( colConRGBAdbl dblColor)
inline

◆ setChansRGB_dbl() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGB_dbl ( colConRGBdbl dblColor)
inline

◆ setChansRGBA_byte() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGBA_byte ( colConRGBAbyte byteColor)
inline

◆ setChansRGB_byte() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChansRGB_byte ( colConRGBbyte byteColor)
inline

◆ getColCon_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConALLdbl mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getColCon_dbl ( )
inline

Definition at line 853 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChanNC().

Here is the call graph for this function:

◆ getColCon_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConALLbyte mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getColCon_byte ( )
inline

Definition at line 854 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChanNC().

Here is the call graph for this function:

◆ getColConRGBA_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConRGBAdbl mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getColConRGBA_dbl ( )
inline

Definition at line 855 of file MRcolorTpl.hpp.

◆ getColConRGB_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConRGBdbl mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getColConRGB_dbl ( )
inline

Definition at line 856 of file MRcolorTpl.hpp.

◆ getColConRGBA_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConRGBAbyte mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getColConRGBA_byte ( )
inline

Definition at line 857 of file MRcolorTpl.hpp.

◆ getColConRGB_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConRGBbyte mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getColConRGB_byte ( )
inline

Definition at line 858 of file MRcolorTpl.hpp.

◆ bestRedChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::bestRedChan ( )
inline

Definition at line 866 of file MRcolorTpl.hpp.

◆ bestGreenChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::bestGreenChan ( )
inline

Definition at line 874 of file MRcolorTpl.hpp.

◆ bestBlueChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::bestBlueChan ( )
inline

Definition at line 884 of file MRcolorTpl.hpp.

◆ bestAlphaChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::bestAlphaChan ( )
inline

Definition at line 896 of file MRcolorTpl.hpp.

◆ setChanToMax()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChanToMax ( int chan)
inline

Definition at line 913 of file MRcolorTpl.hpp.

◆ setChanToMin()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChanToMin ( int chan)
inline

Definition at line 919 of file MRcolorTpl.hpp.

◆ setChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChan ( int chan,
clrChanT cVal )
inline

Definition at line 925 of file MRcolorTpl.hpp.

◆ setChan_dbl()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChan_dbl ( int chan,
double cVal )
inline

Definition at line 931 of file MRcolorTpl.hpp.

◆ setChan_byte()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChan_byte ( int chan,
uint8_t cVal )
inline

Definition at line 936 of file MRcolorTpl.hpp.

◆ setChanNC()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChanNC ( int chan,
clrChanT cVal )
inline

◆ getChanNC()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChanNC ( int chan) const
inline

◆ setChans() [1/5]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans ( clrChanT cVal)
inline

Definition at line 971 of file MRcolorTpl.hpp.

◆ setChans_dbl() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans_dbl ( double cVal)
inline

Definition at line 977 of file MRcolorTpl.hpp.

◆ setChans_byte() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans_byte ( uint8_t cVal)
inline

Definition at line 978 of file MRcolorTpl.hpp.

◆ setChans() [2/5]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans ( clrChanTup4 chanValues)
inline

Sets the first four channels current object.

Parameters
chanValuesThe values for the components
Returns
Returns a reference to the current color object.

Definition at line 988 of file MRcolorTpl.hpp.

◆ setChans() [3/5]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans ( clrChanTup3 chanValues)
inline

Sets the first three channels current object.

Parameters
chanValuesThe values for the components
Returns
Returns a reference to the current color object.

Definition at line 998 of file MRcolorTpl.hpp.

◆ setChans() [4/5]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans ( clrChanVec & chanValues)
inline

This function sets color channels from the data in a std::vector.

Warning
input vector must have at least channelCount elements! This is not checked!
Parameters
chanValuesA std::vector containing the color channels.
Returns
Returns a reference to the current color object.

Definition at line 1009 of file MRcolorTpl.hpp.

◆ setChans() [5/5]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setChans ( std::string colorHexString,
bool clearUndefinedChannels = false )
inline

Sets the current color based upon the contents of the given color hex string.

A color hex string is similar to the hash hex strings used in HTML, but extended to larger depths and higher channel counts.

      #FF0000       -- Red for an RGB color with 8-bit per channels
      #FFFF00000000 -- Red for an RGB color with 16-bit per channels
      #FF0000EE     -- Red for an RGBA color with 8-bit per channels  (with alpha set to EE)
      #FFFFFFFFFF   -- White for a 5 channel color with 8-bit per channels

Fewer channel specifiers may be provided than channels in the current color, then the value of clearUndefinedChannels defines the behavior: NOOP or set them to minChanVal. If the colorHexString is somehow invalid, then all channels are considered undefined, and the action is defined by the value of clearUndefinedChannels.

Parameters
colorHexStringHex string specifying a color.
clearUndefinedChannelsSpecify error action and what to do with unspecified channels.
Returns
Returns a reference to the current color object.

Definition at line 1028 of file MRcolorTpl.hpp.

◆ setToBlack()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToBlack ( )
inline

Definition at line 1070 of file MRcolorTpl.hpp.

◆ setToWhite()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToWhite ( )
inline

Definition at line 1071 of file MRcolorTpl.hpp.

◆ setToRed()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToRed ( )
inline

Definition at line 1072 of file MRcolorTpl.hpp.

◆ setToBlue()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToBlue ( )
inline

Definition at line 1073 of file MRcolorTpl.hpp.

◆ setToGreen()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToGreen ( )
inline

Definition at line 1074 of file MRcolorTpl.hpp.

◆ setToCyan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToCyan ( )
inline

Definition at line 1075 of file MRcolorTpl.hpp.

◆ setToYellow()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToYellow ( )
inline

Definition at line 1076 of file MRcolorTpl.hpp.

◆ setToMagenta()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToMagenta ( )
inline

Definition at line 1077 of file MRcolorTpl.hpp.

◆ setToHalf()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToHalf ( )
inline

Definition at line 1078 of file MRcolorTpl.hpp.

◆ setToCorner() [1/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToCorner ( char cornerColor)
inline

Set the current color based upon the single character given – 0==black, R, G, B, M, C, Y, W/1==white).

The color is acutally set using one of the setTo*() functions. If cornerColor is invalid, then setToBlack().

Parameters
cornerColorCharacter specifying the color
Returns
Returns a reference to the current color object.

Definition at line 1084 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csBin_tpl< a, b >::c(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpRGBcornerCGradiant(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpRGBcornerDGradiant().

Here is the caller graph for this function:

◆ setToCorner() [2/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToCorner ( cornerColorEnum cornerColor)
inline

Set the color to the given corner color.

The color is acutally set using one of the setTo*() functions. If cornerColor is invalid, then setToBlack().

Parameters
cornerColorEnum value specifying the color
Returns
Returns a reference to the current color object.

Definition at line 1111 of file MRcolorTpl.hpp.

◆ setToCorner() [3/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToCorner ( std::string cornerColor)
inline

Set the color to the named corner color.

If cornerColor is one character long, then the call is equivalent to setToCorner(cornerColor[0]). Otherwise a valid corner color name string is expected: red, blue, green, cyan, yellow, magenta, black, or white. If cornerColor is invalid, then setToBlack(). The color is actually set using one of the setTo*() functions.

Parameters
cornerColorString value specifying the color
Returns
Returns a reference to the current color object.

Definition at line 1133 of file MRcolorTpl.hpp.

◆ setRGBAfromLogPackIntGen()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromLogPackIntGen ( packed4Cint anInt,
uint8_t rIdx,
uint8_t gIdx,
uint8_t bIdx,
uint8_t aIdx )
inline

Set the color based upon the bytes of the given integer ordered from LSB to MSB.

The *Idx arguments select which byte of the int is used for each channel – with LSB equal to index 0 and MSB equal to index 3. The extracted bytes are interpreted as by setChans_byte. Any channels beyond four are left untouched.

Parameters
anIntThe integer from which to extract bytes to set color
rIdxLocation of red byte in anInt
gIdxLocation of green byte in anInt
bIdxLocation of blue byte in anInt
aIdxLocation of alpha byte in anInt
Returns
Returns a reference to the current color object.

Definition at line 1165 of file MRcolorTpl.hpp.

◆ setRGBfromLogPackIntGen()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntGen ( packed4Cint anInt,
uint8_t rIdx,
uint8_t gIdx,
uint8_t bIdx )
inline

Just like setRGBAfromLogPackIntGen, but no A.

Definition at line 1180 of file MRcolorTpl.hpp.

◆ setRGBAfromLogPackIntARGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromLogPackIntARGB ( packed4Cint anInt)
inline

Definition at line 1195 of file MRcolorTpl.hpp.

◆ setRGBfromLogPackIntARGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntARGB ( packed4Cint anInt)
inline

◆ setRGBAfromLogPackIntRGBA()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromLogPackIntRGBA ( packed4Cint anInt)
inline

Definition at line 1197 of file MRcolorTpl.hpp.

◆ setRGBfromLogPackIntRGBA()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntRGBA ( packed4Cint anInt)
inline

Definition at line 1198 of file MRcolorTpl.hpp.

◆ setRGBAfromLogPackIntABGR()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromLogPackIntABGR ( packed4Cint anInt)
inline

Definition at line 1199 of file MRcolorTpl.hpp.

◆ setRGBfromLogPackIntABGR()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntABGR ( packed4Cint anInt)
inline

Definition at line 1200 of file MRcolorTpl.hpp.

◆ setRGBAfromLogPackIntBGRA()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromLogPackIntBGRA ( packed4Cint anInt)
inline

Definition at line 1201 of file MRcolorTpl.hpp.

◆ setRGBfromLogPackIntBGRA()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntBGRA ( packed4Cint anInt)
inline

Definition at line 1202 of file MRcolorTpl.hpp.

◆ setRGBAfromLogPackIntABRG()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromLogPackIntABRG ( packed4Cint anInt)
inline

Definition at line 1204 of file MRcolorTpl.hpp.

◆ setRGBfromLogPackIntABRG()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntABRG ( packed4Cint anInt)
inline

Definition at line 1205 of file MRcolorTpl.hpp.

◆ setRGBcmpGreyTGA16bit()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBcmpGreyTGA16bit ( uint32_t tga16val)
inline

Computes a 24-bit truecolor value intended for use in producing 16-bit greyscale TGA.

This is the color scheme that should be used for POVray 16-bit height files

Parameters
tga16valAn integer
Returns
Returns a reference to the current color object.

Definition at line 1216 of file MRcolorTpl.hpp.

◆ setRGBcmpGreyTGA24bit()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBcmpGreyTGA24bit ( uint32_t tga24val)
inline

Computes a 24-bit truecolor value intended for use in producing 24-bit greyscale TGA.

Parameters
tga24valAn integer
Returns
Returns a reference to the current color object.

Definition at line 1229 of file MRcolorTpl.hpp.

◆ setRGBAfromPackIntGen()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBAfromPackIntGen ( packed4Cint anInt,
uint8_t rIdx,
uint8_t gIdx,
uint8_t bIdx,
uint8_t aIdx )
inline

Set the color based upon the bytes of the given integer ordered as in RAM.

The *Idx arguments select which byte of the int is used for each channel – with byte[0] being the first in RAM. The extracted bytes are interpreted as by setChans_byte. Any channels beyond four are left untouched.

Parameters
anIntThe integer from which to extract bytes to set color
rIdxLocation of red byte in anInt
gIdxLocation of green byte in anInt
bIdxLocation of blue byte in anInt
aIdxLocation of alpha byte in anInt
Returns
Returns a reference to the current color object.

Definition at line 1254 of file MRcolorTpl.hpp.

◆ setRGBfromPackIntGen()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromPackIntGen ( packed4Cint anInt,
uint8_t rIdx,
uint8_t gIdx,
uint8_t bIdx )
inline

Just like setRGBAfromPackIntGen, but no A.

Definition at line 1265 of file MRcolorTpl.hpp.

◆ setRGBfromUnitHSV()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromUnitHSV ( double H,
double S,
double V )
inline

Set the color indicated by the given HSV values.

The 'unit' in the name indicates that the values for h, s, and v are the unit interval, [0,1].

Parameters
HThe Hue.
SThe Saturation.
VThe Value
Returns
Returns a reference to the current color object.

Definition at line 1289 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cs2dThaller_tpl< useHSL, maxV, cutDepth, argCuts, absCuts, logAbs >::c().

Here is the caller graph for this function:

◆ setRGBfromUnitHSL()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromUnitHSL ( double H,
double S,
double L )
inline

Set the color indicated by the given HSL values.

The 'unit' in the name indicates that The ranges for h, s, and v are the the unit interval – i.e. [0,1].

Parameters
HThe Hue.
SThe Saturation.
LThe Lightness or Luminescence
Returns
Returns a reference to the current color object.

Definition at line 1297 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cs2dThaller_tpl< useHSL, maxV, cutDepth, argCuts, absCuts, logAbs >::c().

Here is the caller graph for this function:

◆ setRGBfromColorSpace() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromColorSpace ( colorSpaceEnum space,
double inCh1,
double inCh2,
double inCh3 )
inline

Set the color indicated by the color space and values.

Parameters
spaceThe colorspace
inCh1Channel one value for given colorspace
inCh2Channel two value for given colorspace
inCh3Channel three value for given colorspace
Returns
Returns a reference to the current color object.

Definition at line 1305 of file MRcolorTpl.hpp.

◆ setRGBfromColorSpace() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromColorSpace ( colorSpaceEnum space,
colConDbl3 inColor )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1384 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC0(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC1(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC2().

Here is the call graph for this function:

◆ setRGBfromWavelengthCM()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromWavelengthCM ( double wavelength,
cmfInterpolationEnum interpMethod = cmfInterpolationEnum::LINEAR )
inline

Set the color indicated by the given wavelength.

This function uses an algorithm based upon the color matching functions as tabulated in table 3 from Stockman and Sharpe (2000) – I believe they are taken from Stiles and Burch 10-degree (1959). Four of the algorithms are based upon simple linear interpolation, while one is based upon exponential bump functions closely matching the color matching functions. The method of interpolation may be specified via the final argument.

Warning
If you are looking for a wavelength color scheme, then see the csRainbowCM class: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
wavelengthThe wavelength to convert into RGB
interpMethodSpecify the interpolation method (see: cmfInterpolationEnum)
Returns
Returns a reference to the current color object.

Definition at line 1405 of file MRcolorTpl.hpp.

◆ setRGBfromWavelengthLA()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromWavelengthLA ( double wavelength)
inline

Set the color indicated by the given wavelength.

This function uses an algorithm based upon linear approximations to the color match functions. I believe the original algorithm is due to Dan Bruton, and his FORTRAN version is available (at least as of 1997) at http://www.physics.sfasu.edu/astro/color.html

Warning
If you are looking for a wavelength color scheme, then see the csRainbowLA class: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
wavelengthto convert
Returns
Returns a reference to the current color object.

Definition at line 1524 of file MRcolorTpl.hpp.

◆ cmpGradiant() [1/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpGradiant ( csFltType csX,
std::vector< csFltType > const & anchors,
std::vector< colorType > const & colors )
inline

Convert a double to a color value based upon a color ramp passing through the given sequence of corner colors at the given anchor points.

The value of this function at aDouble equal to anchor[i] will be colors[i]. This is an extremely general function that is capable of replicating many of the more precise color ramp sequence functions in this library. The only defects are the lack of bit level precision and the poor performance – both due to the use of floating point arithmetic. Note this function operates correctly with any channel type and with an arbitrary number of channels – it is NOT limited to RGB colors or RGB color corners for anchors.

Warning
In many cases it is better to use csFP_tpl, csCC_tpl, or csHSLh_tpl to define a continuous gradient color scheme than to use this function directly. In fact, the first step might be to see if a suitable gradient color scheme is already are predefined: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
csXThe value to convert
anchorsDoubles for which color equals the corresponding corner.
colorsA vector of colors to use
Returns
A reference to this object

Definition at line 1597 of file MRcolorTpl.hpp.

◆ cmpGradiant() [2/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpGradiant ( csFltType csX,
std::vector< colorType > const & colors )
inline

Identical to the other cmpGradiant() function except that equidistant anchors are automatically generated on [0, 1] for the given colors array.

Definition at line 1612 of file MRcolorTpl.hpp.

◆ cmpGradiant() [3/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpGradiant ( csFltType csX,
csIntType numColors,
const packed4Cint * colors )
inline

Identical to the other equidistant cmpGradiant() function except that this one works on just the RGB channels and takes an array of packed integers.

Definition at line 1627 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setRGBfromLogPackIntARGB().

Here is the call graph for this function:

◆ cmpRGBcornerCGradiant() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpRGBcornerCGradiant ( csFltType csX,
const char * cornerColors )
inline

This is simply a version of cmpRGBcornerCGradiant() that computes the length of the final argument as a C-string.

Unlike the version of cmpRGBcornerDGradiant() specifying numColors, this one requires the final argument to be a real C-string – i.e. it must have a terminating NULL. Note this function uses RGB corner colors as anchors, and is thus designed to work with RGB colors.

Warning
Many gradient color schemes are predefined: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
csXThe value to convert
cornerColorsCharacters specifying color (as used by setColor)
Returns
A reference to this object

Definition at line 1653 of file MRcolorTpl.hpp.

◆ cmpRGBcornerDGradiant() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpRGBcornerDGradiant ( csIntType csIdx,
const char * cornerColors )
inline

This is simply a version of cmpRGBcornerDGradiant() that computes the length of the final argument as a C-string.

Unlike the version of cmpRGBcornerDGradiant() specifying numColors, this one requires the final argument to be a real C-string – i.e. it must have a terminating NULL. Note this function uses RGB corner colors as anchors, and is thus designed to work with RGB colors.

Warning
Many gradient color schemes are predefined: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
csIdxThe value to convert
cornerColorsCharacters specifying color (as used by setColor)
Returns
A reference to this object

Definition at line 1666 of file MRcolorTpl.hpp.

◆ cmpRGBcornerDGradiant() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<typename ccT >
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpRGBcornerDGradiant ( csIntType csIdx,
csIntType numColors,
const ccT * cornerColors )
inline

Color value based upon a color ramp passing through the given sequence of corner colors at equal intervals along [0, (mjr::colorTpl::chanStepMax * (numColors - 1) + 1)].

At 0, the color will be the first specified color. At (mjr::colorTpl::chanStepMax * ( numColors - 1) + 1) it will be the last color specified color. This function uses precise integer arithmetic. cornerColors need not be a real C-string – i.e. no need for an terminating NULL. Note this function uses RGB corner colors as anchors, and is thus designed to work with RGB colors.

Warning
Many gradient color schemes are predefined: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
csIdxThe value to convert
numColorsThe number of colors
cornerColorsAn array of things that can be passed to setToCorner() – usually char or cornerColorEnum
Returns
A reference to this object

Definition at line 1682 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChan(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToCorner().

Here is the call graph for this function:

◆ cmpRGBcornerCGradiant() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<typename ccT >
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::cmpRGBcornerCGradiant ( csFltType csX,
csIntType numColors,
const ccT * cornerColors )
inline

Color value based upon a color ramp passing through the given sequence of corner colors at equal intervals along [0.0, 1.0].

At 0, the color will be the first specified color. At 1.0 it will be the last color specified color. CornerColors need not be a real C-string – i.e. no need for an terminating NULL. Note this function uses RGB corner colors as anchors, and is thus designed to work with RGB colors.

Warning
Many gradient color schemes are predefined: http://richmit.github.io/mraster/ColorSchemes.html
Parameters
csXThe value to convert
numColorsThe number of colors
cornerColorsAn array of things that can be passed to setToCorner() – usually char or cornerColorEnum
Returns
A reference to this object

Definition at line 1723 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::setToCorner().

Here is the call graph for this function:

◆ interplColorSpace()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::interplColorSpace ( colorSpaceEnum space,
double aDouble,
colorArgType col1,
colorArgType col2 )
inline

Set the current color to a value linearly interpolated between the two given colors.

When aDouble is 0, the color is col1. When aDouble is 1 the new value is col2. The interpolation is done in HSL space – i.e. the given colors are converted to HSL, the interpolation is done, and the result is converted back to RGB and the current color is set. Unlike linearInterpolate, this function will NOT interpolate every channel. Rather, as this function deals specifically with RGB and HSL space, only the RGB channels will be interpolated.

Parameters
spaceThe color space to use
aDoubleThe distance from col1
col1The starting color
col2The ending color
Returns
Returns a reference to the current color object.

Definition at line 1751 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC0(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC1(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC2(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::rgb2colorSpace().

Here is the call graph for this function:

◆ channelArithFlt2clrChan()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::channelArithFlt2clrChan ( channelArithFltType flt)
inline

Convert a channelArithFltType value into a clrChanT value.

This function works hard to return the nearest clrChanT value to a channelArithFltType value, but it is quite slow.

Parameters
fltValue to convert

Definition at line 1783 of file MRcolorTpl.hpp.

◆ wMean() [1/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::wMean ( channelArithFltType w1,
channelArithFltType w2,
channelArithFltType w3,
channelArithFltType w4,
colorArgType col1,
colorArgType col2,
colorArgType col3,
colorArgType col4 )
inline

Compute the weighted mean of the given colors.

Warning
In order to keep the result in range, w1,w2,w3,s4 must be in [0,1] and w1+w2+w3_w5=1. See uMean() for a way to do that automatically.
Floating point arithmetic results vary with hardware, compiler, and even compiler options. These small differences can have an impact on casts from floating point values to integers when the floating point result is near an whole number. For example, suppose we have a floating point computation for which the "theoretical" value is exactly 5. If that computation results in 4.999999, then the a cast will result in 4. OTOH if the computation resulted in 5.000001, then the cast results in 5. In short we expect the result of this function to vary by as much as 1. Yes we could "do it right", but this function is intended to be fast. We are more than happy to have a little slop in the results in exchange for speed.
Parameters
w1The first weight
w2The second weight
w3The third weight
w4The fourth weight
col1The first color
col2The second color
col3The third color
col4The fourth color
Returns
Returns a reference to the current color object.

Definition at line 1806 of file MRcolorTpl.hpp.

◆ wMean() [2/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::wMean ( channelArithFltType w1,
channelArithFltType w2,
channelArithFltType w3,
colorArgType col1,
colorArgType col2,
colorArgType col3 )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1818 of file MRcolorTpl.hpp.

◆ wMean() [3/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::wMean ( channelArithFltType w1,
channelArithFltType w2,
colorArgType col1,
colorArgType col2 )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1829 of file MRcolorTpl.hpp.

◆ uMean() [1/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::uMean ( channelArithFltType w1,
channelArithFltType w2,
channelArithFltType w3,
colorArgType col1,
colorArgType col2,
colorArgType col3,
colorArgType col4 )
inline

Compute the unit weighted mean of the given colors – like wMean(), but last weight is computed such that weights sum to 1.0.

Parameters
w1The first weight in the range [0, 1) – the range not checked!
w2The second weight in the range [0, 1) – the range not checked!
w3The third weight in the range [0, 1) – the range not checked!
col1The first color
col2The second color
col3The third color
col4The fourth color
Returns
Returns a reference to the current color object.

Definition at line 1845 of file MRcolorTpl.hpp.

◆ uMean() [2/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::uMean ( channelArithFltType w1,
channelArithFltType w2,
colorArgType col1,
colorArgType col2,
colorArgType col3 )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1851 of file MRcolorTpl.hpp.

◆ uMean() [3/3]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::uMean ( channelArithFltType w1,
colorArgType col1,
colorArgType col2 )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 1856 of file MRcolorTpl.hpp.

◆ linearInterpolate()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::linearInterpolate ( double aDouble,
colorArgType col1,
colorArgType col2 )
inline

Set the current color to a value linearly interpolated between the two given colors.

When aDouble is 0, the color is col1. When aDouble is 1 the new value is col2. This method interpolates all channels without any color space conversions and as few type conversions as possible.

Parameters
aDoubleThe distance from col1
col1The starting color
col2The ending color
Returns
Returns a reference to the current color object.

Definition at line 1867 of file MRcolorTpl.hpp.

◆ linearInterpolateRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::linearInterpolateRGB ( double aDouble,
colorArgType col1,
colorArgType col2 )
inline

Set the RGB channels of the current color to a value linearly interpolated between the two given colors.

When aDouble is 0, the color is col1. When aDouble is 1 the new value is col2. This method interpolates all channels without any color space conversions and as few type conversions as possible.

Parameters
aDoubleThe distance from col1
col1The starting color
col2The ending color
Returns
Returns a reference to the current color object.

Definition at line 1881 of file MRcolorTpl.hpp.

◆ tfrmOr() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmOr ( colorArgType aCol)
inline

Performs a logical OR with the current object and the given object and places the value in the current object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 1896 of file MRcolorTpl.hpp.

◆ tfrmOr() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmOr ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 1907 of file MRcolorTpl.hpp.

◆ tfrmNor() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNor ( colorArgType aCol)
inline

Performs a logical NOR with the current object and the given object and places the value in the current object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 1921 of file MRcolorTpl.hpp.

◆ tfrmNor() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNor ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 1932 of file MRcolorTpl.hpp.

◆ tfrmAnd() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAnd ( colorArgType aCol)
inline

Performs a logical AND with the current object and the given object and places the value in the current object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 1945 of file MRcolorTpl.hpp.

◆ tfrmAnd() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAnd ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 1956 of file MRcolorTpl.hpp.

◆ tfrmNand() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNand ( colorArgType aCol)
inline

Performs a logical NAND with the current object and the given object and places the value in the current object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 1969 of file MRcolorTpl.hpp.

◆ tfrmNand() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNand ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 1980 of file MRcolorTpl.hpp.

◆ tfrmXor() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmXor ( colorArgType aCol)
inline

Performs a logical EXCLUSIVE OR (XOR) with the current object and the given object and places the value in the current object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 1993 of file MRcolorTpl.hpp.

◆ tfrmXor() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmXor ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2004 of file MRcolorTpl.hpp.

◆ tfrmNxor() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNxor ( colorArgType aCol)
inline

Performs a logical NOT EXCLUSIVE OR (NXOR) with the current object and the given object and places the value in the current object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2017 of file MRcolorTpl.hpp.

◆ tfrmNxor() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNxor ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2028 of file MRcolorTpl.hpp.

◆ tfrmNot() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNot ( void )
inline

Performs logical (bit-wise) negation of current object.

Returns
Returns a reference to the current color object.

Definition at line 2040 of file MRcolorTpl.hpp.

◆ tfrmNot() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNot ( void )
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2051 of file MRcolorTpl.hpp.

◆ tfrmSqDiff()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmSqDiff ( colorArgType aCol)
inline

Computes the square of the difference for each channel between the given color and the current color object.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2069 of file MRcolorTpl.hpp.

◆ tfrmAbsDiff()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAbsDiff ( colorArgType aCol)
inline

Computes the absolute value of the difference for each channel between the given color and the current color object.

Parameters
aColThe color to use in the computation.
Returns
Returns the absolute value of the difference for each channel.

Definition at line 2079 of file MRcolorTpl.hpp.

◆ tfrmAdd()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAdd ( colorArgType aCol)
inline

Computes the arithmetic sum of the given color and the current one.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2088 of file MRcolorTpl.hpp.

◆ tfrmDiv() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmDiv ( colorArgType aCol)
inline

Computes the arithmetic division of the current color by the given color.

If a channel of aCol is zero, then the corresponding channel of the current color object will be left untouched.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2098 of file MRcolorTpl.hpp.

◆ tfrmDiv() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmDiv ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2106 of file MRcolorTpl.hpp.

◆ tfrmMult()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMult ( colorArgType aCol)
inline

Computes the arithmetic product of the given color and the current one.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2116 of file MRcolorTpl.hpp.

◆ tfrmMultClamp()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMultClamp ( colorArgType aCol)
inline

Computes the product of the given color and the current one.

If the result of a multiplication is too large, it will be set to the maximum component value.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2126 of file MRcolorTpl.hpp.

◆ tfrmSignDiff()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmSignDiff ( colorArgType aCol)
inline

Computes the component wise scaled sign of the difference between the current color and the given one.

As an example of the computation, the red component of the current color is computed like this:

  • R=minChanVal iff(R<color.R)
  • R=meanChanVal iff(R==color.R)
  • R=maxChanVal iff(R>color.R)
    Parameters
    aColThe color to use in the computation.
    Returns
    Returns a reference to the current color object.

Definition at line 2139 of file MRcolorTpl.hpp.

◆ tfrmDiffClamp()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmDiffClamp ( colorArgType aCol)
inline

Computes the arithmetic difference of the given color from the current one.

If the result a differences is negative, then that component will be set to zero.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2156 of file MRcolorTpl.hpp.

◆ tfrmNegDiffClamp()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmNegDiffClamp ( colorArgType aCol)
inline

Computes the negative of the arithmetic difference of the given color from the current one.

This is the same as the arithmetic difference of the current color from the given color. If the result a differences is negative, then that component will be set to zero.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2167 of file MRcolorTpl.hpp.

◆ tfrmAddClamp()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAddClamp ( colorArgType aCol)
inline

Computes the arithmetic sum of the given color from the current one.

If the result of a sum is greater than the maximum value, then that component will be set to the maximum value.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2177 of file MRcolorTpl.hpp.

◆ tfrmAddDivClamp() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAddDivClamp ( colorArgType aCol,
colorArgType dCol )
inline

Computes the arithmetic sum of the current color and aCol, then divids by dCol.

If the result is greater than the maximum value, then that component will be set to the maximum value. If a channel of dCol is zero, then the corresponding channel of the current color object will be left untouched.

Parameters
aColThe color to use for initial add.
dColThe color to use for final division.
Returns
Returns a reference to the current color object.

Definition at line 2189 of file MRcolorTpl.hpp.

◆ tfrmAddDivClamp() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmAddDivClamp ( colorArgType aCol,
colorArgType dCol )
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2198 of file MRcolorTpl.hpp.

◆ tfrmDiff()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmDiff ( colorArgType aCol)
inline

Computes the arithmetic difference of the given color from the current one.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2209 of file MRcolorTpl.hpp.

◆ tfrmMod() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMod ( colorArgType aCol)
inline

Computes the arithmetic modulus of the current by the given one.

If a channel of aCol is zero, then the corresponding channel of the current object is left untouched.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2219 of file MRcolorTpl.hpp.

◆ tfrmMod() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMod ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2227 of file MRcolorTpl.hpp.

◆ tfrmInvert()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmInvert ( )
inline

Transforms the color: r=maxChanVal-r, g=maxChanVal-r, and b=maxChanVal-b.

Returns
Returns a reference to the current color object.

Definition at line 2236 of file MRcolorTpl.hpp.

◆ tfrmPow()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmPow ( double p)
inline

Power: c=maxChanVal*(c/maxChanVal)^p.

Floating point Numbers are used for intermediate values and the result cast to a colorT at the end. Take care when negative values for p – this can cause undefined behavior!!

Returns
Returns a reference to the current color object.

Definition at line 2253 of file MRcolorTpl.hpp.

◆ tfrmLn1() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmLn1 ( )
inline

Adds 1.0 and takes the natural logarithm of each channel.

Floating point Numbers are used for intermediate values and the result cast to a colorT at the end. If a channel value would result in an undefined result, then the value is left untouched.

Returns
Returns a reference to the current color object.

Definition at line 2263 of file MRcolorTpl.hpp.

◆ tfrmLn1() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmLn1 ( )
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2271 of file MRcolorTpl.hpp.

◆ tfrmLn() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmLn ( double scale)
inline

Computes ln(c)*scale for each channel value c.

If c==0, then the value is left undisturbed. Floating point Numbers are used for intermediate values and the result cast to a colorT at the end. If a channel value would result in an undefined result, then the value is left untouched.

Parameters
scaleThe scale value to multiply by the final result.
Returns
Returns a reference to the current color object.

Definition at line 2286 of file MRcolorTpl.hpp.

◆ tfrmLn() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmLn ( double scale)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2297 of file MRcolorTpl.hpp.

◆ tfrmMix()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMix ( double aDouble,
colorArgType tooCol )
inline

Linearly interpolate between the current color and the given color (at a point scaled the unit interval).

If aDouble is 0, then the current color will not change. If aDouble is 1, then the current color will be tooCol.

Parameters
aDoubleDistance from the current color (on a unit interval)
tooColThe color we are interpolating with.
Returns
Returns a reference to the current color object.

Definition at line 2312 of file MRcolorTpl.hpp.

◆ tfrmCopy()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmCopy ( colorArgType aCol)
inline

Copies the given argument into the current color object.

Scan as copy() – just with a name more suited to transformation code.

Returns
Returns a reference to the current color object.

Definition at line 2322 of file MRcolorTpl.hpp.

◆ tfrmMaxI()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMaxI ( colorArgType aCol)
inline

Makes the current color the maximum of the current color or the given color.

Colors are ordered by intensity (thus the 'I' in the name)

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2328 of file MRcolorTpl.hpp.

◆ tfrmMinI()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMinI ( colorArgType aCol)
inline

Makes the current color the minimum of the current color or the given color.

Colors are ordered by intensity (thus the 'I' in the name)

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2344 of file MRcolorTpl.hpp.

◆ tfrmMax()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMax ( colorArgType aCol)
inline

Makes each component of the current color the maximum of that component and the corresponding component of the given color.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2360 of file MRcolorTpl.hpp.

◆ tfrmMin()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMin ( colorArgType aCol)
inline

Makes each component of the current color the minimum of that component and the corresponding component of the given color.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2370 of file MRcolorTpl.hpp.

◆ tfrmShiftL() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmShiftL ( colorArgType aCol)
inline

The Shift Left Transform modifies the current color.

Parameters
aColNumber of bits to shift left
Returns
Returns a reference to the current color object.

Definition at line 2380 of file MRcolorTpl.hpp.

◆ tfrmShiftL() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmShiftL ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2388 of file MRcolorTpl.hpp.

◆ tfrmShiftR() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmShiftR ( colorArgType aCol)
inline

The Shift Right Transform modifies the current color.

Parameters
aColHow many bits to shift.
Returns
Returns a reference to the current color object.

Definition at line 2399 of file MRcolorTpl.hpp.

◆ tfrmShiftR() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmShiftR ( colorArgType aCol)
inline

Template specialization member function differing from the above function only in supported template conditions.

Definition at line 2407 of file MRcolorTpl.hpp.

◆ tfrmSaw()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmSaw ( colorArgType lowCol,
colorArgType highCol )
inline

The Saw Transform modifies the current color: C_i = ifelse(ra<=C_i<=rb, C_i, 0)

Parameters
lowCollower cutoff value
highColupper cutoff value
Returns
Returns a reference to the current color object.

Definition at line 2418 of file MRcolorTpl.hpp.

◆ tfrmStep()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmStep ( colorArgType lowCol,
colorArgType highCol )
inline

The Saw Transform modifies the current color: C_i = ifelse(ra<=C_i<=rb, maxChanVal, 0)

Parameters
lowCollower cutoff value
highColupper cutoff value
Returns
Returns a reference to the current color object.

Definition at line 2428 of file MRcolorTpl.hpp.

◆ tfrmDiracTot()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmDiracTot ( colorArgType aCol)
inline

The DiracTot (total) Transform modifies the current color: Set current color to white if it equals aCol, and black otherwise.

Parameters
aColDirac trigger value
Returns
Returns a reference to the current color object.

Definition at line 2437 of file MRcolorTpl.hpp.

◆ tfrmDirac()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmDirac ( colorArgType aCol)
inline

The Dirac Transform modifies the current color: C_i = ifelse(C_i==aCol.C_i, maxChanVal, 0)

Parameters
aColDirac trigger value
Returns
Returns a reference to the current color object.

Definition at line 2447 of file MRcolorTpl.hpp.

◆ tfrmFuzzyDirac()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmFuzzyDirac ( colorArgType ctrCol,
colorArgType radCol )
inline

The Fuzzy Dirac Transform modifies the current color: C_i=ifelse(|R-ctrCol.R|<=radCol.R), maxChanVal, 0)

Parameters
ctrColCenter Color
radColRadius Color
Returns
Returns a reference to the current color object.

Definition at line 2457 of file MRcolorTpl.hpp.

◆ tfrmMean()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmMean ( colorArgType aCol)
inline

Computes the arithmetic mean of the given color and the current one.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2466 of file MRcolorTpl.hpp.

◆ tfrmGmean()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmGmean ( colorArgType aCol)
inline

Computes the geometric mean of the given color and the current one.

Floating point Numbers re used for intermediate values and the result cast to a colorT at the end.

Parameters
aColThe color to use in the computation.
Returns
Returns a reference to the current color object.

Definition at line 2476 of file MRcolorTpl.hpp.

◆ tfrmGreyScaleRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmGreyScaleRGB ( void )
inline

Transform the current color by rendering it into a true grey via the same method used by the luminanceRGB() function.

This function only sets the red, blue, and green channels – all other channels are left untouched.

Returns
Returns a reference to the current color object.

Definition at line 2485 of file MRcolorTpl.hpp.

◆ tfrmWebSafeRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmWebSafeRGB ( )
inline

The 216 Palate Web Safe Transform modifies the current color into the closest web safe color from the 216 color web safe pallet.

This function only sets the red, blue, and green channels – all other channels are left untouched.

Returns
Returns a reference to the current color object.

Definition at line 2502 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csWS_tpl< colors >::c().

Here is the caller graph for this function:

◆ rgb2colorSpace()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colConDbl3 mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::rgb2colorSpace ( colorSpaceEnum space) const
inline

Compute channels for given color space coordinates for the current color.

Note RGB returns float RGB normalized to 1.0.

Parameters
spaceThe color space to convert to
Returns
An RGB color with double channels.

Definition at line 2528 of file MRcolorTpl.hpp.

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distDeltaE1976(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distDeltaE1994(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::interplColorSpace().

Here is the caller graph for this function:

◆ colorSpaceToString()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
std::string mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorSpaceToString ( colorSpaceEnum space)
inline

Compute channels for given color space coordinates for the current color.

Note RGB returns float RGB normalized to 1.0.

Parameters
spaceThe color space to stringify
Returns
A string representing the color space.

Definition at line 2627 of file MRcolorTpl.hpp.

◆ tfrmLinearGreyLevelScale()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmLinearGreyLevelScale ( double c,
double b )
inline

The Linear Grey Level Scale transform modifies the current color such that: C_n=c*C_n+b.

This function transforms all channels — not just RGBA.

Parameters
cThe "contrast" value
bThe "brightness" value
Returns
Returns a reference to the current color object.

Definition at line 2649 of file MRcolorTpl.hpp.

◆ tfrmLinearGreyLevelScaleRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmLinearGreyLevelScaleRGB ( double rc,
double rb,
double gc,
double gb,
double bc,
double bb )
inline

The Linear Grey Level Scale transform modifies the current color such that: R=rc*R+rb, G=gc*G+gb, B=bc*B+bb.

This function ONLY transforms the red, green, and blue channels.

Parameters
rcThe "contrast" value for red
rbThe "brightness" value for red
gcThe "contrast" value for green
gbThe "brightness" value for green
bcThe "contrast" value for blue
bbThe "brightness" value for blue
Returns
Returns a reference to the current color object.

Definition at line 2664 of file MRcolorTpl.hpp.

◆ tfrmComplexCut()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmComplexCut ( std::complex< double > z,
double cutDepth,
double argCuts,
double absCuts,
bool logAbs = true )
inline

◆ tfrmStdPow()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmStdPow ( double p)
inline

The Standard Power Transform modifies the current color such that: C_i = maxChanVal*(C_i / maxChanVal)**p.

Returns
Returns a reference to the current color object.

Definition at line 2698 of file MRcolorTpl.hpp.

◆ tfrmStdPowRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmStdPowRGB ( double rp,
double gp,
double bp )
inline

The Standard Power Transform modifies the current color such that: R=maxChanVal*(R/maxChanVal)**rp, B=maxChanVal*(B/maxChanVal)**gp, B=maxChanVal*(B/maxChanVal)**bp.

Returns
Returns a reference to the current color object.

Definition at line 2707 of file MRcolorTpl.hpp.

◆ tfrmStdPowSqr()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmStdPowSqr ( void )
inline

The Standard Power Transform with p=2.

The new color will be: C_i = C_i * C_i / maxChanVal == (C_i/maxChanVal)^2*maxChanVal This computation is done with integer math if clrChanT is integral.

Returns
Returns a reference to the current color object.

Definition at line 2718 of file MRcolorTpl.hpp.

◆ tfrmStdPowSqrt()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::tfrmStdPowSqrt ( void )
inline

The Standard Power Transform with p=1/2.

The new color will be: C_i = sqrt(C_i / maxChanVal) * maxChanVal

Returns
Returns a reference to the current color object.

Definition at line 2727 of file MRcolorTpl.hpp.

◆ rgb2GreyDotProd()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithFltType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::rgb2GreyDotProd ( channelArithFltType redWt = RGBluminanceWeightR,
channelArithFltType greenWt = RGBluminanceWeightG,
channelArithFltType blueWt = RGBluminanceWeightB ) const
inline

Use the R, G, & B channels to compute a floating point value representing a grey scale.

What is returned is the dot product of the given color and the three scalars: R*redWt+G*greenWt+B*blueWt.

Parameters
redWtThe red weight
greenWtThe green weight
blueWtThe blue weight
Returns
The integer representing grey value for the given color.

Definition at line 2746 of file MRcolorTpl.hpp.

◆ luminanceRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithFltType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::luminanceRGB ( void ) const
inline

Compute the luminance of the current color via the definition given in the ITU-R Recommendation BT.709.

The output value will be between 0 and 1, and is given by: (RGBluminanceWeightR*R+RGBluminanceWeightG*G+RGBluminanceWeightB*B)/maxChanVal.

Returns
The luminance for the current object.

Definition at line 2758 of file MRcolorTpl.hpp.

◆ intensityRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithSPType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::intensityRGB ( void ) const
inline

Compute the unscaled intensity (sum of the R, G, & B components) of the current color.

Returns
The unscaled intensity for the current object.

Definition at line 2767 of file MRcolorTpl.hpp.

◆ intensity()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithSPType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::intensity ( ) const
inline

Compute the sum of the components.

Returns
Sum of components.

Definition at line 2776 of file MRcolorTpl.hpp.

◆ intensityScaledRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithFltType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::intensityScaledRGB ( ) const
inline

Compute the scaled intensity (sum of the first three components divided by the maximum intensity possible) of the current color.

Returns
The scaled intensity for the current object.

Definition at line 2785 of file MRcolorTpl.hpp.

◆ intensityScaled()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithFltType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::intensityScaled ( ) const
inline

Compute the scaled intensity (sum of the components divided by the maximum intensity possible) of the current color.

Returns
Sum of components.

Definition at line 2791 of file MRcolorTpl.hpp.

◆ getMaxC()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getMaxC ( ) const
inline

Returns the value of the largest component.

Returns
The value of the largest color component currently stored.

Definition at line 2797 of file MRcolorTpl.hpp.

◆ getMinC()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getMinC ( ) const
inline

Returns the value of the smallest component.

Returns
The value of the smallest color component currently stored.

Definition at line 2820 of file MRcolorTpl.hpp.

◆ getMaxRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getMaxRGB ( ) const
inline

Returns the value of the largest component from R, G, and B.

This function is highly optimized.

Returns
The value of the largest color component.

Definition at line 2840 of file MRcolorTpl.hpp.

◆ getMinRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getMinRGB ( ) const
inline

Returns the value of the smallest component from R, G, and B.

This function is highly optimized.

Returns
The value of the smallest color component.

Definition at line 2844 of file MRcolorTpl.hpp.

◆ dotProd()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithFltType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::dotProd ( colorArgType aColor) const
inline

Compute the dot product between the current color and the given color.

i.e. c1.r*c2.r+c1.g*c2.g+...

Parameters
aColorthe given color
Returns
Returns dot product.

Definition at line 2849 of file MRcolorTpl.hpp.

◆ distHypot()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithFltType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distHypot ( colorArgType aColor) const
inline

Distance between current color and given one (sum squares of channel differences – Euclidean distance squared).

Parameters
aColorThe given color
Returns
Returns Distance

Definition at line 2859 of file MRcolorTpl.hpp.

◆ distSumAbs()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithSPType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distSumAbs ( colorArgType aColor) const
inline

Distance between current color and given one (sum of absolute channel differences).

Parameters
aColorthe given color
Returns
Returns Distance

Definition at line 2870 of file MRcolorTpl.hpp.

◆ distMaxAbs()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
channelArithSPType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distMaxAbs ( colorArgType aColor) const
inline

Distance between current color and given one (maximum of absolute value of channel differences).

Parameters
aColorthe given color
Returns
Returns Distance

Definition at line 2880 of file MRcolorTpl.hpp.

◆ distDeltaE1976()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distDeltaE1976 ( colorArgType aColor) const
inline

LAB Delta E* distance between current color and given one.

Note: The Delta E* 1976 distance measurement is inherently an RGB measurement in that the colors are converted to LAB* as part of the computation.

Parameters
aColorthe given color
Returns
Returns Distance – note return is a double not a channelArithFltType.

Definition at line 2894 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getChanNC(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::rgb2colorSpace().

Here is the call graph for this function:

◆ distDeltaE1994()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::distDeltaE1994 ( colorArgType aColor) const
inline

LAB Delta E* 1994 (graphic arts) distance between current color and given one.

Note: The Delta E* 1994 distance measurement is inherently an RGB measurement in that the colors are converted to LAB* as part of the computation. Note: The Delta E* 1994 distance measurement is NOT symetric – the 1976 one is!

Parameters
aColorthe given color
Returns
Returns Distance – note return is a double not a channelArithFltType.

Definition at line 2909 of file MRcolorTpl.hpp.

References mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC0(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC1(), mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::getC2(), and mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::rgb2colorSpace().

Here is the call graph for this function:

◆ isClose()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isClose ( colorArgType aColor,
clrChanT epsilon ) const
inline

Returns non-zero if the current color is close to aColor (the maximum delta between any two channels is less than or equal to epsilon).

Note the implications for floating point clrChanT.

Returns
non-zero if the given color is logically the same as the current color

Definition at line 2936 of file MRcolorTpl.hpp.

◆ isCloseRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isCloseRGB ( colorArgType aColor,
clrChanT epsilon ) const
inline

Like isClose(), but only checks the R, G, & B channels.

Returns
non-zero if the given RGB color is the same as the current color

Definition at line 2945 of file MRcolorTpl.hpp.

◆ isEqual()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isEqual ( colorArgType aColor) const
inline

Returns non-zero if the current color is precicely equal to aColor.

Note the implications for floating point clrChanT.

Returns
non-zero if the given color is logically the same as the current color

Definition at line 2955 of file MRcolorTpl.hpp.

◆ isEqualRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isEqualRGB ( colorArgType aColor) const
inline

Like isEqual(), but only checks the R, G, & B channels.

Returns
non-zero if the given RGB color is the same as the current color

Definition at line 2967 of file MRcolorTpl.hpp.

◆ isNotEqual()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isNotEqual ( colorArgType aColor) const
inline

Returns non-zero if the given color is logically NOT the same as the current color.

Note the implications for floating point clrChanT.

Returns
non-zero if the given color is logically the same as the current color

Definition at line 2977 of file MRcolorTpl.hpp.

Referenced by mjr::operator!=().

Here is the caller graph for this function:

◆ isBlack()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isBlack ( )
inline

Returns non-zero if the given color is black (all componnets are zero)

Returns
non-zero if the given color is black (all componnets are zero)

Definition at line 2981 of file MRcolorTpl.hpp.

◆ isBlackRGB()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::isBlackRGB ( ) const
inline

LIke isBlack(), but only checks the R, G, & B channels.

Returns
non-zero if the given color is black (R, G, & B are are zero)

Definition at line 2993 of file MRcolorTpl.hpp.

◆ clampTop()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<typename iT >
requires (std::same_as<iT, clrChanT> || std::same_as<iT, channelArithDType> || std::same_as<iT, channelArithSPType> || std::same_as<iT, channelArithSDPType> || std::same_as<iT, channelArithLogType>)
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clampTop ( iT arithValue)
inline

Clamp a value to (infinity, maxChanVal].

Input values larger than maxChanVal are mapped to maxChanVal. Values less than minChanVal are not changed.

Parameters
arithValueThe value to clamp

Definition at line 3005 of file MRcolorTpl.hpp.

◆ clampBot()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<typename iT >
requires (std::same_as<iT, clrChanT> || std::same_as<iT, channelArithDType> || std::same_as<iT, channelArithSPType> || std::same_as<iT, channelArithSDPType> || std::same_as<iT, channelArithLogType>)
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clampBot ( iT arithValue)
inline

Clamp a value to [minChanVal, infinity).

Parameters
arithValueThe value to clamp

Definition at line 3016 of file MRcolorTpl.hpp.

◆ clampAll()

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<typename iT >
requires (std::same_as<iT, clrChanT> || std::same_as<iT, channelArithDType> || std::same_as<iT, channelArithSPType> || std::same_as<iT, channelArithSDPType> || std::same_as<iT, channelArithLogType>)
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::clampAll ( iT arithValue)
inline

Clamp a value to [minChanVal, maxChanVal].

Parameters
arithValueThe value to clamp

Definition at line 3027 of file MRcolorTpl.hpp.

◆ csSet() [1/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<class csT , class csAT >
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csSet ( csAT csArg)
inline

◆ csSet() [2/2]

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
template<class csT , class csAT >
colorTpl & mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::csSet ( csAT csArg1,
csAT csArg2 )
inline

Definition at line 5188 of file MRcolorTpl.hpp.

Member Data Documentation

◆ theInt

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
maskType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::theInt

Definition at line 372 of file MRcolorTpl.hpp.

◆ thePartsA

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::thePartsA[numChan]

◆ [union]

union { ... } mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::theColor

Holds the color channel data.

The union is used to overlay a mask integer leading to dramatic performance improvements for common color types.

Technically we are not allowed to use a union the way we do in colorTpl with modern C++; however, every compiler I use allows us to access "non-active" union members the same way we did with good old C. At some point C++ compilers will have bit_cast, and I can try doing this the "correct" way with modern C++; however, I'll need to do quite a bit of performance testing first...

Referenced by mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::colorTpl().

◆ noRGBchanIdx

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::noRGBchanIdx = (redChanIdx < 0) && (greenChanIdx < 0) && (blueChanIdx < 0) && (alphaChanIdx < 0)
staticconstexpr

Definition at line 516 of file MRcolorTpl.hpp.

◆ redChan

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::redChan = (noRGBchanIdx && numChan > 0 ? 0 : redChanIdx)
staticconstexpr

Definition at line 517 of file MRcolorTpl.hpp.

◆ greenChan

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::greenChan = (noRGBchanIdx && numChan > 1 ? 1 : greenChanIdx)
staticconstexpr

Definition at line 518 of file MRcolorTpl.hpp.

◆ blueChan

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::blueChan = (noRGBchanIdx && numChan > 2 ? 2 : blueChanIdx)
staticconstexpr

Definition at line 519 of file MRcolorTpl.hpp.

◆ alphaChan

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::alphaChan = (noRGBchanIdx && numChan > 3 ? 3 : alphaChanIdx)
staticconstexpr

Definition at line 520 of file MRcolorTpl.hpp.

◆ bitsPerChan

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::bitsPerChan = (int)(sizeof(clrChanT)*CHAR_BIT)
staticconstexpr

Number of bits in clrChanT.

Definition at line 526 of file MRcolorTpl.hpp.

◆ bitsPerPixel

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::bitsPerPixel = numChan*bitsPerChan
staticconstexpr

Number of color data bits.

Definition at line 527 of file MRcolorTpl.hpp.

◆ chanIsInt

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::chanIsInt = std::is_integral<clrChanT>::value
staticconstexpr

clrChanT is an integral type

Definition at line 528 of file MRcolorTpl.hpp.

◆ chanIsFloat

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::chanIsFloat = std::is_floating_point<clrChanT>::value
staticconstexpr

clrChanT is a floating pint type

Definition at line 529 of file MRcolorTpl.hpp.

◆ chanIsUnsigned

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::chanIsUnsigned = std::is_unsigned<clrChanT>::value
staticconstexpr

clrChanT is an unsigned integral type

Definition at line 530 of file MRcolorTpl.hpp.

◆ chanIsByte

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::chanIsByte = std::is_same<clrChanT, uint8_t>::value
staticconstexpr

is clrChanT an 8-bit unsigned int?

Definition at line 531 of file MRcolorTpl.hpp.

◆ chanIsDouble

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::chanIsDouble = std::is_same<clrChanT, double>::value
staticconstexpr

is clrChanT a double?

Definition at line 532 of file MRcolorTpl.hpp.

◆ goodMask

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::goodMask = (sizeof(maskType) >= sizeof(clrChanT)*numChan)
staticconstexpr

maskType is big enough

Definition at line 533 of file MRcolorTpl.hpp.

◆ perfectMask

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::perfectMask = (sizeof(maskType) == sizeof(clrChanT)*numChan)
staticconstexpr

maskType is perfectly sized

Definition at line 534 of file MRcolorTpl.hpp.

◆ goodArithD

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::goodArithD = (chanIsFloat || (sizeof(channelArithDType) >= sizeof(clrChanT)*2))
staticconstexpr

channelArithDType is big enough

Definition at line 535 of file MRcolorTpl.hpp.

◆ goodArithSP

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::goodArithSP = (chanIsFloat || (sizeof(channelArithSPType) >= sizeof(clrChanT)*2))
staticconstexpr

channelArithSPType is big enough

Definition at line 536 of file MRcolorTpl.hpp.

◆ goodArithSDP

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::goodArithSDP = (chanIsFloat || (sizeof(channelArithSDPType) >= sizeof(clrChanT)*4))
staticconstexpr

channelArithSDPType is big enough

Definition at line 537 of file MRcolorTpl.hpp.

◆ goodArithFlt

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::goodArithFlt = (chanIsFloat || (sizeof(channelArithFltType) > sizeof(clrChanT)))
staticconstexpr

channelArithFltType is big enough

Definition at line 538 of file MRcolorTpl.hpp.

◆ goodArithLog

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::goodArithLog = (sizeof(channelArithLogType) == sizeof(clrChanT))
staticconstexpr

channelArithLogType is the right size

Definition at line 539 of file MRcolorTpl.hpp.

◆ sizeOfColor

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::sizeOfColor = (int)(goodMask ? sizeof(maskType) : sizeof(clrChanT)*numChan)
staticconstexpr

Size of this object.

Definition at line 540 of file MRcolorTpl.hpp.

◆ ptrIsSmaller

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
bool mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::ptrIsSmaller = sizeOfColor > (int)sizeof(colorPtrType)
staticconstexpr

This object smaller than a pointer.

Definition at line 541 of file MRcolorTpl.hpp.

◆ maxChanVal

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::maxChanVal = (chanIsInt ? std::numeric_limits<clrChanT>::max() : 1)
staticconstexpr

maximum value for a channel

Definition at line 542 of file MRcolorTpl.hpp.

◆ minChanVal

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::minChanVal = (chanIsInt ? std::numeric_limits<clrChanT>::min() : 0)
staticconstexpr

maximum value for a channel

Definition at line 543 of file MRcolorTpl.hpp.

◆ meanChanVal

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
clrChanT mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::meanChanVal = (maxChanVal-minChanVal)/2
staticconstexpr

middle value for a channel

Definition at line 544 of file MRcolorTpl.hpp.

◆ maskAllOne

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
maskType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::maskAllOne = ~(static_cast<maskType>(0))
staticconstexpr

mask value all ones

Definition at line 545 of file MRcolorTpl.hpp.

◆ maskAllZero

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
maskType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::maskAllZero = static_cast<maskType>(0)
staticconstexpr

mask value all zeros

Definition at line 546 of file MRcolorTpl.hpp.

◆ channelCount

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::channelCount = numChan
staticconstexpr

Number of channels.

Definition at line 547 of file MRcolorTpl.hpp.

◆ chanStepMax

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
csIntType mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::chanStepMax = (chanIsInt ? static_cast<csIntType>(maxChanVal) : std::numeric_limits<uint32_t>::max())
staticconstexpr

Finite "steps" for a color scheme: [0, chanStepMax].

Definition at line 584 of file MRcolorTpl.hpp.

◆ minWavelength

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::minWavelength = 360
staticconstexpr

Minimum wavelength for wavelength conversion.

Definition at line 585 of file MRcolorTpl.hpp.

◆ maxWavelength

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
int mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::maxWavelength = 830
staticconstexpr

Maximum wavelength for wavelength conversion.

Definition at line 586 of file MRcolorTpl.hpp.

◆ RGBluminanceWeightR

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::RGBluminanceWeightR = 0.2126
staticconstexpr

Definition at line 591 of file MRcolorTpl.hpp.

◆ RGBluminanceWeightG

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::RGBluminanceWeightG = 0.7152
staticconstexpr

Definition at line 592 of file MRcolorTpl.hpp.

◆ RGBluminanceWeightB

template<class clrChanT , int numChan, int redChanIdx = -1, int greenChanIdx = -1, int blueChanIdx = -1, int alphaChanIdx = -1>
double mjr::colorTpl< clrChanT, numChan, redChanIdx, greenChanIdx, blueChanIdx, alphaChanIdx >::RGBluminanceWeightB = 0.0722
staticconstexpr

Definition at line 593 of file MRcolorTpl.hpp.


The documentation for this class was generated from the following file: