| GIMP Application Reference Manual | ||||
|---|---|---|---|---|
enum GimpHandleType; GimpDrawTool; void gimp_draw_tool_start (GimpDrawTool *draw_tool, GimpDisplay *display); void gimp_draw_tool_stop (GimpDrawTool *draw_tool); gboolean gimp_draw_tool_is_active (GimpDrawTool *draw_tool); gboolean gimp_draw_tool_is_drawn (GimpDrawTool *draw_tool); void gimp_draw_tool_pause (GimpDrawTool *draw_tool); void gimp_draw_tool_resume (GimpDrawTool *draw_tool); gdouble gimp_draw_tool_calc_distance (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x1, gdouble y1, gdouble x2, gdouble y2); gdouble gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x1, gdouble y1, gdouble x2, gdouble y2); gboolean gimp_draw_tool_in_radius (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gint radius); void gimp_draw_tool_draw_line (GimpDrawTool *draw_tool, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gboolean use_offsets); void gimp_draw_tool_draw_dashed_line (GimpDrawTool *draw_tool, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gboolean use_offsets); void gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool, GimpOrientationType orientation, gint position); void gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gdouble width, gdouble height, gboolean use_offsets); void gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gdouble width, gdouble height, gint angle1, gint angle2, gboolean use_offsets); void gimp_draw_tool_draw_rectangle_by_anchor (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets); void gimp_draw_tool_draw_arc_by_anchor (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gint width, gint height, gint angle1, gint angle2, GtkAnchorType anchor, gboolean use_offsets); void gimp_draw_tool_draw_cross_by_anchor (GimpDrawTool *draw_tool, gdouble x, gdouble y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets); void gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool, GimpHandleType type, gdouble x, gdouble y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets); void gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool, gboolean highlight, gboolean put_outside, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets); gboolean gimp_draw_tool_on_handle (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x, gdouble y, GimpHandleType type, gdouble handle_x, gdouble handle_y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets); gboolean gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool, GimpDisplay *display, const GimpCoords *coord, gint width, gint height, GimpCoords *ret_coords, gdouble *ret_pos, GimpAnchor **ret_segment_start, GimpAnchor **ret_segment_end, GimpStroke **ret_stroke, GimpVectors **ret_vectors); gboolean gimp_draw_tool_on_vectors_curve (GimpDrawTool *draw_tool, GimpDisplay *display, GimpVectors *vectors, const GimpCoords *coord, gint width, gint height, GimpCoords *ret_coords, gdouble *ret_pos, GimpAnchor **ret_segment_start, GimpAnchor **ret_segment_end, GimpStroke **ret_stroke); gboolean gimp_draw_tool_on_vectors_handle (GimpDrawTool *draw_tool, GimpDisplay *display, GimpVectors *vectors, const GimpCoords *coord, gint width, gint height, GimpAnchorType preferred, gboolean exclusive, GimpAnchor **ret_anchor, GimpStroke **ret_stroke); void gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool, const GimpVector2 *points, gint n_points, gboolean filled, gboolean use_offsets); void gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool, const GimpCoords *points, gint n_points, gboolean filled, gboolean use_offsets); void gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool, const BoundSeg *bound_segs, gint n_bound_segs, gdouble offset_x, gdouble offset_y, gboolean use_offsets); void gimp_draw_tool_set_vectors (GimpDrawTool *draw_tool, GList *vectors); void gimp_draw_tool_set_transform (GimpDrawTool *draw_tool, GimpMatrix3 *transform);
GObject +----GimpObject +----GimpTool +----GimpDrawTool +----GimpColorTool +----GimpAlignTool +----GimpBlendTool +----GimpSelectionTool +----GimpCropTool +----GimpTransformTool +----GimpMagnifyTool +----GimpMeasureTool +----GimpMoveTool +----GimpTextTool +----GimpVectorTool
typedef enum
{
GIMP_HANDLE_SQUARE,
GIMP_HANDLE_FILLED_SQUARE,
GIMP_HANDLE_CIRCLE,
GIMP_HANDLE_FILLED_CIRCLE,
GIMP_HANDLE_CROSS
} GimpHandleType;
void gimp_draw_tool_start (GimpDrawTool *draw_tool, GimpDisplay *display);
|
|
|
gboolean gimp_draw_tool_is_active (GimpDrawTool *draw_tool);
|
|
Returns : |
gboolean gimp_draw_tool_is_drawn (GimpDrawTool *draw_tool);
|
|
Returns : |
gdouble gimp_draw_tool_calc_distance (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x1, gdouble y1, gdouble x2, gdouble y2);
If you just need to compare distances, consider to use
gimp_draw_tool_calc_distance_square() instead.
|
a GimpDrawTool |
|
a GimpDisplay |
|
start point X in image coordinates |
|
start point Y in image coordinates |
|
end point X in image coordinates |
|
end point Y in image coordinates |
Returns : |
the distance between the given points in display coordinates |
gdouble gimp_draw_tool_calc_distance_square (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x1, gdouble y1, gdouble x2, gdouble y2);
This function is more effective than gimp_draw_tool_calc_distance()
as it doesn't perform a sqrt(). Use this if you just need to compare
distances.
|
a GimpDrawTool |
|
a GimpDisplay |
|
start point X in image coordinates |
|
start point Y in image coordinates |
|
end point X in image coordinates |
|
end point Y in image coordinates |
Returns : |
the square of the distance between the given points in display coordinates |
gboolean gimp_draw_tool_in_radius (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gint radius);
The points are in image space coordinates.
|
a GimpDrawTool |
|
a GimpDisplay |
|
start point X in image coordinates |
|
start point Y in image coordinates |
|
end point X in image coordinates |
|
end point Y in image coordinates |
|
distance in screen coordinates, not image coordinates |
Returns : |
TRUE if the points are within radius of each other,
FALSE otherwise
|
void gimp_draw_tool_draw_line (GimpDrawTool *draw_tool, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gboolean use_offsets);
This function takes image space coordinates and transforms them to screen window coordinates, then draws a line between the resulting coordindates.
|
the GimpDrawTool |
|
start point X in image coordinates |
|
start point Y in image coordinates |
|
end point X in image coordinates |
|
end point Y in image coordinates |
|
whether to use the image pixel offsets of the tool's display |
void gimp_draw_tool_draw_dashed_line (GimpDrawTool *draw_tool, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gboolean use_offsets);
This function takes image space coordinates and transforms them to screen window coordinates, then draws a dashed line between the resulting coordindates.
|
the GimpDrawTool |
|
start point X in image coordinates |
|
start point Y in image coordinates |
|
end point X in image coordinates |
|
end point Y in image coordinates |
|
whether to use the image pixel offsets of the tool's display |
void gimp_draw_tool_draw_guide_line (GimpDrawTool *draw_tool, GimpOrientationType orientation, gint position);
|
|
|
|
|
void gimp_draw_tool_draw_rectangle (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gdouble width, gdouble height, gboolean use_offsets);
This function takes image space coordinates and transforms them to screen window coordinates, then draws the resulting rectangle.
|
the GimpDrawTool |
|
whether to fill the rectangle |
|
horizontal image coordinate |
|
vertical image coordinate |
|
width in image coordinates |
|
height in image coordinates |
|
whether to use the image pixel offsets of the tool's display |
void gimp_draw_tool_draw_arc (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gdouble width, gdouble height, gint angle1, gint angle2, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_rectangle_by_anchor
(GimpDrawTool *draw_tool,
gboolean filled,
gdouble x,
gdouble y,
gint width,
gint height,
GtkAnchorType anchor,
gboolean use_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_arc_by_anchor (GimpDrawTool *draw_tool, gboolean filled, gdouble x, gdouble y, gint width, gint height, gint angle1, gint angle2, GtkAnchorType anchor, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_cross_by_anchor (GimpDrawTool *draw_tool, gdouble x, gdouble y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_handle (GimpDrawTool *draw_tool, GimpHandleType type, gdouble x, gdouble y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_corner (GimpDrawTool *draw_tool, gboolean highlight, gboolean put_outside, gdouble x1, gdouble y1, gdouble x2, gdouble y2, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets);
This function takes image space coordinates and transforms them to screen window coordinates. It draws a corner into an already drawn rectangle outline, taking care of not drawing over an already drawn line.
|
the GimpDrawTool |
|
|
|
whether to put the handles on the outside of the rectangle |
|
|
|
|
|
|
|
|
|
corner width |
|
corner height |
|
which corner to draw |
|
whether to use the image pixel offsets of the tool's display |
gboolean gimp_draw_tool_on_handle (GimpDrawTool *draw_tool, GimpDisplay *display, gdouble x, gdouble y, GimpHandleType type, gdouble handle_x, gdouble handle_y, gint width, gint height, GtkAnchorType anchor, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean gimp_draw_tool_on_vectors (GimpDrawTool *draw_tool, GimpDisplay *display, const GimpCoords *coord, gint width, gint height, GimpCoords *ret_coords, gdouble *ret_pos, GimpAnchor **ret_segment_start, GimpAnchor **ret_segment_end, GimpStroke **ret_stroke, GimpVectors **ret_vectors);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean gimp_draw_tool_on_vectors_curve (GimpDrawTool *draw_tool, GimpDisplay *display, GimpVectors *vectors, const GimpCoords *coord, gint width, gint height, GimpCoords *ret_coords, gdouble *ret_pos, GimpAnchor **ret_segment_start, GimpAnchor **ret_segment_end, GimpStroke **ret_stroke);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
gboolean gimp_draw_tool_on_vectors_handle (GimpDrawTool *draw_tool, GimpDisplay *display, GimpVectors *vectors, const GimpCoords *coord, gint width, gint height, GimpAnchorType preferred, gboolean exclusive, GimpAnchor **ret_anchor, GimpStroke **ret_stroke);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
void gimp_draw_tool_draw_lines (GimpDrawTool *draw_tool, const GimpVector2 *points, gint n_points, gboolean filled, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_strokes (GimpDrawTool *draw_tool, const GimpCoords *points, gint n_points, gboolean filled, gboolean use_offsets);
|
|
|
|
|
|
|
|
|
void gimp_draw_tool_draw_boundary (GimpDrawTool *draw_tool, const BoundSeg *bound_segs, gint n_bound_segs, gdouble offset_x, gdouble offset_y, gboolean use_offsets);
Draw the boundary of the brush that draw_tool uses. The boundary
should be sorted with sort_boundary(), and n_bound_segs should
include the sentinel segments inserted by sort_boundary() that
indicate the end of connected segment sequences (groups) .
|
a GimpDrawTool |
|
the sorted brush outline |
|
the number of segments in bound_segs
|
|
x offset |
|
y offset |
|
whether to use offsets |
void gimp_draw_tool_set_vectors (GimpDrawTool *draw_tool, GList *vectors);
|
|
|
void gimp_draw_tool_set_transform (GimpDrawTool *draw_tool, GimpMatrix3 *transform);
|
|
|