GimpGradient

GimpGradient

Synopsis

#define             GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE
                    GimpGradientSegment;
                    GimpGradient;
GimpData *          gimp_gradient_new                   (GimpContext *context,
                                                         const gchar *name);
GimpData *          gimp_gradient_get_standard          (GimpContext *context);
GimpGradientSegment * gimp_gradient_get_color_at        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos,
                                                         gboolean reverse,
                                                         GimpRGB *color);
GimpGradientSegment * gimp_gradient_get_segment_at      (GimpGradient *grad,
                                                         gdouble pos);
gboolean            gimp_gradient_has_fg_bg_segments    (GimpGradient *gradient);
GimpGradient *      gimp_gradient_flatten               (GimpGradient *gradient,
                                                         GimpContext *context);
gboolean            gimp_gradient_save_pov              (GimpGradient *gradient,
                                                         const gchar *filename,
                                                         GError **error);
GimpGradientSegment * gimp_gradient_segment_new         (void);
gdouble             gimp_gradient_segment_get_left_pos  (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
gdouble             gimp_gradient_segment_set_left_pos  (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos);
gdouble             gimp_gradient_segment_get_middle_pos
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
gdouble             gimp_gradient_segment_set_middle_pos
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos);
gdouble             gimp_gradient_segment_get_right_pos (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
gdouble             gimp_gradient_segment_set_right_pos (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos);
void                gimp_gradient_segment_get_left_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpRGB *color);
void                gimp_gradient_segment_set_left_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         const GimpRGB *color);
GimpGradientColor   gimp_gradient_segment_get_left_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
void                gimp_gradient_segment_set_left_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpGradientColor color_type);
void                gimp_gradient_segment_get_right_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpRGB *color);
void                gimp_gradient_segment_set_right_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         const GimpRGB *color);
GimpGradientColor   gimp_gradient_segment_get_right_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
void                gimp_gradient_segment_set_right_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpGradientColor color_type);
GimpGradientSegmentColor gimp_gradient_segment_get_coloring_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
GimpGradientSegmentType gimp_gradient_segment_get_blending_function
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);
void                gimp_gradient_segment_split_midpoint
                                                        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *lseg,
                                                         GimpGradientSegment **newl,
                                                         GimpGradientSegment **newr);
void                gimp_gradient_segment_split_uniform (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *lseg,
                                                         gint parts,
                                                         GimpGradientSegment **newl,
                                                         GimpGradientSegment **newr);
GimpGradientSegment * gimp_gradient_segment_get_last    (GimpGradientSegment *seg);
GimpGradientSegment * gimp_gradient_segment_get_first   (GimpGradientSegment *seg);
GimpGradientSegment * gimp_gradient_segment_get_nth     (GimpGradientSegment *seg,
                                                         gint index);
void                gimp_gradient_segment_free          (GimpGradientSegment *seg);
void                gimp_gradient_segments_free         (GimpGradientSegment *seg);
void                gimp_gradient_segment_range_delete  (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);
void                gimp_gradient_segment_range_set_coloring_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegmentColor new_color);
void                gimp_gradient_segment_range_set_blending_function
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegmentType new_type);
void                gimp_gradient_segment_range_flip    (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);
void                gimp_gradient_segment_range_replicate
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         gint replicate_times,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);
void                gimp_gradient_segment_range_split_uniform
                                                        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         gint parts,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);
void                gimp_gradient_segment_range_split_midpoint
                                                        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);
void                gimp_gradient_segment_range_recenter_handles
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg);
void                gimp_gradient_segment_range_redistribute_handles
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg);
gdouble             gimp_gradient_segment_range_move    (GimpGradient *gradient,
                                                         GimpGradientSegment *range_l,
                                                         GimpGradientSegment *range_r,
                                                         gdouble delta,
                                                         gboolean control_compress);
void                gimp_gradient_segment_range_compress
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *range_l,
                                                         GimpGradientSegment *range_r,
                                                         gdouble new_l,
                                                         gdouble new_r);
void                gimp_gradient_segment_range_blend   (GimpGradient *gradient,
                                                         GimpGradientSegment *lseg,
                                                         GimpGradientSegment *rseg,
                                                         const GimpRGB *rgb1,
                                                         const GimpRGB *rgb2,
                                                         gboolean blend_colors,
                                                         gboolean blend_opacity);

Object Hierarchy

  GObject
   +----GimpObject
         +----GimpViewable
               +----GimpData
                     +----GimpGradient

Implemented Interfaces

GimpGradient implements GimpConfigInterface and GimpTaggedInterface.

Description

Details

GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE

#define GIMP_GRADIENT_DEFAULT_SAMPLE_SIZE 40


GimpGradientSegment

typedef struct {
  gdouble                  left, middle, right;

  GimpGradientColor        left_color_type;
  GimpRGB                  left_color;
  GimpGradientColor        right_color_type;
  GimpRGB                  right_color;

  GimpGradientSegmentType  type;          /*  Segment's blending function  */
  GimpGradientSegmentColor color;         /*  Segment's coloring type      */

  GimpGradientSegment     *prev;
  GimpGradientSegment     *next;
} GimpGradientSegment;


GimpGradient

typedef struct _GimpGradient GimpGradient;


gimp_gradient_new ()

GimpData *          gimp_gradient_new                   (GimpContext *context,
                                                         const gchar *name);


gimp_gradient_get_standard ()

GimpData *          gimp_gradient_get_standard          (GimpContext *context);


gimp_gradient_get_color_at ()

GimpGradientSegment * gimp_gradient_get_color_at        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos,
                                                         gboolean reverse,
                                                         GimpRGB *color);

If you are iterating over an gradient, you should pass the the return value from the last call for seg.

gradient :

a gradient

context :

a context

seg :

a segment to seed the search with (or NULL)

pos :

position in the gradient (between 0.0 and 1.0)

reverse :

when TRUE, use the reversed gradient

color :

returns the color

Returns :

the gradient segment the color is from

gimp_gradient_get_segment_at ()

GimpGradientSegment * gimp_gradient_get_segment_at      (GimpGradient *grad,
                                                         gdouble pos);


gimp_gradient_has_fg_bg_segments ()

gboolean            gimp_gradient_has_fg_bg_segments    (GimpGradient *gradient);


gimp_gradient_flatten ()

GimpGradient *      gimp_gradient_flatten               (GimpGradient *gradient,
                                                         GimpContext *context);


gimp_gradient_save_pov ()

gboolean            gimp_gradient_save_pov              (GimpGradient *gradient,
                                                         const gchar *filename,
                                                         GError **error);


gimp_gradient_segment_new ()

GimpGradientSegment * gimp_gradient_segment_new         (void);


gimp_gradient_segment_get_left_pos ()

gdouble             gimp_gradient_segment_get_left_pos  (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_set_left_pos ()

gdouble             gimp_gradient_segment_set_left_pos  (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos);


gimp_gradient_segment_get_middle_pos ()

gdouble             gimp_gradient_segment_get_middle_pos
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_set_middle_pos ()

gdouble             gimp_gradient_segment_set_middle_pos
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos);


gimp_gradient_segment_get_right_pos ()

gdouble             gimp_gradient_segment_get_right_pos (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_set_right_pos ()

gdouble             gimp_gradient_segment_set_right_pos (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         gdouble pos);


gimp_gradient_segment_get_left_color ()

void                gimp_gradient_segment_get_left_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpRGB *color);


gimp_gradient_segment_set_left_color ()

void                gimp_gradient_segment_set_left_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         const GimpRGB *color);


gimp_gradient_segment_get_left_color_type ()

GimpGradientColor   gimp_gradient_segment_get_left_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_set_left_color_type ()

void                gimp_gradient_segment_set_left_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpGradientColor color_type);


gimp_gradient_segment_get_right_color ()

void                gimp_gradient_segment_get_right_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpRGB *color);


gimp_gradient_segment_set_right_color ()

void                gimp_gradient_segment_set_right_color
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         const GimpRGB *color);


gimp_gradient_segment_get_right_color_type ()

GimpGradientColor   gimp_gradient_segment_get_right_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_set_right_color_type ()

void                gimp_gradient_segment_set_right_color_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg,
                                                         GimpGradientColor color_type);


gimp_gradient_segment_get_coloring_type ()

GimpGradientSegmentColor gimp_gradient_segment_get_coloring_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_get_blending_function ()

GimpGradientSegmentType gimp_gradient_segment_get_blending_function
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *seg);


gimp_gradient_segment_split_midpoint ()

void                gimp_gradient_segment_split_midpoint
                                                        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *lseg,
                                                         GimpGradientSegment **newl,
                                                         GimpGradientSegment **newr);


gimp_gradient_segment_split_uniform ()

void                gimp_gradient_segment_split_uniform (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *lseg,
                                                         gint parts,
                                                         GimpGradientSegment **newl,
                                                         GimpGradientSegment **newr);


gimp_gradient_segment_get_last ()

GimpGradientSegment * gimp_gradient_segment_get_last    (GimpGradientSegment *seg);


gimp_gradient_segment_get_first ()

GimpGradientSegment * gimp_gradient_segment_get_first   (GimpGradientSegment *seg);


gimp_gradient_segment_get_nth ()

GimpGradientSegment * gimp_gradient_segment_get_nth     (GimpGradientSegment *seg,
                                                         gint index);


gimp_gradient_segment_free ()

void                gimp_gradient_segment_free          (GimpGradientSegment *seg);


gimp_gradient_segments_free ()

void                gimp_gradient_segments_free         (GimpGradientSegment *seg);


gimp_gradient_segment_range_delete ()

void                gimp_gradient_segment_range_delete  (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);


gimp_gradient_segment_range_set_coloring_type ()

void                gimp_gradient_segment_range_set_coloring_type
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegmentColor new_color);


gimp_gradient_segment_range_set_blending_function ()

void                gimp_gradient_segment_range_set_blending_function
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegmentType new_type);


gimp_gradient_segment_range_flip ()

void                gimp_gradient_segment_range_flip    (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);


gimp_gradient_segment_range_replicate ()

void                gimp_gradient_segment_range_replicate
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         gint replicate_times,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);


gimp_gradient_segment_range_split_uniform ()

void                gimp_gradient_segment_range_split_uniform
                                                        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         gint parts,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);


gimp_gradient_segment_range_split_midpoint ()

void                gimp_gradient_segment_range_split_midpoint
                                                        (GimpGradient *gradient,
                                                         GimpContext *context,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg,
                                                         GimpGradientSegment **final_start_seg,
                                                         GimpGradientSegment **final_end_seg);


gimp_gradient_segment_range_recenter_handles ()

void                gimp_gradient_segment_range_recenter_handles
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg);


gimp_gradient_segment_range_redistribute_handles ()

void                gimp_gradient_segment_range_redistribute_handles
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *start_seg,
                                                         GimpGradientSegment *end_seg);


gimp_gradient_segment_range_move ()

gdouble             gimp_gradient_segment_range_move    (GimpGradient *gradient,
                                                         GimpGradientSegment *range_l,
                                                         GimpGradientSegment *range_r,
                                                         gdouble delta,
                                                         gboolean control_compress);


gimp_gradient_segment_range_compress ()

void                gimp_gradient_segment_range_compress
                                                        (GimpGradient *gradient,
                                                         GimpGradientSegment *range_l,
                                                         GimpGradientSegment *range_r,
                                                         gdouble new_l,
                                                         gdouble new_r);


gimp_gradient_segment_range_blend ()

void                gimp_gradient_segment_range_blend   (GimpGradient *gradient,
                                                         GimpGradientSegment *lseg,
                                                         GimpGradientSegment *rseg,
                                                         const GimpRGB *rgb1,
                                                         const GimpRGB *rgb2,
                                                         gboolean blend_colors,
                                                         gboolean blend_opacity);