SAGA API v9.10
Loading...
Searching...
No Matches
api_colors.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include "api_core.h"
#include "mat_tools.h"

Go to the source code of this file.

Macros

#define MAKE_NAME(name)
#define COLORS_SERIAL_VERSION_BINARY   "SAGA_COLORPALETTE_VERSION_0.100_BINARY"
#define COLORS_SERIAL_VERSION__ASCII   "SAGA_COLORPALETTE_VERSION_0.100__ASCII"

Functions

CSG_String SG_Colors_Get_Name (int Index)
long SG_Color_Get_Random (void)
long SG_Color_From_RGB (int Red, int Green, int Blue, int Alpha)
bool SG_Color_From_Text (const CSG_String &Text, long &Color)
CSG_String SG_Color_To_Text (long Color, bool bHexadecimal)

Macro Definition Documentation

◆ COLORS_SERIAL_VERSION__ASCII

#define COLORS_SERIAL_VERSION__ASCII   "SAGA_COLORPALETTE_VERSION_0.100__ASCII"

Definition at line 1261 of file api_colors.cpp.

Referenced by CSG_Colors::Load(), and CSG_Colors::Save().

◆ COLORS_SERIAL_VERSION_BINARY

#define COLORS_SERIAL_VERSION_BINARY   "SAGA_COLORPALETTE_VERSION_0.100_BINARY"

Definition at line 1260 of file api_colors.cpp.

Referenced by CSG_Colors::Load(), and CSG_Colors::Save().

◆ MAKE_NAME

#define MAKE_NAME ( name)
Value:
(bWithIndex ? CSG_String::Format("[%d] %s", Index, name) : CSG_String(name))
static CSG_String Format(const char *Format,...)

Referenced by CSG_Colors::Get_Predefined_Name().

Function Documentation

◆ SG_Color_From_RGB()

long SG_Color_From_RGB ( int Red,
int Green,
int Blue,
int Alpha )

Definition at line 79 of file api_colors.cpp.

References SG_GET_RGBA.

◆ SG_Color_From_Text()

bool SG_Color_From_Text ( const CSG_String & Text,
long & Color )

◆ SG_Color_Get_Random()

long SG_Color_Get_Random ( void )

Definition at line 73 of file api_colors.cpp.

References CSG_Random::Get_Uniform(), and SG_GET_RGB.

◆ SG_Color_To_Text()

CSG_String SG_Color_To_Text ( long Color,
bool bHexadecimal )

Definition at line 144 of file api_colors.cpp.

References CSG_String::Printf(), SG_GET_B, SG_GET_G, and SG_GET_R.

◆ SG_Colors_Get_Name()

CSG_String SG_Colors_Get_Name ( int Index)

Definition at line 67 of file api_colors.cpp.

References CSG_Colors::Get_Predefined_Name().