Web Analytics Made Easy - Statcounter
Skip to content

Class SBDPaletteSequentialHCL#

ClassList > SBDPaletteSequentialHCL

The SBDPaletteSequentialHCL class is a class for the sequential HCL (Hue-Chroma-Luminance) color palette.More...

  • #include <SBDPaletteSequentialHCL.hpp>

Inherits the following classes: SBDPaletteSequential

Public Types inherited from SBDPalette#

See SBDPalette

Type Name
enum PaletteType

Public Functions#

Type Name
SBDPaletteSequentialHCL ()
Default constructor.
SBDPaletteSequentialHCL (int hue1, int hue2, int chroma1=50, int maximumChroma=50, int chroma2=50, int luminance1=70, int luminance2=70, float chromaPower=1.0f, float luminancePower=1.0f, std::string name=std::string(""), bool reverse=false)
SBDPaletteSequentialHCL (const SBDPaletteSequentialHCL & otherColorPalette)
Copy constructor.
virtual SBDPaletteSequentialHCL * clone () override const
Clones the color palette.
virtual void getColor (float * color, float value) override const
Computes sRGB color color based on this palette for the given intensity valuevalue which should be in the range [0.0, 1.0].
virtual void getColorInPaletteColorSpace (float * color, float value) override const
Computes color coordinates color in this palette's color space for the given intensity valuevalue which should be in the range [0.0, 1.0].
virtual bool isSerializable () override const
Returns true.
virtual void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override const
Serializes the document.
virtual std::string toPythonCode () const
Returns the string representation of the object that can be used to reconstruct it in Python.
virtual void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override
Unserializes the document.
virtual ~SBDPaletteSequentialHCL ()

Public Functions inherited from SBDPaletteSequential#

See SBDPaletteSequential

Type Name
SBDPaletteSequential ()
Default constructor.
SBDPaletteSequential (int hue1, int hue2, int chroma1=50, int maximumChroma=50, int chroma2=50, int luminance1=70, int luminance2=70, float chromaPower=1.0f, float luminancePower=1.0f, std::string name=std::string(""), bool reverse=false)
SBDPaletteSequential (const SBDPaletteSequential & otherColorPalette)
Copy constructor.
virtual SBDPaletteSequential * clone () override const
Clones the color palette.
int getChroma1 () const
Returns the starting value for the second coordinate.
int getChroma2 () const
Returns the end value for the second coordinate.
float getChromaPower () const
Returns the power of the intensity value for the computation of the second coordinate.
virtual void getColor (float * color, float value) override const
Computes sRGB color color based on this palette for the given intensity valuevalue which should be in the range [0.0, 1.0].
virtual void getColorInPaletteColorSpace (float * color, float value) override const
Computes color coordinates color in this palette's color space for the given intensity valuevalue which should be in the range [0.0, 1.0].
int getHue1 () const
Returns the starting value for the first coordinate.
int getHue2 () const
Returns the end value for the first coordinate.
int getLuminance1 () const
Returns the starting value for the third coordinate.
int getLuminance2 () const
Returns the end value for the third coordinate.
float getLuminancePower () const
Returns the power of the intensity value for the computation of the third coordinate.
int getMaximumChroma () const
Returns the max value for the second coordinate for the triangular trajectory.
virtual PaletteType getType () override const
Returns the type of the color palette.
virtual bool isEqual (const SBDPalette & other) override const
Returns whether this palette is equal to other .
virtual bool isSerializable () override const
Returns true.
virtual void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override const
Serializes the document.
void setChroma (int chroma1, int maximumChroma, int chroma2, float chromaPower=1.0f)
Sets the parameters for the second coordinate.
void setChroma1 (int chroma1)
Sets the starting value for the second coordinate.
void setChroma2 (int chroma2)
Sets the end value for the second coordinate.
void setChromaPower (float chromaPower)
Sets the power of the intensity value for the computation of the second coordinate, the power should be greater than 0.
void setHue (int hue1, int hue2)
Sets the starting and end values for the first coordinate.
void setHue1 (int hue1)
Sets the starting value for the first coordinate.
void setHue2 (int hue2)
Sets the end value for the first coordinate.
void setLuminance (int luminance1, int luminance2, float luminancePower=1.0f)
Sets the parameters for the third coordinate.
void setLuminance1 (int luminance1)
Sets the starting value for the third coordinate.
void setLuminance2 (int luminance2)
Sets the end value for the third coordinate.
void setLuminancePower (float luminancePower)
Sets the power of the intensity value for the computation of the third coordinate, the power should be greater than 0.
void setMaximumChroma (int maximumChroma)
Sets the max value for the second coordinate for the triangular trajectory, if it is less the chroma1 or c2 then it is not used and the linear trajectory is computed.
virtual std::string toPythonCode () const
Returns the string representation of the object that can be used to reconstruct it in Python.
virtual void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) override
Unserializes the document.
virtual ~SBDPaletteSequential ()

Public Functions inherited from SBDPalette#

See SBDPalette

Type Name
SBDPalette ()
Default constructor for HSV color palette.
SBDPalette (bool reverse)
Constructor for HSV color palette with reverse flag.
virtual SBDPalette * clone () const
Clones the palette.
SBColor getColor (float value) const
Returns SBColor based on the palette and an intensity value value .
virtual void getColor (float * color, float value) const
Computes RGB color color based on the palette and an intensity valuevalue which should be in the range [0.0, 1.0].
virtual void getColorInPaletteColorSpace (float * color, float value) const
Computes color coordinates color in this palette's color space for the given intensity valuevalue which should be in the range [0.0, 1.0].
const std::string & getName () const
Returns the palette's name.
bool getReverseFlag () const
Returns the reverse flag - whether the color palette is mirrored or not.
virtual PaletteType getType () const
Returns the type of the color palette.
std::string getTypeString (bool humanReadable=false) const
Returns the string representation of the color palette type.
virtual bool isEqual (const SBDPalette & other) const
Returns whether this palette is equal to other .
virtual bool isSerializable () const
Returns true.
bool operator!= (const SBDPalette & other) const
Non-equality operator.
bool operator== (const SBDPalette & other) const
Equality operator.
virtual void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0)) const
Serializes the document.
void setName (const std::string & name)
Sets the palette's name to name .
void setReverseFlag (bool b)
Sets the reverse flag - whether to mirror or not the color palette.
virtual std::string toPythonCode () const
Returns the string representation of the object that can be used to reconstruct it in Python.
virtual void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER, const SBVersionNumber & classVersionNumber=SBVersionNumber(1, 0, 0))
Unserializes the document.
virtual ~SBDPalette ()

Public Static Functions inherited from SBDPalette#

See SBDPalette

Type Name
std::string getTypeString (PaletteType paletteType, bool humanReadable=false)
Returns the string representation of the color palette type paletteType .
float getValueAlongLinearTrajectory (float y1, float y2, float power, float x)
Returns a value along the "linear" trajectory.
float getValueAlongTriangularTrajectory (float y1, float ymax, float y2, float power, float x)
Returns a value along "triangular" trajectory.

Protected Attributes inherited from SBDPaletteSequential#

See SBDPaletteSequential

Type Name
int chroma1
The starting value for the second coordinate.
int chroma2
The end value for the second coordinate.
float chromaPower
The power of the intensity value for the computation of the second coordinate, the power should be greater than 0.
int hue1
The starting value for the first coordinate.
int hue2
The end value for the first coordinate.
int luminance1
The starting value for the third coordinate.
int luminance2
The end value for the third coordinate.
float luminancePower
The power of the intensity value for the computation of the third coordinate, the power should be greater than 0.
int maximumChroma
The max value for the second coordinate for the triangular trajectory, if it is less the chroma1 or chroma2 then it is not used and the linear trajectory is computed.

Protected Attributes inherited from SBDPalette#

See SBDPalette

Type Name
std::string * name
The palette's name.
bool reverseFlag
Reverse flag: if true, then the palette is reversed/mirrored.

Detailed Description#

A sequential palette is constructed in a 3D color coordinate space with coordinates named Hue, Chroma, and Luminance, that are computed as follows:

  • hue = hue1 + i * (hue2 - hue1)
  • if Cmax < chroma1 or maximumChroma < chroma2 then chroma is computed based on a "linear" trajectory chroma = chroma1 + i^(chromaPower) * (chroma2 - chroma1), else it is computed based on the triangular trajectory (see SBDPalette::getValueAlongTriangularTrajectory)
  • luminance = luminance1 + i^(luminancePower) * (luminance2 - luminance1), where i is a value (of intensity) based on which the colorization should be done.

Short name: SBPaletteSequentialHCL

Public Functions Documentation#

function SBDPaletteSequentialHCL [1/3]#

Default constructor.

SBDPaletteSequentialHCL::SBDPaletteSequentialHCL () 


function SBDPaletteSequentialHCL [2/3]#

SBDPaletteSequentialHCL::SBDPaletteSequentialHCL (
    int hue1,
    int hue2,
    int chroma1=50,
    int maximumChroma=50,
    int chroma2=50,
    int luminance1=70,
    int luminance2=70,
    float chromaPower=1.0f,
    float luminancePower=1.0f,
    std::string name=std::string(""),
    bool reverse=false
) 

function SBDPaletteSequentialHCL [3/3]#

Copy constructor.

SBDPaletteSequentialHCL::SBDPaletteSequentialHCL (
    const SBDPaletteSequentialHCL & otherColorPalette
) 


function clone#

Clones the color palette.

virtual SBDPaletteSequentialHCL * SBDPaletteSequentialHCL::clone () override const

Implements SBDPaletteSequential::clone


function getColor#

Computes sRGB color color based on this palette for the given intensity valuevalue which should be in the range [0.0, 1.0].

virtual void SBDPaletteSequentialHCL::getColor (
    float * color,
    float value
) override const

Implements SBDPaletteSequential::getColor


function getColorInPaletteColorSpace#

Computes color coordinates color in this palette's color space for the given intensity valuevalue which should be in the range [0.0, 1.0].

virtual void SBDPaletteSequentialHCL::getColorInPaletteColorSpace (
    float * color,
    float value
) override const

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

Parameters:

  • color - an array for color coordinates (with the size greater than or equal to 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.

Implements SBDPaletteSequential::getColorInPaletteColorSpace


function isSerializable#

Returns true.

virtual bool SBDPaletteSequentialHCL::isSerializable () override const

Implements SBDPaletteSequential::isSerializable


function serialize#

Serializes the document.

virtual void SBDPaletteSequentialHCL::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
    const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override const

Implements SBDPaletteSequential::serialize


function toPythonCode#

Returns the string representation of the object that can be used to reconstruct it in Python.

virtual std::string SBDPaletteSequentialHCL::toPythonCode () const

Implements SBDPaletteSequential::toPythonCode


function unserialize#

Unserializes the document.

virtual void SBDPaletteSequentialHCL::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER,
    const SBVersionNumber & classVersionNumber=SBVersionNumber (1, 0, 0)
) override

Implements SBDPaletteSequential::unserialize


function ~SBDPaletteSequentialHCL#

virtual SBDPaletteSequentialHCL::~SBDPaletteSequentialHCL ()