SAGA API  v9.5
CSG_Colors Class Reference

#include <api_core.h>

Public Member Functions

 CSG_Colors (void)
 
bool Create (void)
 
 CSG_Colors (const CSG_Colors &Colors)
 
bool Create (const CSG_Colors &Colors)
 
 CSG_Colors (int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
 
bool Create (int nColors, int Palette=SG_COLORS_DEFAULT, bool bRevert=false)
 
virtual ~CSG_Colors (void)
 
void Destroy (void)
 
bool Set_Count (int nColors)
 
int Get_Count (void) const
 
CSG_Colorsoperator= (const CSG_Colors &Colors)
 
long & operator[] (int Index)
 
bool Set_Color (int Index, long Color)
 
bool Set_Color (int Index, int Red, int Green, int Blue)
 
bool Set_Red (int Index, int Value)
 
bool Set_Green (int Index, int Value)
 
bool Set_Blue (int Index, int Value)
 
bool Set_Brightness (int Index, int Value)
 
long Get_Color (int Index) const
 
long Get_Red (int Index) const
 
long Get_Green (int Index) const
 
long Get_Blue (int Index) const
 
long Get_Brightness (int Index) const
 
long Get_Interpolated (double Index) const
 
bool Set_Predefined (int Index, bool bRevert=false, int nColors=11)
 
bool Set_Palette (int Index, bool bRevert=false, int nColors=11)
 
bool Set_Default (int nColors=11)
 
bool Set_Ramp (long Color_A, long Color_B)
 
bool Set_Ramp (long Color_A, long Color_B, int iColor_A, int iColor_B)
 
bool Set_Ramp_Brighness (int Brightness_A, int Brightness_B)
 
bool Set_Ramp_Brighness (int Brightness_A, int Brightness_B, int iColor_A, int iColor_B)
 
bool Random (void)
 
bool Invert (void)
 
bool Revert (void)
 
bool Greyscale (void)
 
bool Assign (const CSG_Colors &Colors)
 
bool Assign (CSG_Colors *pSource)
 
bool Load (const CSG_String &File_Name)
 
bool Save (const CSG_String &File_Name, bool bBinary)
 
bool Serialize (CSG_File &Stream, bool bSave, bool bBinary)
 
bool to_Text (CSG_String &String)
 
bool from_Text (const CSG_String &String)
 

Static Public Member Functions

static int Get_Predefined_Count (void)
 
static CSG_String Get_Predefined_Name (int Identifier)
 

Detailed Description

Definition at line 1337 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Colors() [1/3]

CSG_Colors::CSG_Colors ( void  )

Definition at line 172 of file api_colors.cpp.

References Create().

◆ CSG_Colors() [2/3]

CSG_Colors::CSG_Colors ( const CSG_Colors Colors)

Definition at line 181 of file api_colors.cpp.

References Create().

◆ CSG_Colors() [3/3]

CSG_Colors::CSG_Colors ( int  nColors,
int  Palette = SG_COLORS_DEFAULT,
bool  bRevert = false 
)

Definition at line 190 of file api_colors.cpp.

References Create().

◆ ~CSG_Colors()

CSG_Colors::~CSG_Colors ( void  )
virtual

Definition at line 199 of file api_colors.cpp.

References Destroy().

Member Function Documentation

◆ Assign() [1/2]

bool CSG_Colors::Assign ( const CSG_Colors Colors)

Definition at line 1037 of file api_colors.cpp.

References Create().

Referenced by CSG_Parameter_Colors::_Assign().

◆ Assign() [2/2]

bool CSG_Colors::Assign ( CSG_Colors pSource)

Definition at line 1043 of file api_colors.cpp.

References Create().

◆ Create() [1/3]

bool CSG_Colors::Create ( const CSG_Colors Colors)

Definition at line 216 of file api_colors.cpp.

References SG_Realloc().

◆ Create() [2/3]

bool CSG_Colors::Create ( int  nColors,
int  Palette = SG_COLORS_DEFAULT,
bool  bRevert = false 
)

Definition at line 232 of file api_colors.cpp.

References Set_Count(), and Set_Palette().

◆ Create() [3/3]

bool CSG_Colors::Create ( void  )

◆ Destroy()

void CSG_Colors::Destroy ( void  )

Definition at line 247 of file api_colors.cpp.

References SG_Free().

Referenced by ~CSG_Colors().

◆ from_Text()

bool CSG_Colors::from_Text ( const CSG_String String)

◆ Get_Blue()

long CSG_Colors::Get_Blue ( int  Index) const
inline

◆ Get_Brightness()

long CSG_Colors::Get_Brightness ( int  Index) const
inline

Definition at line 1370 of file api_core.h.

Referenced by Greyscale().

◆ Get_Color()

long CSG_Colors::Get_Color ( int  Index) const
inline

Definition at line 1366 of file api_core.h.

Referenced by CSG_Parameter::is_Value_Equal(), and Revert().

◆ Get_Count()

◆ Get_Green()

long CSG_Colors::Get_Green ( int  Index) const
inline

◆ Get_Interpolated()

long CSG_Colors::Get_Interpolated ( double  Index) const
inline

Definition at line 1372 of file api_core.h.

References SG_GET_RGB.

Referenced by Set_Count().

◆ Get_Predefined_Count()

int CSG_Colors::Get_Predefined_Count ( void  )
static

Definition at line 435 of file api_colors.cpp.

References SG_COLORS_COUNT.

Referenced by CSG_Parameter_Colors::_Set_Value().

◆ Get_Predefined_Name()

◆ Get_Red()

long CSG_Colors::Get_Red ( int  Index) const
inline

◆ Greyscale()

bool CSG_Colors::Greyscale ( void  )

Definition at line 1011 of file api_colors.cpp.

References Get_Brightness(), Get_Count(), and Set_Color().

◆ Invert()

bool CSG_Colors::Invert ( void  )

Definition at line 987 of file api_colors.cpp.

References Get_Blue(), Get_Count(), Get_Green(), Get_Red(), and Set_Color().

◆ Load()

◆ operator=()

CSG_Colors & CSG_Colors::operator= ( const CSG_Colors Colors)

Definition at line 1029 of file api_colors.cpp.

References Create().

◆ operator[]()

long& CSG_Colors::operator[] ( int  Index)
inline

Definition at line 1357 of file api_core.h.

◆ Random()

bool CSG_Colors::Random ( void  )

Definition at line 972 of file api_colors.cpp.

References Get_Count(), and Set_Color().

Referenced by Set_Predefined().

◆ Revert()

bool CSG_Colors::Revert ( void  )

Definition at line 998 of file api_colors.cpp.

References Get_Color(), Get_Count(), and Set_Color().

Referenced by Set_Predefined().

◆ Save()

bool CSG_Colors::Save ( const CSG_String File_Name,
bool  bBinary 
)

◆ Serialize()

◆ Set_Blue()

bool CSG_Colors::Set_Blue ( int  Index,
int  Value 
)

Definition at line 342 of file api_colors.cpp.

References Get_Green(), Get_Red(), and Set_Color().

Referenced by CSG_Parameter_Colors::_Serialize().

◆ Set_Brightness()

bool CSG_Colors::Set_Brightness ( int  Index,
int  Value 
)

Definition at line 348 of file api_colors.cpp.

References Get_Blue(), Get_Green(), Get_Red(), and Set_Color().

Referenced by Set_Ramp_Brighness().

◆ Set_Color() [1/2]

bool CSG_Colors::Set_Color ( int  Index,
int  Red,
int  Green,
int  Blue 
)

Definition at line 324 of file api_colors.cpp.

References Set_Color(), and SG_GET_RGB.

◆ Set_Color() [2/2]

bool CSG_Colors::Set_Color ( int  Index,
long  Color 
)

◆ Set_Count()

bool CSG_Colors::Set_Count ( int  nColors)

◆ Set_Default()

bool CSG_Colors::Set_Default ( int  nColors = 11)

Definition at line 843 of file api_colors.cpp.

References Get_Count(), M_PI, Set_Color(), and SG_Realloc().

Referenced by Set_Count(), and Set_Predefined().

◆ Set_Green()

bool CSG_Colors::Set_Green ( int  Index,
int  Value 
)

Definition at line 336 of file api_colors.cpp.

References Get_Blue(), Get_Red(), and Set_Color().

Referenced by CSG_Parameter_Colors::_Serialize().

◆ Set_Palette()

bool CSG_Colors::Set_Palette ( int  Index,
bool  bRevert = false,
int  nColors = 11 
)
inline

Definition at line 1389 of file api_core.h.

Referenced by Create().

◆ Set_Predefined()

◆ Set_Ramp() [1/2]

bool CSG_Colors::Set_Ramp ( long  Color_A,
long  Color_B 
)

Definition at line 868 of file api_colors.cpp.

References Get_Count().

Referenced by Set_Predefined().

◆ Set_Ramp() [2/2]

bool CSG_Colors::Set_Ramp ( long  Color_A,
long  Color_B,
int  iColor_A,
int  iColor_B 
)

Definition at line 874 of file api_colors.cpp.

References Get_Count(), Set_Color(), SG_GET_B, SG_GET_G, and SG_GET_R.

◆ Set_Ramp_Brighness() [1/2]

bool CSG_Colors::Set_Ramp_Brighness ( int  Brightness_A,
int  Brightness_B 
)

Definition at line 923 of file api_colors.cpp.

References Get_Count().

Referenced by Set_Predefined().

◆ Set_Ramp_Brighness() [2/2]

bool CSG_Colors::Set_Ramp_Brighness ( int  Brightness_A,
int  Brightness_B,
int  iColor_A,
int  iColor_B 
)

Definition at line 929 of file api_colors.cpp.

References Get_Count(), and Set_Brightness().

◆ Set_Red()

bool CSG_Colors::Set_Red ( int  Index,
int  Value 
)

Definition at line 330 of file api_colors.cpp.

References Get_Blue(), Get_Green(), and Set_Color().

Referenced by CSG_Parameter_Colors::_Serialize().

◆ to_Text()

bool CSG_Colors::to_Text ( CSG_String String)

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