Commit Graph

23 Commits

Author SHA1 Message Date
Michael Natterer 6a8e112921 added new local variables to hold the drawable's offsets instead of
2003-10-06  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-stroke.c
	(gimp_drawable_stroke_scan_convert): added new local variables to
	hold the drawable's offsets instead of abusing x2 and y2. Use
	existing APIs instead of re-implementing stuff. Removed an
	obsolete call to tile_manager_set_offsets(). Cleanup.
2003-10-06 17:13:57 +00:00
Michael Natterer d734595991 create a channel which the size of the layer, not of the image...
2003-10-06  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpchannel.c (gimp_channel_new_from_alpha): create
	a channel which the size of the layer, not of the image...

	* app/core/gimpchannel-select.c (gimp_channel_select_alpha):
	...and take the layer's offsets into account.

	* app/core/gimpscanconvert.[ch] (gimp_scan_convert_render): added
	off_x and off_y parameters and don't use the passed TileManager's
	offsets.

	* app/core/gimpchannel-select.c
	* app/core/gimpdrawable-stroke.c
	* app/tools/gimpiscissorstool.c: changed accordingly.
2003-10-06 16:43:05 +00:00
Michael Natterer a20e04bdaf added new virtual functions GimpDrawable::get_active_components(),
2003-10-06  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable.[ch]: added new virtual functions
	GimpDrawable::get_active_components(), apply_region() and
	replace_region().

	* app/core/Makefile.am
	* app/core/gimpdrawable-combine.[ch]: new files containing
	apply_region()'s and replace_region()'s default implementation.
	They are identical to the ones removed from GimpImage except that
	they don't mask the selection with itself (bug #107949).

	* app/core/gimpchannel.c
	* app/core/gimplayer.c: implement get_active_components().

	* app/core/gimpchannel.c: implement apply_region() and
	replace_region() and invalidate the channel's boundary
	before upchaining (bug #107949).

	* app/core/gimpimage.[ch]: removed gimp_image_apply_image(),
	gimp_image_replace_image() and gimp_image_get_active_components().

	* app/core/gimpimage-undo-push.c (undo_pop_image): invalidate
	boundary and bounds if the drawable is a channel (bug #107949).

	(undo_pop_mask)
	(undo_pop_channel_mod): finish previous commit :)

	* app/core/gimp-edit.c
	* app/core/gimpdrawable-blend.c
	* app/core/gimpdrawable-bucket-fill.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimagemap.c
	* app/core/gimplayer-floating-sel.c
	* app/paint/gimppaintcore.c
	* app/tools/gimpinktool.c: changed accordingly.
2003-10-06 14:40:12 +00:00
Simon Budig e8831f5502 Implemented simplify_boundary (), which tries to reduce the number of
2003-10-01  Simon Budig  <simon@gimp.org>

	* app/base/boundary.[ch]: Implemented simplify_boundary (),
	which tries to reduce the number of coordinates to get
	better interpolation for stroking.

	The results still need tweaking.

	* app/core/gimpdrawable-stroke.c: Use it.
2003-10-01 00:02:48 +00:00
Michael Natterer 657b49b402 removed "width", "height" and "antialias" from the GimpScanConvert struct
2003-09-30  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpscanconvert.[ch]: removed "width", "height" and
	"antialias" from the GimpScanConvert struct and from
	gimp_scan_convert_new(). Removed gimp_scan_convert_to_channel().
	Added "gboolean antialias" to gimp_scan_convert_render().
	Some general cleanup.

	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimage-mask-select.c
	* app/tools/gimpiscissorstool.c: changed accordingly.

	* app/core/gimpdrawable-stroke.c: renamed
	gimp_drawable_stroke_scanconvert_stroke() to
	gimp_drawable_stroke_scan_convert() and removed the "gboolean
	use_mask_bounds" parameter since we can't decide if it's the
	selection's boundary which is stroked. Instead use
	gimp_channel_is_empty() on the selection which will return FALSE
	while the selection is being stroked.

	* app/paint/gimppaintcore-stroke.c: cleanup.

	(gimp_paint_core_stroke_boundary): don't use "gint i" twice.

	(gimp_paint_core_stroke_vectors): no need to manually close a
	closed stroke.
2003-09-30 18:06:19 +00:00
Simon Budig 20683bede5 Accept NULL for ret_closed.
2003-09-30  Simon Budig  <simon@gimp.org>

	* app/vectors/gimpbezierstroke.c:
	(gimp_bezier_stroke_interpolate) Accept NULL for ret_closed.

	* app/widgets/gimppreviewrenderervectors.c: removed "closed"
	variable.

	* app/core/gimpdrawable-stroke.[ch]: Factored out the final
	rendering of the scanconvert. Implemented
	gimp_drawable_stroke_boundary. Unfortunately the results are
	not really good, since the boundary calculation code is
	too exact for this purpose. I have a rough idea how to fix this.

	* app/core/gimpchannel.c: changed accordingly.
2003-09-30 15:16:51 +00:00
Michael Natterer d0e1c1c661 cleanup.
2003-09-30  Michael Natterer  <mitch@gimp.org>

	* app/paint/gimppaintcore-stroke.c: cleanup.

	(gimp_paint_core_stroke_boundary): don't push a separate undo
	for each part of the boundary.

	* app/core/gimpdrawable-stroke.[ch]: added empty stub
	gimp_drawable_stroke_boundary(). Changed
	gimp_drawable_stroke_vectors() to take the GimpStrokeOptions as
	second parameter.

	* app/core/gimpchannel.c (gimp_channel_stroke): use it. No need
	to push an undo group around gimp_paint_core_stroke_boundary().

	* app/vectors/gimpvectors.c: changed accordingly.

	* app/widgets/gimpselectioneditor.[ch]: added a GimpStrokeItemFunc
	pointer and use it for stroking.

	* app/gui/edit-commands.[ch] (edit_stroke_selection): a
	GimpStrokeItemFunc which strokes the selection using the
	stroke-dialog.

	* app/gui/dialogs-constructors.c: use it for the selection editor.
2003-09-30 02:44:17 +00:00
Simon Budig fba6a1a77a replaced gimp_scan_convert_set_resolution with
2003-09-30  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.[ch]: replaced
	gimp_scan_convert_set_resolution with
	gimp_scan_convert_set_pixel_ratio where you specify the pixel
	ratio (width/height). Also made the stroke-width consistent
	with other places in the gimp by using the Y-Resolution as
	the base for the calculations.

	* app/core/gimpdrawable-stroke.c: changed accordingly.
2003-09-30 01:03:25 +00:00
Sven Neumann f4c7ef9914 app/core/gimpdrawable-stroke.c app/core/gimpstrokeoptions.[ch] removed the
2003-09-30  Sven Neumann  <sven@gimp.org>

	* app/core/gimpdrawable-stroke.c
	* app/core/gimpstrokeoptions.[ch]
	* app/gui/stroke-dialog.c: removed the resolution property again.
	The object should stay resolution independent. The resolution can
	be taken from the image it is used with.
2003-09-30 00:15:00 +00:00
Simon Budig 3761462869 Added support for setting X- and Y-resolution for stroking paths. The
2003-09-30  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.[ch]: Added support for setting
	X- and Y-resolution for stroking paths. The width of a path
	has to be given in pixels, using X-resolution.

	* app/core/gimpstrokeoptions.[ch]: Added "resolution" property,
	so that conversion between various width-units can happen.
	Should be set to the target images X-resolution.

	* app/gui/stroke-dialog.c: set the resolution of the options.

	* app/core/gimpdrawable-stroke.c: Use that stuff, cleanup.
2003-09-29 23:45:06 +00:00
Sven Neumann 55a0c4c960 removed "dash-unit" property and renamed "width-unit" to "unit".
2003-09-29  Sven Neumann  <sven@gimp.org>

	* app/core/gimpstrokeoptions.[ch]: removed "dash-unit" property and
	renamed "width-unit" to "unit".

	* app/core/gimpdrawable-stroke.c
	* app/widgets/gimpstrokeeditor.c: changed accordingly.
2003-09-29 11:13:21 +00:00
Simon Budig 4fce98042d Fixed glitch to enable dashed strokes with width < 1.0.
2003-09-29  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.c: Fixed glitch to enable dashed
	strokes with width < 1.0.

	* app/core/gimpdrawable-stroke.c: Actually pass the miter
	limit to gimp_scan_convert_stroke ().
2003-09-28 22:33:08 +00:00
Simon Budig 7c3b455924 "The last of the Oldenburg commits"
2003-09-28  Simon Budig  <simon@gimp.org>

	"The last of the Oldenburg commits"

	Thanks to the team of the Oldenburg Linux Developers Meeting 2003
	for providing a nice hacking environment.

	* app/vectors/gimpvectors.c: Add a default stock_id.

	* app/widgets/gimppreviewrenderervectors.[ch]: New Widget
	to render the preview of vectors. Just renders a stock item
	now, since I was unable to figure out how to properly draw
	in the GtkWidget.

	* app/widgets/Makefile.am
	* app/widgets/widgets-types.h: Changed accordingly.

	* app/widgets/gimppreviewrenderer-utils.c: Use the new widget.

	* app/core/gimpscanconvert.c
	* app/core/gimpdrawable-stroke.c: Use higher prescision for
	libart-stroking vectors. Reduces artefacts.

	* app/pdb/paths_cmds.c
	* libgimp/gimppaths_pdb.c: Regenerated after Tors changes.
2003-09-28 04:00:50 +00:00
Michael Natterer f5b98a4822 set the transformed color's alpha to OPAQUE so it works with
2003-09-27  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpdrawable-bucket-fill.c
	(gimp_drawable_bucket_fill_full): set the transformed color's
	alpha to OPAQUE so it works with color_region().

	* app/core/gimpdrawable-stroke.c (gimp_drawable_stroke_vectors):
	no need to transform the color into a newly allocated array,
	simply use guchar[MAX_CHANNELS] instead.

	Cleaned up both functions to use RED_PIX, GREEN_PIX and BLUE_PIX
	instead of 0, 1 and 2.
2003-09-27 20:42:31 +00:00
Michael Natterer ab34b3ee94 added new functions color_region_mask() which works like color_region()
2003-09-27  Michael Natterer  <mitch@gimp.org>

	* app/paint-funcs/paint-funcs.[ch]: added new functions
	color_region_mask() which works like color_region() but takes an
	additional maskPR parameters and pattern_region() which fills
	destPR with a TempBuf of *matching color depth*.

	* app/paint-funcs/paint-funcs-generic.h: added corresponding
	color_pixels_mask() and pattern_pixels().

	* app/core/gimpimage.[ch] (gimp_image_transform_temp_buf): new
	function which transforms a TempBuf to a specified drawable's
	color space.

	* app/core/gimpdrawable-bucket-fill.c: the functions were factored
	out here. Removed them and use the new stuff.

	* app/core/core-enums.[ch]: added enum GimpStrokeStyle which can
	be one of { SOLID, PATTERN }.

	* app/core/gimpstrokeoptions.[ch]: added "GimpStrokeStyle style"
	property, cleanup.

	* app/core/gimpdrawable-stroke.c: honor the new "style" property
	and call the new color_region_mask() and pattern_region()
	functions accordingly, cleanup.

	* app/widgets/gimpstrokeeditor.c: added a GUI for the stroke
	style. Ugly but works.

	* app/gui/stroke-dialog.c: undefine "foreground" and "pattern" and
	set the user context as parent context so we get these properties
	from the global settings.
2003-09-27 20:04:07 +00:00
Simon Budig ee3394754b changed the API of gimp_drawable_stroke_vectors to accept
2003-09-27  Simon Budig  <simon@gimp.org>

	* app/core/gimpdrawable-stroke.[ch]: changed the API of
	gimp_drawable_stroke_vectors to accept GimpStrokeOptions
	instead of lots of individual parameters.

	* app/vectors/gimpvectors.c: changed accordingly.
2003-09-27 15:29:21 +00:00
Simon Budig 3f76868aee This still is very much in progress. I just want to commit this to avoid
2003-09-27  Simon Budig  <simon@gimp.org>

	This still is very much in progress. I just want to commit this
	to avoid lossage. It kind of works but there definitely is
	code in the wrong place now.

	* app/gui/stroke-dialog.[ch]: New files implementing a dialog
	containing Svens GimpStrokeEditor-Widget.

	* app/gui/Makefile.am: changed accordingly.

	* app/gui/vectors-commands.c: Open the StrokeOptions-Dialog when
	the "stroke" menu entry gets selected.

	* app/vectors/gimpvectors.c: Remove bad #ifdef hacks and use
	Libart/Paintcore-Stroking depending on the type of the stroke_desc
	Parameter.

	* app/core/gimpstrokeoptions.c: Proper handle the Enum-Properties.

	* app/core/gimpscanconvert.[ch]: make the antialias-parameter
	to gimp_scan_convert_new a gboolean.

	* app/tools/gimpiscissorstool.c
	* app/core/gimpdrawable-stroke.c
	* app/core/gimpimage-mask-select.c: Changed accordingly.
2003-09-27 02:34:18 +00:00
Simon Budig 8172df9a15 Add some parameters to gimp_scan_convert_stroke () to expose the
2003-09-26  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.[ch]: Add some parameters to
	gimp_scan_convert_stroke () to expose the Miter-Setting
	and enable dashing of vectors.

	* app/core/gimpdrawable-stroke.c: Use the dashing feature.

	* app/vectors/gimpvectors.c: Expose a bad hack (opacity
	controls the libart-stroke width) in a #define. Default
	is not enabled.
2003-09-26 00:41:10 +00:00
Simon Budig 2c212214fe Fixed vectors stroking on GRAY* and INDEXED* layers.
2003-09-23  Simon Budig  <simon@gimp.org>

	* app/core/gimpdrawable-stroke.c: Fixed vectors stroking on
	GRAY* and INDEXED* layers.

	* app/tools/gimpvectortool.c: Made the polygonal mode more
	consistent.
2003-09-22 23:19:22 +00:00
Simon Budig 460b3e84e5 Adjusted to make sure that no successive LINETOs to the same coordinate
2003-09-21  Simon Budig  <simon@gimp.org>

	* app/core/gimpscanconvert.c: Adjusted to make sure that
	no successive LINETOs to the same coordinate are in the
	path. Libart chokes on that.

	* app/core/gimpdrawable-stroke.c: Respect the offsets of the
	target drawable.

	* app/tools/gimpvectortool.c: Removed status message in
	VECTORS_FINISHED mode as requested by Ville Pätsi.

	* app/vectors/gimpvectors.c: Determine the stroke parameters
	from the current context (opacity/color/paint_mode).
	The other parameters are not yet supported.
2003-09-21 19:07:48 +00:00
Sven Neumann 3ee7c4d0e0 renamed new enums to use "style" instead of the overloaded term "type".
2003-09-21  Sven Neumann  <sven@gimp.org>

	* app/core/core-enums.[ch]: renamed new enums to use "style" instead
	of the overloaded term "type". Also renamed GimpGridType while I was
	on it.

	* app/core/gimpdrawable-stroke.[ch]
	* app/core/gimpgrid.[ch]
	* app/core/gimpscanconvert.[ch]
	* app/display/gimpdisplayshell.c
	* app/vectors/gimpvectors.c
	* app/gui/grid-dialog.c: changed accordingly.
2003-09-21 10:45:19 +00:00
Simon Budig 09630e45f9 Dave Neary <bolsh@gimp.org>
2003-09-21  Simon Budig  <simon@gimp.org>
            Dave Neary  <bolsh@gimp.org>

	* app/core/gimpdrawable-stroke.c: gimp_image_apply_image () must
	not get the pixel Region twice, use NULL for src1_tiles, which
	then defaults to the drawables tiles. Also pixel_region_init()
	does not take the offsets set by tile_manager_set_offsets into
	account. Use 0,0 instead of x1,y1. Fixes bad crashes.

	* app/core/gimpscanconvert.c: fixed crash for the same reason.

	* app/vectors/gimpvectors.c: Enabled the new stroking by default.
	Of course there should be a dialog to tweak the settings...  :-)
2003-09-21 00:58:04 +00:00
Simon Budig ca07f5ddb2 Dave Neary <bolsh@gimp.org>
2003-09-20  Simon Budig  <simon@gimp.org>
            Dave Neary  <bolsh@gimp.org>

	First steps towards Libart stroking. Right now the code
	crashes and thus is disabled by default. If you want to
	test it, change the #define LIBART_STROKE  in
	app/vectors/gimpvectors.c. Then a click on the stroke button
	in the paths dialog invokes the new code.
	The crash is in gimpdrawable-stroke.c - apparently I did not
	yet get the TileManager stuff correctly.

	* app/core/gimpscanconvert.[ch]: Rewritten to be more clear
	and have an easier API. Now can handle open Paths and
	libart-stroke the (open/closed) polygons defined earlier.

	* app/core/core-enums.h: Added Enums for LineJoin-Type and
	EndCap-Type for stroking.

	* app/core/core-enums.c: regenerated.

	* app/core/gimpimage-mask-select.c: Use the new API of
	GimpScanConvert where appropriate.

	* app/vectors/gimpvectors.c: Added #define to enable the libart
	stroking. Disabled by default because of the crash mentioned
	above...

	* app/vectors/gimpbezierstroke.c
	* app/vectors/gimpstroke.c
	* app/vectors/gimpvectors.[ch]: Removed Libart stuff here.
	Libart usage now lives exclusively in GimpScanConvert.

	* app/core/gimpdrawable-stroke.[ch]: New files for the libart
	stroking (right now just vector objects).
	* app/core/Makefile.am: changed accordingly.

	* app/Makefile.am: Needed to tweak linking.  :-/
2003-09-20 19:58:26 +00:00