"the name of the path whose points should be listed"
}
};
static ProcArg path_get_points_outargs[] =
{
{
PDB_INT32,
"path_type",
"The type of the path. Currently only one type (1 = Bezier) is supported"
},
{
PDB_INT32,
"path_closed",
"Return if the path is closed. {0=path open, 1= path closed}"
},
{
PDB_INT32,
"num_path_point_details",
"The number of points returned. Each point is made up of (x,y,pnt_type) of floats"
},
{
PDB_FLOATARRAY,
"points_pairs",
"The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be {1.0= BEZIER_ANCHOR, 2.0= BEZIER_CONTROL}. Note all points are returned in pixel resolution"
}
};
static ProcRecord path_get_points_proc =
{
"gimp_path_get_points",
"List the points associated with the named path.",
"List the points associated with the named path.",
"Andy Thomas",
"Andy Thomas",
"1999",
PDB_INTERNAL,
2,
path_get_points_inargs,
4,
path_get_points_outargs,
{ { path_get_points_invoker } }
};
static Argument *
path_get_current_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
PathList *plist;
Path *pptr = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
if (success)
{
/* Get the path with the given name */
plist = gimage->paths;
if (plist && plist->bz_paths && plist->last_selected_row >= 0)
"The name of the path to create (if it exists then a unique name will be created - query the list of paths if you want to make sure that the name of the path you create is unique. This will be set as the current path."
},
{
PDB_INT32,
"ptype",
"The type of the path. Currently only one type (1 = Bezier) is supported"
},
{
PDB_INT32,
"num_path_points",
"The number of points in the path. Each point is made up of (x,y,type) of floats. Currently only the creation of bezier curves is allowed. The type parameter must be set to (1) to indicate a BEZIER type curve. For BEZIERS. Note the that points must be given in the following order... ACCACCAC ... If the path is not closed the last control point is missed off. Points consist of three control points (control/anchor/control) so for a curve that is not closed there must be at least two points passed (2 x,y pairs). If num_path_pnts % 3 = 0 then the path is assumed to be closed and the points are ACCACCACCACC."
},
{
PDB_FLOATARRAY,
"points_pairs",
"The points in the path represented as 3 floats. The first is the x pos, next is the y pos, last is the type of the pnt. The type field is dependant on the path type. For beziers (type 1 paths) the type can either be {1.0= BEZIER_ANCHOR, 2.0= BEZIER_CONTROL}. Note all points are returned in pixel resolution"
}
};
static ProcRecord path_set_points_proc =
{
"gimp_path_set_points",
"Set the points associated with the named path.",
"Set the points associated with the named path.",
"Andy Thomas",
"Andy Thomas",
"1999",
PDB_INTERNAL,
5,
path_set_points_inargs,
0,
NULL,
{ { path_set_points_invoker } }
};
static Argument *
path_stroke_current_invoker (Argument *args)
{
gboolean success = TRUE;
GimpImage *gimage;
PathList *plist;
Path *pptr = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
if (success)
{
/* Get the path with the given name */
plist = gimage->paths;
if (plist && plist->bz_paths && plist->last_selected_row >= 0)
{
if ((pptr = (Path*) g_slist_nth_data (plist->bz_paths,
plist->last_selected_row)))
path_stroke (gimage, plist, pptr); /* Found the path to stroke.. */
"Get point on a path at a specified distance along the path.",
"This will return the x,y position of a point at a given distance along the bezier curve. The distance will the obtained by first digitizing the curve internally an then walking along the curve. For a closed curve the start of the path is the first point on the path that was created. This might not be obvious. Note the current path is used.",
"the name of the path whose tattoo should be obtained"
}
};
static ProcArg path_get_tattoo_outargs[] =
{
{
PDB_INT32,
"tattoo",
"The tattoo associated with the name path"
}
};
static ProcRecord path_get_tattoo_proc =
{
"gimp_path_get_tattoo",
"Returns the tattoo associated with the name path.",
"This procedure returns the tattoo associated with the specified path. A tattoo is a unique and permanent identifier attached to a path that can be used to uniquely identify a path within an image even between sessions.",
"Andy Thomas",
"Andy Thomas",
"1999",
PDB_INTERNAL,
2,
path_get_tattoo_inargs,
1,
path_get_tattoo_outargs,
{ { path_get_tattoo_invoker } }
};
static Argument *
get_path_by_tattoo_invoker (Argument *args)
{
gboolean success = TRUE;
Argument *return_args;
GimpImage *gimage;
gint32 tattoo;
PathList *plist;
Path *pptr = NULL;
gimage = pdb_id_to_image (args[0].value.pdb_int);
if (gimage == NULL)
success = FALSE;
tattoo = args[1].value.pdb_int;
if (success)
{
/* Get the path with the given name */
plist = gimage->paths;
if (plist && plist->bz_paths)
{
if ((pptr = path_get_path_by_tattoo (gimage, tattoo)) == NULL)
"Return the name of the path with the given tattoo.",
"The procedure returns the name of the path in the specified image which has the passed tattoo. The tattoos are unique within the image and will be preserved across sessions and through renaming of the path. An error is returned if no path woth the specified tattoo can be found.",
"the name of the path whose locked status should be obtained"
}
};
static ProcArg path_get_locked_outargs[] =
{
{
PDB_INT32,
"lockstatus",
"The lock status associated with the name path. 0 returned if the path is not locked. 1 is returned if the path is locked"
}
};
static ProcRecord path_get_locked_proc =
{
"gimp_path_get_locked",
"Returns the locked status associated with the name path.",
"This procedure returns the lock status associated with the specified path. A path can be \"locked\" which means that the transformation tool operations will also apply to the path.",
"the name of the path whose locked status should be set"
},
{
PDB_INT32,
"lockstatus",
"The lock status associated with the name path. 0 if the path is not locked. 1 if the path is to be locked"
}
};
static ProcRecord path_set_locked_proc =
{
"gimp_path_set_locked",
"Set the locked status associated with the name path.",
"This procedure sets the lock status associated with the specified path. A path can be \"locked\" which means that the transformation tool operations will also apply to the path.",
"The tattoo associated with the name path. Only values returned from 'path_get_tattoo' should be used here"
}
};
static ProcRecord path_set_tattoo_proc =
{
"gimp_path_set_tattoo",
"Sets the tattoo associated with the name path.",
"This procedure sets the tattoo associated with the specified path. A tattoo is a unique and permenant identifier attached to a path that can be used to uniquely identify a path within an image even between sessions. Note that the value passed to this function must have been obtained from a previous call to path_get_tattoo.",