GIMP Library Reference Manual | ||||
---|---|---|---|---|
Top | Description |
gint32 gimp_vectors_new (gint32 image_ID
,const gchar *name
); gint32 gimp_vectors_new_from_text_layer (gint32 image_ID
,gint32 layer_ID
); gint32 gimp_vectors_copy (gint32 vectors_ID
); gboolean gimp_vectors_is_valid (gint32 vectors_ID
); gint * gimp_vectors_get_strokes (gint32 vectors_ID
,gint *num_strokes
); gint32 gimp_vectors_get_image (gint32 vectors_ID
); gchar * gimp_vectors_get_name (gint32 vectors_ID
); gboolean gimp_vectors_set_name (gint32 vectors_ID
,const gchar *name
); gboolean gimp_vectors_get_visible (gint32 vectors_ID
); gboolean gimp_vectors_set_visible (gint32 vectors_ID
,gboolean visible
); gboolean gimp_vectors_get_linked (gint32 vectors_ID
); gboolean gimp_vectors_set_linked (gint32 vectors_ID
,gboolean linked
); gint gimp_vectors_get_tattoo (gint32 vectors_ID
); gboolean gimp_vectors_set_tattoo (gint32 vectors_ID
,gint tattoo
); gboolean gimp_vectors_remove_stroke (gint32 vectors_ID
,gint stroke_id
); gboolean gimp_vectors_to_selection (gint32 vectors_ID
,GimpChannelOps operation
,gboolean antialias
,gboolean feather
,gdouble feather_radius_x
,gdouble feather_radius_y
); gboolean gimp_vectors_export_to_file (gint32 image_ID
,const gchar *filename
,gint32 vectors_ID
); gchar * gimp_vectors_export_to_string (gint32 image_ID
,gint32 vectors_ID
); gboolean gimp_vectors_import_from_file (gint32 image_ID
,const gchar *filename
,gboolean merge
,gboolean scale
,gint *num_vectors
,gint32 **vectors_ids
); gboolean gimp_vectors_import_from_string (gint32 image_ID
,const gchar *string
,gint length
,gboolean merge
,gboolean scale
,gint *num_vectors
,gint32 **vectors_ids
); gboolean gimp_vectors_parasite_attach (gint32 vectors_ID
,const GimpParasite *parasite
); gboolean gimp_vectors_parasite_detach (gint32 vectors_ID
,const gchar *name
); GimpParasite * gimp_vectors_parasite_find (gint32 vectors_ID
,const gchar *name
); gboolean gimp_vectors_parasite_list (gint32 vectors_ID
,gint *num_parasites
,gchar ***parasites
); gint gimp_vectors_stroke_new_from_points (gint32 vectors_ID
,GimpVectorsStrokeType type
,gint num_points
,const gdouble *controlpoints
,gboolean closed
); gboolean gimp_vectors_stroke_close (gint32 vectors_ID
,gint stroke_id
); gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID
,gint stroke_id
,gdouble precision
); GimpVectorsStrokeType gimp_vectors_stroke_get_points (gint32 vectors_ID
,gint stroke_id
,gint *num_points
,gdouble **controlpoints
,gboolean *closed
); gboolean gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID
,gint stroke_id
,gdouble dist
,gdouble precision
,gdouble *x_point
,gdouble *y_point
,gdouble *slope
,gboolean *valid
); gdouble * gimp_vectors_stroke_interpolate (gint32 vectors_ID
,gint stroke_id
,gdouble precision
,gint *num_coords
,gboolean *closed
); gboolean gimp_vectors_stroke_scale (gint32 vectors_ID
,gint stroke_id
,gdouble scale_x
,gdouble scale_y
); gboolean gimp_vectors_stroke_translate (gint32 vectors_ID
,gint stroke_id
,gint off_x
,gint off_y
); gboolean gimp_vectors_stroke_flip (gint32 vectors_ID
,gint stroke_id
,GimpOrientationType flip_type
,gdouble axis
); gboolean gimp_vectors_stroke_flip_free (gint32 vectors_ID
,gint stroke_id
,gdouble x1
,gdouble y1
,gdouble x2
,gdouble y2
); gboolean gimp_vectors_stroke_rotate (gint32 vectors_ID
,gint stroke_id
,gdouble center_x
,gdouble center_y
,gdouble angle
); gboolean gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID
,gint stroke_id
,gdouble x0
,gdouble y0
,gdouble x1
,gdouble y1
); gboolean gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID
,gint stroke_id
,gdouble x0
,gdouble y0
,gdouble x1
,gdouble y1
,gdouble x2
,gdouble y2
); gboolean gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID
,gint stroke_id
,gdouble x0
,gdouble y0
); gint gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID
,gdouble x0
,gdouble y0
,gdouble radius_x
,gdouble radius_y
,gdouble angle
); gint gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID
,gdouble x0
,gdouble y0
);
gint32 gimp_vectors_new (gint32 image_ID
,const gchar *name
);
Creates a new empty vectors object.
Creates a new empty vectors object. The vectors object needs to be
added to the image using gimp_image_insert_vectors()
.
|
The image. |
|
the name of the new vector object. |
Returns : |
the current vector object, 0 if no vector exists in the image. |
Since GIMP 2.4
gint32 gimp_vectors_new_from_text_layer (gint32 image_ID
,gint32 layer_ID
);
Creates a new vectors object from a text layer.
Creates a new vectors object from a text layer. The vectors object
needs to be added to the image using gimp_image_insert_vectors()
.
|
The image. |
|
The text layer. |
Returns : |
The vectors of the text layer. |
Since GIMP 2.6
gint32 gimp_vectors_copy (gint32 vectors_ID
);
Copy a vectors object.
This procedure copies the specified vectors object and returns the copy.
|
The vectors object to copy. |
Returns : |
The newly copied vectors object. |
Since GIMP 2.6
gboolean gimp_vectors_is_valid (gint32 vectors_ID
);
gimp_vectors_is_valid
is deprecated and should not be used in newly-written code. Use gimp_item_is_valid()
instead.
|
The vectors object to check. |
Returns : |
Whether the vectors ID is valid. |
Since GIMP 2.4
gint * gimp_vectors_get_strokes (gint32 vectors_ID
,gint *num_strokes
);
List the strokes associated with the passed path.
Returns an Array with the stroke-IDs associated with the passed path.
|
The vectors object. |
|
The number of strokes returned. |
Returns : |
List of the strokes belonging to the path. |
Since GIMP 2.4
gint32 gimp_vectors_get_image (gint32 vectors_ID
);
gimp_vectors_get_image
is deprecated and should not be used in newly-written code. Use gimp_item_get_image()
instead.
|
The vectors object. |
Returns : |
The vectors image. |
Since GIMP 2.4
gchar * gimp_vectors_get_name (gint32 vectors_ID
);
gimp_vectors_get_name
is deprecated and should not be used in newly-written code. Use gimp_item_get_name()
instead.
|
The vectors object. |
Returns : |
The name of the vectors object. |
Since GIMP 2.4
gboolean gimp_vectors_set_name (gint32 vectors_ID
,const gchar *name
);
gimp_vectors_set_name
is deprecated and should not be used in newly-written code. Use gimp_item_set_name()
instead.
|
The vectors object. |
|
the new name of the path. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_get_visible (gint32 vectors_ID
);
gimp_vectors_get_visible
is deprecated and should not be used in newly-written code. Use gimp_item_get_visible()
instead.
|
The vectors object. |
Returns : |
TRUE if the path is visible, FALSE otherwise. |
Since GIMP 2.4
gboolean gimp_vectors_set_visible (gint32 vectors_ID
,gboolean visible
);
gimp_vectors_set_visible
is deprecated and should not be used in newly-written code. Use gimp_item_set_visible()
instead.
|
The vectors object. |
|
Whether the path is visible. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_get_linked (gint32 vectors_ID
);
gimp_vectors_get_linked
is deprecated and should not be used in newly-written code. Use gimp_item_get_linked()
instead.
|
The vectors object. |
Returns : |
TRUE if the path is linked, FALSE otherwise. |
Since GIMP 2.4
gboolean gimp_vectors_set_linked (gint32 vectors_ID
,gboolean linked
);
gimp_vectors_set_linked
is deprecated and should not be used in newly-written code. Use gimp_item_set_linked()
instead.
|
The vectors object. |
|
Whether the path is linked. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gint gimp_vectors_get_tattoo (gint32 vectors_ID
);
gimp_vectors_get_tattoo
is deprecated and should not be used in newly-written code. Use gimp_item_get_tattoo()
instead.
|
The vectors object. |
Returns : |
The vectors tattoo. |
Since GIMP 2.4
gboolean gimp_vectors_set_tattoo (gint32 vectors_ID
,gint tattoo
);
gimp_vectors_set_tattoo
is deprecated and should not be used in newly-written code. Use gimp_item_set_tattoo()
instead.
|
The vectors object. |
|
the new tattoo. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_remove_stroke (gint32 vectors_ID
,gint stroke_id
);
remove the stroke from a vectors object.
Remove the stroke from a vectors object.
|
The vectors object. |
|
The stroke ID. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_to_selection (gint32 vectors_ID
,GimpChannelOps operation
,gboolean antialias
,gboolean feather
,gdouble feather_radius_x
,gdouble feather_radius_y
);
gimp_vectors_to_selection
is deprecated and should not be used in newly-written code. Use gimp_image_select_item()
instead.
|
The vectors object to render to the selection. |
|
The desired operation with current selection. |
|
Antialias selection. |
|
Feather selection. |
|
Feather radius x. |
|
Feather radius y. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_export_to_file (gint32 image_ID
,const gchar *filename
,gint32 vectors_ID
);
save a path as an SVG file.
This procedure creates an SVG file to save a Vectors object, that is, a path. The resulting file can be edited using a vector graphics application, or later reloaded into GIMP. If you pass 0 as the 'vectors' argument, then all paths in the image will be exported.
|
The image. |
|
The name of the SVG file to create. |
|
The vectors object to be saved, or 0 for all in the image. |
Returns : |
TRUE on success. |
Since GIMP 2.6
gchar * gimp_vectors_export_to_string (gint32 image_ID
,gint32 vectors_ID
);
Save a path as an SVG string.
This procedure works like gimp_vectors_export_to_file()
but creates
a string rather than a file. The contents are a NUL-terminated
string that holds a complete XML document. If you pass 0 as the
'vectors' argument, then all paths in the image will be exported.
|
The image. |
|
The vectors object to save, or 0 for all in the image. |
Returns : |
A string whose contents are a complete SVG document. |
Since GIMP 2.6
gboolean gimp_vectors_import_from_file (gint32 image_ID
,const gchar *filename
,gboolean merge
,gboolean scale
,gint *num_vectors
,gint32 **vectors_ids
);
Import paths from an SVG file.
This procedure imports paths from an SVG file. SVG elements other than paths and basic shapes are ignored.
|
The image. |
|
The name of the SVG file to import. |
|
Merge paths into a single vectors object. |
|
Scale the SVG to image dimensions. |
|
The number of newly created vectors. |
|
The list of newly created vectors. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_import_from_string (gint32 image_ID
,const gchar *string
,gint length
,gboolean merge
,gboolean scale
,gint *num_vectors
,gint32 **vectors_ids
);
Import paths from an SVG string.
This procedure works like gimp_vectors_import_from_file()
but takes
a string rather than reading the SVG from a file. This allows you to
write scripts that generate SVG and feed it to GIMP.
|
The image. |
|
A string that must be a complete and valid SVG document. |
|
Number of bytes in string or -1 if the string is NULL terminated. |
|
Merge paths into a single vectors object. |
|
Scale the SVG to image dimensions. |
|
The number of newly created vectors. |
|
The list of newly created vectors. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_parasite_attach (gint32 vectors_ID
,const GimpParasite *parasite
);
gimp_vectors_parasite_attach
is deprecated and should not be used in newly-written code. Use gimp_item_attach_parasite()
instead.
|
The vectors object. |
|
The parasite to attach to a vectors object. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_parasite_detach (gint32 vectors_ID
,const gchar *name
);
gimp_vectors_parasite_detach
is deprecated and should not be used in newly-written code. Use gimp_item_detach_parasite()
instead.
|
The vectors object. |
|
The name of the parasite to detach from a vectors object. |
Returns : |
TRUE on success. |
Since GIMP 2.4
GimpParasite * gimp_vectors_parasite_find (gint32 vectors_ID
,const gchar *name
);
gimp_vectors_parasite_find
is deprecated and should not be used in newly-written code. Use gimp_item_get_parasite()
instead.
|
The vectors object. |
|
The name of the parasite to find. |
Returns : |
The found parasite. |
Since GIMP 2.4
gboolean gimp_vectors_parasite_list (gint32 vectors_ID
,gint *num_parasites
,gchar ***parasites
);
gimp_vectors_parasite_list
is deprecated and should not be used in newly-written code. Use gimp_item_get_parasite_list()
instead.
|
The vectors object. |
|
The number of attached parasites. |
|
The names of currently attached parasites. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gint gimp_vectors_stroke_new_from_points (gint32 vectors_ID
,GimpVectorsStrokeType type
,gint num_points
,const gdouble *controlpoints
,gboolean closed
);
Adds a stroke of a given type to the vectors object.
Adds a stroke of a given type to the vectors object. The coordinates of the control points can be specified. For now only strokes of the type GIMP_VECTORS_STROKE_TYPE_BEZIER are supported. The control points are specified as a pair of float values for the x- and y-coordinate. The Bezier stroke type needs a multiple of three control points. Each Bezier segment endpoint (anchor, A) has two additional control points (C) associated. They are specified in the order CACCACCAC...
|
The vectors object. |
|
type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now). |
|
The number of elements in the array, i.e. the number of controlpoints in the stroke * 2 (x- and y-coordinate). |
|
List of the x- and y-coordinates of the control points. |
|
Whether the stroke is to be closed or not. |
Returns : |
The stroke ID of the newly created stroke. |
Since GIMP 2.4
gboolean gimp_vectors_stroke_close (gint32 vectors_ID
,gint stroke_id
);
closes the specified stroke.
Closes the specified stroke.
|
The vectors object. |
|
The stroke ID. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gdouble gimp_vectors_stroke_get_length (gint32 vectors_ID
,gint stroke_id
,gdouble precision
);
Measure the length of the given stroke.
Measure the length of the given stroke.
|
The vectors object. |
|
The stroke ID. |
|
The precision used for the approximation. |
Returns : |
The length (in pixels) of the given stroke. |
Since GIMP 2.4
GimpVectorsStrokeType gimp_vectors_stroke_get_points (gint32 vectors_ID
,gint stroke_id
,gint *num_points
,gdouble **controlpoints
,gboolean *closed
);
returns the control points of a stroke.
returns the control points of a stroke. The interpretation of the coordinates returned depends on the type of the stroke. For Gimp 2.4 this is always a bezier stroke, where the coordinates are the control points.
|
The vectors object. |
|
The stroke ID. |
|
The number of floats returned. |
|
List of the control points for the stroke (x0, y0, x1, y1, ...). |
|
Whether the stroke is closed or not. |
Returns : |
type of the stroke (always GIMP_VECTORS_STROKE_TYPE_BEZIER for now). |
Since GIMP 2.4
gboolean gimp_vectors_stroke_get_point_at_dist (gint32 vectors_ID
,gint stroke_id
,gdouble dist
,gdouble precision
,gdouble *x_point
,gdouble *y_point
,gdouble *slope
,gboolean *valid
);
Get point at a specified distance along the stroke.
This will return the x,y position of a point at a given distance along the stroke. The distance will be obtained by first digitizing the curve internally and then walking along the curve. For a closed stroke the start of the path is the first point on the path that was created. This might not be obvious. If the stroke is not long enough, a \"valid\" flag will be FALSE.
|
The vectors object. |
|
The stroke ID. |
|
The given distance. |
|
The precision used for the approximation. |
|
The x position of the point. |
|
The y position of the point. |
|
The slope (dy / dx) at the specified point. |
|
Indicator for the validity of the returned data. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gdouble * gimp_vectors_stroke_interpolate (gint32 vectors_ID
,gint stroke_id
,gdouble precision
,gint *num_coords
,gboolean *closed
);
returns polygonal approximation of the stroke.
returns polygonal approximation of the stroke.
|
The vectors object. |
|
The stroke ID. |
|
The precision used for the approximation. |
|
The number of floats returned. |
|
Whether the stroke is closed or not. |
Returns : |
List of the coords along the path (x0, y0, x1, y1, ...). |
Since GIMP 2.4
gboolean gimp_vectors_stroke_scale (gint32 vectors_ID
,gint stroke_id
,gdouble scale_x
,gdouble scale_y
);
scales the given stroke.
Scale the given stroke.
|
The vectors object. |
|
The stroke ID. |
|
Scale factor in x direction. |
|
Scale factor in y direction. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_stroke_translate (gint32 vectors_ID
,gint stroke_id
,gint off_x
,gint off_y
);
translate the given stroke.
Translate the given stroke.
|
The vectors object. |
|
The stroke ID. |
|
Offset in x direction. |
|
Offset in y direction. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_stroke_flip (gint32 vectors_ID
,gint stroke_id
,GimpOrientationType flip_type
,gdouble axis
);
flips the given stroke.
Rotates the given stroke around given center by angle (in degrees).
|
The vectors object. |
|
The stroke ID. |
|
Flip orientation, either vertical or horizontal. |
|
axis coordinate about which to flip, in pixels. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_stroke_flip_free (gint32 vectors_ID
,gint stroke_id
,gdouble x1
,gdouble y1
,gdouble x2
,gdouble y2
);
flips the given stroke about an arbitrary axis.
Flips the given stroke about an arbitrary axis. Axis is defined by two coordinates in the image (in pixels), through which the flipping axis passes.
|
The vectors object. |
|
The stroke ID. |
|
X coordinate of the first point of the flipping axis. |
|
Y coordinate of the first point of the flipping axis. |
|
X coordinate of the second point of the flipping axis. |
|
Y coordinate of the second point of the flipping axis. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_stroke_rotate (gint32 vectors_ID
,gint stroke_id
,gdouble center_x
,gdouble center_y
,gdouble angle
);
rotates the given stroke.
Rotates the given stroke around given center by angle (in degrees).
|
The vectors object. |
|
The stroke ID. |
|
X coordinate of the rotation center. |
|
Y coordinate of the rotation center. |
|
angle to rotate about. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_bezier_stroke_conicto (gint32 vectors_ID
,gint stroke_id
,gdouble x0
,gdouble y0
,gdouble x1
,gdouble y1
);
Extends a bezier stroke with a conic bezier spline.
Extends a bezier stroke with a conic bezier spline. Actually a cubic bezier spline gets added that realizes the shape of a conic bezier spline.
|
The vectors object. |
|
The stroke ID. |
|
The x-coordinate of the control point. |
|
The y-coordinate of the control point. |
|
The x-coordinate of the end point. |
|
The y-coordinate of the end point. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_bezier_stroke_cubicto (gint32 vectors_ID
,gint stroke_id
,gdouble x0
,gdouble y0
,gdouble x1
,gdouble y1
,gdouble x2
,gdouble y2
);
Extends a bezier stroke with a cubic bezier spline.
Extends a bezier stroke with a cubic bezier spline.
|
The vectors object. |
|
The stroke ID. |
|
The x-coordinate of the first control point. |
|
The y-coordinate of the first control point. |
|
The x-coordinate of the second control point. |
|
The y-coordinate of the second control point. |
|
The x-coordinate of the end point. |
|
The y-coordinate of the end point. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gboolean gimp_vectors_bezier_stroke_lineto (gint32 vectors_ID
,gint stroke_id
,gdouble x0
,gdouble y0
);
Extends a bezier stroke with a lineto.
Extends a bezier stroke with a lineto.
|
The vectors object. |
|
The stroke ID. |
|
The x-coordinate of the lineto. |
|
The y-coordinate of the lineto. |
Returns : |
TRUE on success. |
Since GIMP 2.4
gint gimp_vectors_bezier_stroke_new_ellipse (gint32 vectors_ID
,gdouble x0
,gdouble y0
,gdouble radius_x
,gdouble radius_y
,gdouble angle
);
Adds a bezier stroke describing an ellipse the vectors object.
Adds a bezier stroke describing an ellipse the vectors object.
|
The vectors object. |
|
The x-coordinate of the center. |
|
The y-coordinate of the center. |
|
The radius in x direction. |
|
The radius in y direction. |
|
The angle the x-axis of the ellipse (radians, counterclockwise). |
Returns : |
The resulting stroke. |
Since GIMP 2.4
gint gimp_vectors_bezier_stroke_new_moveto (gint32 vectors_ID
,gdouble x0
,gdouble y0
);
Adds a bezier stroke with a single moveto to the vectors object.
Adds a bezier stroke with a single moveto to the vectors object.
|
The vectors object. |
|
The x-coordinate of the moveto. |
|
The y-coordinate of the moveto. |
Returns : |
The resulting stroke. |
Since GIMP 2.4