gimpgradients

## gimpgradients gimpgradients — Operations related to gradients. |

## Synopsis

    gboolean            gimp_gradients_refresh              (void);
    gchar**             gimp_gradients_get_list             (const gchar *filter,
                                                             gint *num_gradients);
    gchar*              gimp_gradients_get_gradient         (void);
    gboolean            gimp_gradients_set_gradient         (const gchar *name);
    gdouble*            gimp_gradients_sample_uniform       (gint num_samples,
                                                             gboolean reverse);
    gdouble*            gimp_gradients_sample_custom        (gint num_samples,
                                                             const gdouble *positions,
                                                             gboolean reverse);
    gchar*              gimp_gradients_get_gradient_data    (const gchar *name,
                                                             gint sample_size,
                                                             gboolean reverse,
                                                             gint *width,
                                                             gdouble **grad_data);

## Description

Operations related to gradients.

## Details

### gimp_gradients_refresh ()

    gboolean            gimp_gradients_refresh              (void);

Refresh current gradients. This function always succeeds.

This procedure retrieves all gradients currently in the user's gradient path and updates the gradient dialogs accordingly.

Returns : | TRUE on success.

### gimp_gradients_get_list ()

    gchar**             gimp_gradients_get_list             (const gchar *filter,
                                                             gint *num_gradients);

Retrieve the list of loaded gradients.

This procedure returns a list of the gradients that are currently loaded. You can later use the `gimp_context_set_gradient()` function to set the active gradient.

`filter` : | An optional regular expression used to filter the list.
`num_gradients` : | The number of loaded gradients.
Returns : | The list of gradient names.

### gimp_gradients_get_gradient ()

    gchar*              gimp_gradients_get_gradient         (void);

### Warning

`gimp_gradients_get_gradient` is deprecated and should not be used in newly-written code.

This procedure is deprecated! Use `gimp_context_get_gradient()` instead.

Returns : | The name of the active gradient.

### gimp_gradients_set_gradient ()

    gboolean            gimp_gradients_set_gradient         (const gchar *name);

### Warning

`gimp_gradients_set_gradient` is deprecated and should not be used in newly-written code.

This procedure is deprecated! Use `gimp_context_set_gradient()` instead.

`name` : | The name of the gradient to set.
Returns : | TRUE on success.

### gimp_gradients_sample_uniform ()

    gdouble*            gimp_gradients_sample_uniform       (gint num_samples,
                                                             gboolean reverse);

### Warning

`gimp_gradients_sample_uniform` is deprecated and should not be used in newly-written code.

This procedure is deprecated! Use `gimp_gradient_get_uniform_samples()` instead.

`num_samples` : | The number of samples to take.
`reverse` : | Use the reverse gradient.
Returns : | Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.

### gimp_gradients_sample_custom ()

    gdouble*            gimp_gradients_sample_custom        (gint num_samples,
                                                             const gdouble *positions,
                                                             gboolean reverse);

### Warning

`gimp_gradients_sample_custom` is deprecated and should not be used in newly-written code.

This procedure is deprecated! Use `gimp_gradient_get_custom_samples()` instead.

`num_samples` : | The number of samples to take.
`positions` : | The list of positions to sample along the gradient.
`reverse` : | Use the reverse gradient.
Returns : | Color samples: { R1, G1, B1, A1, ..., Rn, Gn, Bn, An }.

### gimp_gradients_get_gradient_data ()

    gchar*              gimp_gradients_get_gradient_data    (const gchar *name,
                                                             gint sample_size,
                                                             gboolean reverse,
                                                             gint *width,
                                                             gdouble **grad_data);

### Warning

`gimp_gradients_get_gradient_data` is deprecated and should not be used in newly-written code.

This procedure is deprecated! Use `gimp_gradient_get_uniform_samples()` instead.

`name` : | The gradient name (\"\" means current active gradient).
`sample_size` : | Size of the sample to return when the gradient is changed.
`reverse` : | Use the reverse gradient.
`width` : | The gradient sample width (r,g,b,a).
`grad_data` : | The gradient sample data.
Returns : | The gradient name.