SAGA API v9.10
Loading...
Searching...
No Matches
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)
 CSG_Colors (const CSG_String &Palette, int nColors=0, bool bRevert=false)
bool Create (const CSG_String &Palette, int nColors=0, 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=0)
bool Set_Predefined (const CSG_String &Name, bool bRevert=false, int nColors=0)
bool Set_Palette (int Index, bool bRevert=false, int nColors=0)
bool Set_Palette (const CSG_String &Name, bool bRevert=false, int nColors=0)
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 Index, bool bWithIndex=true)

Detailed Description

Definition at line 1411 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Colors() [1/4]

CSG_Colors::CSG_Colors ( void )

Definition at line 172 of file api_colors.cpp.

References Create().

Referenced by Assign(), Assign(), Create(), CSG_Colors(), operator=(), and Set_Count().

◆ CSG_Colors() [2/4]

CSG_Colors::CSG_Colors ( const CSG_Colors & Colors)

Definition at line 180 of file api_colors.cpp.

References Create(), and CSG_Colors().

◆ CSG_Colors() [3/4]

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

Definition at line 188 of file api_colors.cpp.

References Create().

◆ CSG_Colors() [4/4]

CSG_Colors::CSG_Colors ( const CSG_String & Palette,
int nColors = 0,
bool bRevert = false )

Definition at line 196 of file api_colors.cpp.

References Create().

◆ ~CSG_Colors()

CSG_Colors::~CSG_Colors ( void )
virtual

Definition at line 204 of file api_colors.cpp.

References Destroy().

Member Function Documentation

◆ Assign() [1/2]

bool CSG_Colors::Assign ( const CSG_Colors & Colors)

Definition at line 1243 of file api_colors.cpp.

References Create(), and CSG_Colors().

◆ Assign() [2/2]

bool CSG_Colors::Assign ( CSG_Colors * pSource)

Definition at line 1249 of file api_colors.cpp.

References Create(), and CSG_Colors().

◆ Create() [1/4]

bool CSG_Colors::Create ( const CSG_Colors & Colors)

Definition at line 221 of file api_colors.cpp.

References CSG_Colors(), and SG_Realloc().

◆ Create() [2/4]

bool CSG_Colors::Create ( const CSG_String & Palette,
int nColors = 0,
bool bRevert = false )

Definition at line 243 of file api_colors.cpp.

References Set_Palette(), and SG_COLORS_DEFAULT.

◆ Create() [3/4]

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

Definition at line 237 of file api_colors.cpp.

References Set_Palette(), and SG_COLORS_DEFAULT.

◆ Create() [4/4]

◆ Destroy()

void CSG_Colors::Destroy ( void )

Definition at line 249 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 1447 of file api_core.h.

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

Referenced by Greyscale().

◆ Get_Color()

long CSG_Colors::Get_Color ( int Index) const
inline

Definition at line 1443 of file api_core.h.

Referenced by Get_Blue(), Get_Green(), Get_Red(), CSG_Parameter::is_Value_Equal(), and Revert().

◆ Get_Count()

int CSG_Colors::Get_Count ( void ) const
inline

◆ 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 1449 of file api_core.h.

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

Referenced by Set_Count().

◆ Get_Predefined_Count()

int CSG_Colors::Get_Predefined_Count ( void )
static

Definition at line 436 of file api_colors.cpp.

References SG_COLORS_COUNT.

Referenced by CSG_Parameter_Colors::_Set_Value().

◆ Get_Predefined_Name()

CSG_String CSG_Colors::Get_Predefined_Name ( int Index,
bool bWithIndex = true )
static

◆ Get_Red()

long CSG_Colors::Get_Red ( int Index) const
inline

◆ Greyscale()

bool CSG_Colors::Greyscale ( void )

Definition at line 1217 of file api_colors.cpp.

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

◆ Invert()

bool CSG_Colors::Invert ( void )

Definition at line 1193 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 1235 of file api_colors.cpp.

References Create(), and CSG_Colors().

◆ operator[]()

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

Definition at line 1434 of file api_core.h.

◆ Random()

bool CSG_Colors::Random ( void )

Definition at line 1178 of file api_colors.cpp.

References Get_Count(), and Set_Color().

◆ Revert()

bool CSG_Colors::Revert ( void )

Definition at line 1204 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 343 of file api_colors.cpp.

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

◆ Set_Brightness()

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

Definition at line 349 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 325 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 1049 of file api_colors.cpp.

References 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 337 of file api_colors.cpp.

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

◆ Set_Palette() [1/2]

bool CSG_Colors::Set_Palette ( const CSG_String & Name,
bool bRevert = false,
int nColors = 0 )
inline

Definition at line 1468 of file api_core.h.

References Set_Predefined().

◆ Set_Palette() [2/2]

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

Definition at line 1467 of file api_core.h.

References Set_Predefined().

Referenced by Create(), and Create().

◆ Set_Predefined() [1/2]

bool CSG_Colors::Set_Predefined ( const CSG_String & Name,
bool bRevert = false,
int nColors = 0 )

◆ Set_Predefined() [2/2]

bool CSG_Colors::Set_Predefined ( int Index,
bool bRevert = false,
int nColors = 0 )

Definition at line 523 of file api_colors.cpp.

References Revert(), Set_Color(), Set_Count(), Set_Default(), Set_Ramp(), Set_Ramp_Brighness(), SG_COLORS_ASPECT_1, SG_COLORS_ASPECT_2, SG_COLORS_ASPECT_3, SG_COLORS_BLACK_BLUE, SG_COLORS_BLACK_GREEN, SG_COLORS_BLACK_RED, SG_COLORS_BLACK_WHITE, SG_COLORS_BLUE_GREY_RED, SG_COLORS_BLUE_RED, SG_COLORS_BLUE_WHITE_RED, SG_COLORS_BLUE_YELLOW_RED, SG_COLORS_CYAN_WHITE, SG_COLORS_DEFAULT, SG_COLORS_DEFAULT_BRIGHT, SG_COLORS_GREEN_BLUE, SG_COLORS_GREEN_GREY_BLUE, SG_COLORS_GREEN_GREY_RED, SG_COLORS_GREEN_RED, SG_COLORS_GREEN_RED_BLUE, SG_COLORS_GREEN_WHITE_BLUE, SG_COLORS_GREEN_WHITE_RED, SG_COLORS_GREEN_YELLOW_BLUE, SG_COLORS_GREEN_YELLOW_RED, SG_COLORS_MAGENTA_WHITE, SG_COLORS_NEON, SG_COLORS_PRECIPITATION_1, SG_COLORS_PRECIPITATION_2, SG_COLORS_PRECIPITATION_3, SG_COLORS_PRECIPITATION_4, SG_COLORS_PRECIPITATION_5, SG_COLORS_RAINBOW, SG_COLORS_RAINBOW_2, SG_COLORS_RED_BLUE_GREEN, SG_COLORS_RED_GREEN_BLUE, SG_COLORS_RED_GREY_BLUE, SG_COLORS_RED_GREY_GREEN, SG_COLORS_RED_YELLOW_GREEN, SG_COLORS_SPECTRUM_1, SG_COLORS_SPECTRUM_2, SG_COLORS_SPECTRUM_3, SG_COLORS_THERMAL_1, SG_COLORS_THERMAL_2, SG_COLORS_TOPOGRAPHY, SG_COLORS_TOPOGRAPHY_2, SG_COLORS_TOPOGRAPHY_3, SG_COLORS_TOPOGRAPHY_4, SG_COLORS_VEGETATION, SG_COLORS_WHITE_BLUE, SG_COLORS_WHITE_GREEN, SG_COLORS_WHITE_RED, SG_COLORS_YELLOW_BLUE, SG_COLORS_YELLOW_GREEN, SG_COLORS_YELLOW_RED, SG_COLORS_YELLOW_WHITE, and SG_GET_RGB.

Referenced by CSG_Tool::DataObject_Set_Colors(), CSG_Tool::DataObject_Set_Colors(), Set_Palette(), Set_Palette(), and Set_Predefined().

◆ Set_Ramp() [1/2]

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

Definition at line 1074 of file api_colors.cpp.

References Get_Count(), and Set_Ramp().

Referenced by Set_Predefined(), and Set_Ramp().

◆ Set_Ramp() [2/2]

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

Definition at line 1080 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 1129 of file api_colors.cpp.

References Get_Count(), and Set_Ramp_Brighness().

Referenced by Set_Predefined(), and Set_Ramp_Brighness().

◆ 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 1135 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 331 of file api_colors.cpp.

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

◆ to_Text()

bool CSG_Colors::to_Text ( CSG_String & String)

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