Gimp.gradient_get_custom_samples
Description: Reference for Gimp.gradient_get_custom_samples

### Function

# Gimpgradient_get_custom_samples

since: 2.2

#### Declaration [src]

    gboolean
    gimp_gradient_get_custom_samples (
      const gchar* name,
      gint num_samples,
      const gdouble* positions,
      gboolean reverse,
      gint* num_color_samples,
      gdouble** color_samples
    )

#### Description [src]

Sample the specified gradient in custom positions.

This procedure samples the active gradient in the specified number of points. The procedure will sample the gradient in the specified positions from the list. The left endpoint of the gradient corresponds to position 0.0, and the right endpoint corresponds to 1.0. The procedure returns a list of floating-point values which correspond to the RGBA values for each sample.

Available since: 2.2

#### Parameters

`name`

  Type: `const gchar*`

  The gradient name.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.

`num_samples`

  Type: `gint`

  The number of samples to take.

`positions`

  Type: An array of `double`

  The list of positions to sample along the gradient.

  The length of the array is specified in the `num_samples` argument.
  The data is owned by the caller of the function.

`reverse`

  Type: `gboolean`

  Use the reverse gradient.

`num_color_samples`

  Type: `gint*`

  Length of the color_samples array (4 * num_samples).

  The argument will be set by the function.

`color_samples`

  Type: An array of `double`

  Color samples: { R1, G1, B1, A1, …, Rn, Gn, Bn, An }.

  The argument will be set by the function.
  The length of the array is specified in the `num_color_samples` argument.
  The called function takes ownership of the data, and is responsible for freeing it.

#### Return value

Type: `gboolean`

TRUE on success.