Loading...
Searching...
No Matches
SBDPaletteFlexibleDivergingHCL Class Reference

The SBDPaletteFlexibleDivergingHCL class is a class for the flexible diverging HCL (Hue-Chroma-Luminance) color palette. More...

Palette parameters

int hue1
 The starting value for the hue coordinate.
 
int hue2
 The center value for the hue coordinate.
 
int hue3
 The end value for the first coordinate.
 
int chroma1
 The starting value for the chroma coordinate (corresponds to hue1)
 
int chroma2
 The center value for the chroma coordinate (corresponds to hue2)
 
int chroma3
 The end value for the chroma coordinate (corresponds to hue3)
 
int maximumChroma1
 The max value for the chroma coordinate for the triangular trajectory in the first sequential palette.
 
int maximumChroma2
 The max value for the chroma coordinate for the triangular trajectory in the second sequential palette.
 
float chromaPower1
 The power of the intensity value for the computation of the chroma coordinate in the first sequential palette, the power should be greater than 0.
 
float chromaPower2
 The power of the intensity value for the computation of the chroma coordinate in the second sequential palette, the power should be greater than 0.
 
int luminance1
 The starting value for the luminance coordinate (corresponds to hue1)
 
int luminance2
 The center value for the luminance coordinate (corresponds to hue2)
 
int luminance3
 The end value for the luminance coordinate (corresponds to hue3)
 
float luminancePower1
 The power of the intensity value for the computation of the luminance coordinate in the first sequential palette, the power should be greater than 0.
 
float luminancePower2
 The power of the intensity value for the computation of the luminance coordinate in the second sequential palette, the power should be greater than 0.
 
float neutralPoint
 The neutral point position, should be in the range [0.0, 1.0].
 

Constructors and destructors

 SBDPaletteFlexibleDivergingHCL ()
 Default constructor.
 
 SBDPaletteFlexibleDivergingHCL (int hue1, int hue2, int hue3, int chroma1, int chroma2, int chroma3, int luminance1=70, int luminance2=70, int luminance3=70, float chromaPower1=1.0f, float luminancePower1=1.0f, float chromaPower2=1.0f, float luminancePower2=1.0f, int maximumChroma1=50, int maximumChroma2=50, float neutralPoint=0.5f, std::string name=std::string(""))
 
 SBDPaletteFlexibleDivergingHCL (const SBDPaletteFlexibleDivergingHCL &otherColorPalette)
 Copy constructor.
 
virtual ~SBDPaletteFlexibleDivergingHCL ()
 

Serialization

virtual bool isSerializable () const override
 Returns true.
 
virtual void serialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber &classVersionNumber=SBVersionNumber(1, 0, 0)) const override
 Serializes the document.
 
virtual void unserialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber &classVersionNumber=SBVersionNumber(1, 0, 0)) override
 Unserializes the document.
 

Cloning

virtual SBDPaletteFlexibleDivergingHCLclone () const override
 Clones the color palette.
 

Getter and setter functions

int getHue1 () const
 Returns the starting value for the first coordinate.
 
void setHue1 (int hue)
 Sets the starting value for the first coordinate.
 
int getHue2 () const
 Returns the center value for the first coordinate.
 
void setHue2 (int hue)
 Sets the center value for the first coordinate.
 
int getHue3 () const
 Returns the end value for the first coordinate.
 
void setHue3 (int hue)
 Sets the end value for the first coordinate.
 
void setHue (int hue1, int hue2, int hue3)
 Sets the parameters for the first coordinate.
 
int getChroma1 () const
 Returns the starting value for the second coordinate.
 
void setChroma1 (int chroma)
 Sets the starting value for the second coordinate.
 
int getChroma2 () const
 Returns the center value for the second coordinate.
 
void setChroma2 (int chroma)
 Sets the center value for the second coordinate.
 
int getChroma3 () const
 Returns the end value for the second coordinate.
 
void setChroma3 (int chroma)
 Sets the end value for the second coordinate.
 
int getMaximumChroma1 () const
 Returns the max value for the second coordinate in the first sequential palette.
 
void setMaximumChroma1 (int maximumChroma)
 Sets the max value for the second coordinate in the first sequential palette.
 
int getMaximumChroma2 () const
 Returns the max value for the second coordinate in the second sequential palette.
 
void setMaximumChroma2 (int maximumChroma)
 Sets the max value for the second coordinate in the second sequential palette.
 
float getChromaPower1 () const
 Returns the power of the intensity value for the computation of the second coordinate in the first sequential palette.
 
void setChromaPower1 (float chromaPower)
 Sets the power of the intensity value for the computation of the second coordinate in the first sequential palette, the power should be greater than 0.
 
float getChromaPower2 () const
 Returns the power of the intensity value for the computation of the second coordinate in the second sequential palette.
 
void setChromaPower2 (float chromaPower)
 Sets the power of the intensity value for the computation of the second coordinate in the second sequential palette, the power should be greater than 0.
 
void setChroma (int chroma1, int chroma2, int chroma3, int maximumChroma1, int maximumChroma2, float chromaPower1=1.0f, float chromaPower2=1.0f)
 Sets the parameters for the second coordinate.
 
int getLuminance1 () const
 Returns the starting value for the third coordinate.
 
void setLuminance1 (int luminance)
 Sets the starting value for the third coordinate.
 
int getLuminance2 () const
 Returns the center value for the third coordinate.
 
void setLuminance2 (int luminance)
 Sets the center value for the third coordinate.
 
int getLuminance3 () const
 Returns the end value for the third coordinate.
 
void setLuminance3 (int luminance)
 Sets the end value for the third coordinate.
 
float getLuminancePower1 () const
 Returns the power of the intensity value for the computation of the third coordinate in the first sequential palette.
 
void setLuminancePower1 (float luminancePower)
 Sets the power of the intensity value for the computation of the third coordinate in the first sequential palette, the power should be greater than 0.
 
float getLuminancePower2 () const
 Returns the power of the intensity value for the computation of the third coordinate in the second sequential palette.
 
void setLuminancePower2 (float luminancePower)
 Sets the power of the intensity value for the computation of the third coordinate in the second sequential palette, the power should be greater than 0.
 
void setLuminance (int luminance1, int luminance2, int luminance3, float luminancePower1=1.0f, float luminancePower2=1.0f)
 Sets the parameters for the third coordinate.
 
float getNeutralPoint () const
 Returns the neutral point position.
 
void setNeutralPoint (float neutralPoint)
 Sets the neutral point position, should be in the range [0.0, 1.0].
 

Palette functions

virtual void getColor (float *color, float value) const override
 Computes sRGB color color based on this palette for the given intensity value value which should be in the range [0.0, 1.0].
 
virtual void getColorInPaletteColorSpace (float *color, float value) const override
 Computes color coordinates color in this palette's color space for the given intensity value value which should be in the range [0.0, 1.0].
 

Additional Inherited Members

- Public Types inherited from SBDPalette
enum class  PaletteType {
  Custom ,
  Qualitative ,
  Sequential ,
  Diverging ,
  FlexibleDiverging
}
 
- Public Member Functions inherited from SBDPalette
 SBDPalette ()
 Default constructor.
 
virtual ~SBDPalette ()
 
PaletteType getType () const
 Returns the type of the color palette.
 
void setType (SBDPalette::PaletteType paletteType)
 Sets the type of the color palette.
 
const std::string & getName () const
 Returns the palette's name.
 
void setName (const std::string &name)
 Sets the palette's name to name.
 
bool getReverseFlag () const
 Returns the reverse flag - whether the color palette is mirrored or not.
 
void setReverseFlag (bool b)
 Sets the reverse flag - whether to mirror or not the color palette.
 
SBColor getColor (float value) const
 Returns SBColor based on the palette and an intensity value value.
 
- Static Public Member Functions inherited from SBDPalette
static float getValueAlongLinearTrajectory (float y1, float y2, float power, float x)
 Returns a value along the "linear" trajectory.
 
static float getValueAlongTriangularTrajectory (float y1, float ymax, float y2, float power, float x)
 Returns a value along "triangular" trajectory.
 
- Protected Attributes inherited from SBDPalette
PaletteType paletteType
 The palette's type.
 
std::string * name
 The palette's name.
 
bool reverseFlag
 Reverse flag: if true, then the palette is reversed/mirrored.
 

Detailed Description

A flexible diverging palette is constructed in a 3D color coordinate space with coordinates named Hue, Chroma, and Luminance. Flexible diverging HCL color palettes generated through combination of two fully flexible multi-hue sequential palettes.

Member Function Documentation

◆ clone()

SBDPaletteFlexibleDivergingHCL * SBDPaletteFlexibleDivergingHCL::clone ( ) const
overridevirtual

Reimplemented from SBDPalette.

◆ getColor()

void SBDPaletteFlexibleDivergingHCL::getColor ( float *  color,
float  value 
) const
overridevirtual

Reimplemented from SBDPalette.

◆ getColorInPaletteColorSpace()

void SBDPaletteFlexibleDivergingHCL::getColorInPaletteColorSpace ( float *  color,
float  value 
) const
overridevirtual

SBDPaletteFlexibleDivergingHCL::getColorInPaletteColorSpace - Computes color coordinates color in the HCL color space for the given intensity value value.

Parameters
color- an array for color coordinates (float[3]) in the HCL color space.
value- an intensity value based on which the resulting color is computed, the intensity value should be in range [0.0, 1.0] where 1 corresponds to the full intensity.

Reimplemented from SBDPalette.

◆ isSerializable()

bool SBDPaletteFlexibleDivergingHCL::isSerializable ( ) const
overridevirtual

Reimplemented from SBDPalette.

◆ serialize()

void SBDPaletteFlexibleDivergingHCL::serialize ( SBCSerializer serializer,
const SBVersionNumber sdkVersionNumber = SB_SDK_VERSION_NUMBER,
const SBVersionNumber classVersionNumber = SBVersionNumber(1, 0, 0) 
) const
overridevirtual

Reimplemented from SBDPalette.

◆ unserialize()

void SBDPaletteFlexibleDivergingHCL::unserialize ( SBCSerializer serializer,
const SBVersionNumber sdkVersionNumber = SB_SDK_VERSION_NUMBER,
const SBVersionNumber classVersionNumber = SBVersionNumber(1, 0, 0) 
)
overridevirtual

Reimplemented from SBDPalette.