![]() |
![]() |
Gwyddion Drawing Library Reference Manual | ![]() |
|
---|---|---|---|---|
#define GWY_PALETTE_BLUE #define GWY_PALETTE_BLUE_CYAN #define GWY_PALETTE_BLUE_VIOLET #define GWY_PALETTE_BLUE_YELLOW #define GWY_PALETTE_BW1 #define GWY_PALETTE_BW2 #define GWY_PALETTE_COLD #define GWY_PALETTE_DFIT #define GWY_PALETTE_GOLD #define GWY_PALETTE_GRAY #define GWY_PALETTE_GREEN #define GWY_PALETTE_GREEN_CYAN #define GWY_PALETTE_GREEN_VIOLET #define GWY_PALETTE_GREEN_YELLOW #define GWY_PALETTE_OLIVE #define GWY_PALETTE_PINK #define GWY_PALETTE_PM3D #define GWY_PALETTE_RAINBOW1 #define GWY_PALETTE_RAINBOW2 #define GWY_PALETTE_RED #define GWY_PALETTE_RED_CYAN #define GWY_PALETTE_RED_VIOLET #define GWY_PALETTE_RED_YELLOW #define GWY_PALETTE_SPECTRAL #define GWY_PALETTE_WARM #define GWY_PALETTE_YELLOW GwyPaletteDefEntry; GwyPaletteDef; GwyPaletteDefClass; void (*GwyPaletteDefFunc) (const gchar *name, GwyPaletteDef *palette_def, gpointer user_data); GObject* gwy_palette_def_new (const gchar *name); GObject* gwy_palette_def_new_as_copy (GwyPaletteDef *src_palette_def); gchar* gwy_palette_def_get_name (GwyPaletteDef *palette_def); gboolean gwy_palette_def_set_name (GwyPaletteDef *palette_def, const gchar *name); gboolean gwy_palette_def_exists (const gchar *name); void gwy_palette_def_foreach (GwyPaletteDefFunc callback, gpointer user_data); GwyRGBA gwy_palette_def_get_color (GwyPaletteDef *palette_def, gdouble x, GwyInterpolationType interpolation); void gwy_palette_def_set_color (GwyPaletteDef *palette_def, GwyPaletteDefEntry *val); void gwy_palette_def_set_from_samples (GwyPaletteDef *palette_def, GwyRGBA *samples, gint nsamples, gint istep); void gwy_palette_def_setup_presets (void); GString* gwy_palette_def_dump (GwyPaletteDef *palette_def); GwyPaletteDef* gwy_palette_def_parse (const gchar *text, gboolean rename_on_clash); #define gwy_palette_def_is_set (pd)
This type is broken, deprecated, and will be removed in 2.0. Use GwyGradient for new stuff.
A palette definition consists of defining points, between them the colors are interpolated to get a GwyPalette.
#define GWY_PALETTE_BLUE "Blue"
GWY_PALETTE_BLUE
is deprecated and should not be used in newly-written code.
A blue palette.
#define GWY_PALETTE_BLUE_CYAN "Blue-Cyan"
GWY_PALETTE_BLUE_CYAN
is deprecated and should not be used in newly-written code.
A black-blue-cyan-white palette.
#define GWY_PALETTE_BLUE_VIOLET "Blue-Violet"
GWY_PALETTE_BLUE_VIOLET
is deprecated and should not be used in newly-written code.
A black-blue-violet-white palette.
#define GWY_PALETTE_BLUE_YELLOW "Blue-Yellow"
GWY_PALETTE_BLUE_YELLOW
is deprecated and should not be used in newly-written code.
A black-blue-yellow-white palette.
#define GWY_PALETTE_BW1 "BW1"
GWY_PALETTE_BW1
is deprecated and should not be used in newly-written code.
A striped black-and-white palette with blended stripes.
#define GWY_PALETTE_BW2 "BW2"
GWY_PALETTE_BW2
is deprecated and should not be used in newly-written code.
A striped black-and-white palette with sharp stripes.
#define GWY_PALETTE_COLD "Cold"
GWY_PALETTE_COLD
is deprecated and should not be used in newly-written code.
A blue, cold palette.
#define GWY_PALETTE_DFIT "DFit"
GWY_PALETTE_DFIT
is deprecated and should not be used in newly-written code.
A light black-violet-red-yellow-green-blue-white palette resembling a dendrofit palette.
#define GWY_PALETTE_GOLD "Gold"
GWY_PALETTE_GOLD
is deprecated and should not be used in newly-written code.
A gold palette.
#define GWY_PALETTE_GRAY "Gray"
GWY_PALETTE_GRAY
is deprecated and should not be used in newly-written code.
A gray palette.
This is the default palette.
#define GWY_PALETTE_GREEN "Green"
GWY_PALETTE_GREEN
is deprecated and should not be used in newly-written code.
A green palette.
#define GWY_PALETTE_GREEN_CYAN "Green-Cyan"
GWY_PALETTE_GREEN_CYAN
is deprecated and should not be used in newly-written code.
A black-green-cyan-white palette.
#define GWY_PALETTE_GREEN_VIOLET "Green-Violet"
GWY_PALETTE_GREEN_VIOLET
is deprecated and should not be used in newly-written code.
A black-green-violet-white palette.
#define GWY_PALETTE_GREEN_YELLOW "Green-Yellow"
GWY_PALETTE_GREEN_YELLOW
is deprecated and should not be used in newly-written code.
A black-green-yellow-white palette.
#define GWY_PALETTE_OLIVE "Olive"
GWY_PALETTE_OLIVE
is deprecated and should not be used in newly-written code.
A plive palette.
#define GWY_PALETTE_PINK "Pink"
GWY_PALETTE_PINK
is deprecated and should not be used in newly-written code.
A pink palette.
#define GWY_PALETTE_PM3D "Pm3d"
GWY_PALETTE_PM3D
is deprecated and should not be used in newly-written code.
A black-blue-red-gold palette strongly resembling default pm3d palette.
#define GWY_PALETTE_RAINBOW1 "Rainbow1"
GWY_PALETTE_RAINBOW1
is deprecated and should not be used in newly-written code.
A colorful rainbow palette.
#define GWY_PALETTE_RAINBOW2 "Rainbow2"
GWY_PALETTE_RAINBOW2
is deprecated and should not be used in newly-written code.
A black-red-green-blue-white palette.
#define GWY_PALETTE_RED "Red"
GWY_PALETTE_RED
is deprecated and should not be used in newly-written code.
A red palette.
#define GWY_PALETTE_RED_CYAN "Red-Cyan"
GWY_PALETTE_RED_CYAN
is deprecated and should not be used in newly-written code.
A black-red-cyan-white palette.
#define GWY_PALETTE_RED_VIOLET "Red-Violet"
GWY_PALETTE_RED_VIOLET
is deprecated and should not be used in newly-written code.
A black-red-violet-white palette.
#define GWY_PALETTE_RED_YELLOW "Red-Yellow"
GWY_PALETTE_RED_YELLOW
is deprecated and should not be used in newly-written code.
A black-red-yellow-white palette.
#define GWY_PALETTE_SPECTRAL "Spectral"
GWY_PALETTE_SPECTRAL
is deprecated and should not be used in newly-written code.
A palette resembling spectral colors (starting and ending with black).
#define GWY_PALETTE_WARM "Warm"
GWY_PALETTE_WARM
is deprecated and should not be used in newly-written code.
A red-yellow, warm palette.
#define GWY_PALETTE_YELLOW "Yellow"
GWY_PALETTE_YELLOW
is deprecated and should not be used in newly-written code.
A yellowish palette.
typedef struct { gdouble x; GwyRGBA color; } GwyPaletteDefEntry;
GwyPaletteDefEntry
is deprecated and should not be used in newly-written code.
Palette definition entry type.
The x
coordinate is from the range [0,1].
typedef struct _GwyPaletteDef GwyPaletteDef;
GwyPaletteDef
is deprecated and should not be used in newly-written code.
The GwyPaletteDef struct contains private data only and should be accessed using the functions below.
typedef struct { GObjectClass parent_class; GHashTable *palettes; } GwyPaletteDefClass;
GwyPaletteDefClass
is deprecated and should not be used in newly-written code.
void (*GwyPaletteDefFunc) (const gchar *name, GwyPaletteDef *palette_def, gpointer user_data);
GwyPaletteDefFunc
is deprecated and should not be used in newly-written code.
Callback function type for gwy_palette_def_foreach()
.
name : |
Palette definition name. |
palette_def : |
Palette definition. |
user_data : |
A user-specified pointer. |
GObject* gwy_palette_def_new (const gchar *name);
gwy_palette_def_new
is deprecated and should not be used in newly-written code.
Returns a palette definition called name
.
Palette definitions of the same name are singletons, thus if a palette
definitions called name
already exists, it is returned instead (with
reference count incremented).
name
can be NULL
, a new unique name is invented then.
A newly created palette definition is completely empty.
name : |
Palette name. |
Returns : | The new palette definition as a GObject. |
GObject* gwy_palette_def_new_as_copy (GwyPaletteDef *src_palette_def);
gwy_palette_def_new_as_copy
is deprecated and should not be used in newly-written code.
Creates a new palette definition as a copy of an existing one.
A new name is invented based on the existing one.
src_palette_def : |
An existing GwyPaletteDef. |
Returns : | The new palette definition as a GObject. |
gchar* gwy_palette_def_get_name (GwyPaletteDef *palette_def);
gwy_palette_def_get_name
is deprecated and should not be used in newly-written code.
Returns the name of palette definition palette_def
.
palette_def : |
A GwyPaletteDef. |
Returns : | The name. It should be considered constant and not modifier or freed. |
gboolean gwy_palette_def_set_name (GwyPaletteDef *palette_def, const gchar *name);
gwy_palette_def_set_name
is deprecated and should not be used in newly-written code.
Sets the name of a palette definition.
This function fails when a palette definition of given name already exists.
palette_def : |
A GwyPaletteDef. |
name : |
A new name of the palette definition. |
Returns : | Whether the rename was successfull. |
gboolean gwy_palette_def_exists (const gchar *name);
gwy_palette_def_exists
is deprecated and should not be used in newly-written code.
Tests whether a palette definition of given name exists.
void gwy_palette_def_foreach (GwyPaletteDefFunc callback, gpointer user_data);
gwy_palette_def_foreach
is deprecated and should not be used in newly-written code.
Runs callback
for each existing palette definition.
callback : |
A callback. |
user_data : |
User data passed to the callback. |
GwyRGBA gwy_palette_def_get_color (GwyPaletteDef *palette_def, gdouble x, GwyInterpolationType interpolation);
gwy_palette_def_get_color
is deprecated and should not be used in newly-written code.
Finds the color at position x
between 0 and gwy_palette_def_get_n()
.
Interpolates between palette definition entries closest to x
and returns the resulting color.
palette_def : |
palette definition of interest |
x : |
position (0-N) |
interpolation : |
interpolation method |
Returns : | the color sample. |
void gwy_palette_def_set_color (GwyPaletteDef *palette_def, GwyPaletteDefEntry *val);
gwy_palette_def_set_color
is deprecated and should not be used in newly-written code.
Adds an entry to palette definition.
palette_def : |
A palette definition to be changed. |
val : |
An entry to be added. |
void gwy_palette_def_set_from_samples (GwyPaletteDef *palette_def, GwyRGBA *samples, gint nsamples, gint istep);
gwy_palette_def_set_from_samples
is deprecated and should not be used in newly-written code.
Fits the palette definition to given color samples.
It finds the extrema points inside palette color tables and
tries to setup the palette definition to fit the color tables.
This fucntion should be used only when there is a reason
for doing this, for example after some graphical entry
of palette color table values. Parameter istep
controls
the precision of the linear fit.
However, the precise algorithm may change in the future.
palette_def : |
A GwyPaletteDef to be computed. |
samples : |
Color data to ctreate the definition from. |
nsamples : |
The number of samples in samples .
|
istep : |
Maximum distance of definition entries, 0 means unlimited. |
void gwy_palette_def_setup_presets (void);
gwy_palette_def_setup_presets
is deprecated and should not be used in newly-written code.
Set up built-in palette definitions. To be used in Gwyddion initialization and eventually replaced by loading palette definitions from external files.
GString* gwy_palette_def_dump (GwyPaletteDef *palette_def);
gwy_palette_def_dump
is deprecated and should not be used in newly-written code.
Dumps a paletted definition to text.
palette_def : |
A palette definition. |
Returns : | A GString with palette text representation. |
Since 1.4.
GwyPaletteDef* gwy_palette_def_parse (const gchar *text, gboolean rename_on_clash);
gwy_palette_def_parse
is deprecated and should not be used in newly-written code.
Creates a palette defnition from a text dump.
text : |
A text palette definition dump, as created with
gwy_palette_def_dump() .
|
rename_on_clash : |
Whether the created palette should be renamed to an unique name instad of overwriting the existing one on a name clash. |
Returns : | The palette (NULL on failure).
|
Since 1.4.
#define gwy_palette_def_is_set(pd) (GWY_PALETTE_DEF(pd)->data->len)
gwy_palette_def_is_set
is deprecated and should not be used in newly-written code.
Expands to TRUE
if the palette definition contains any colors.
XXX: This is flawed. Unset palette definitions should not exist, though
currently gwy_palette_def_new()
creates them.
pd : |
A palette definition. |