Commit Graph

4361 Commits

Author SHA1 Message Date
Warren Turkal 198f2514ab app: Refactor palette loaders.
I specifically moved the file opening/closing logic to the common
code. This makes the code easier to understand for me since there
is less duplication. In fact, this commit removes more lines than
it adds.
2013-09-17 17:54:54 -04:00
Jehan c7aa623a55 app: clean out a big bunch of leading tabs.
For some unknown reason, most calls to gimp_message_literal() were
indented with tabs.
2013-09-15 04:59:20 +12:00
Michael Natterer 125cf2a2a3 app: use the image instead of the projection for accessing a pickable 2013-09-13 23:29:06 +02:00
Michael Natterer 4d01e21104 app: implement the GimpPickable interface for GimpImage
by delegating to the image's projection.
2013-09-13 23:25:30 +02:00
Daniel Sabo 34c50b0fea app, plug-ins: Don't modify iter->length
The new by-row iteration doesn't re-write the length
value for each row. In general it is not safe to modify
the iterator data because the internal logic depends
on the public data, but this specific case is new.
2013-09-12 17:43:54 -07:00
Michael Natterer a694970d1c app: set the filters' "is-last-node" correctly in GimpFilterStack
Call gimp_filter_set_is_last_node() directly from the
GimpContainer::add(), ::remove() and ::reorder() implementations so it
is always called and things always have the correct state. More
precisely, don't call it in functions that are only called if the
stack has a graph, or that are called while the graph is being
created, because it has the side effect of emitting a signal that
might (and in fact did) trigger another recursive creation of the same
graph.
2013-09-12 01:30:47 +02:00
Michael Natterer a4dd86fcda app: add a read-only "buffer" property to GimpPickableInterface
and implement it in GimpDrawable and GimpProjection. Will need this
later.
2013-09-05 10:37:09 +02:00
Massimo Valentini 8ec824f158 app: do not render many tiles twice
removing the area that is going to be rendered from the dirty area
before rendering it, prevents tile-handler-projection to render it
again.

This was the reason why caching showed an improvement also during
the construction of the projection. And it was a regression that
I introduced in a previous commit
2013-08-11 08:49:38 +02:00
Michael Henning cff668f876 app: Fix merging floating selections when undo is diabled. 2013-08-10 13:43:12 -04:00
Michael Henning e7b749d55d app: Ensure the graph for fs filters is always constructed when needed. 2013-08-10 12:37:18 -04:00
Massimo Valentini 5b7953a423 app: do not invalidate always the whole layer 2013-08-10 16:43:08 +02:00
Massimo Valentini 40f41055b9 app: fix the tile pyramid invalidation bug
when toggling the visibility of a single layer image with
alpha channel, zoomed at 50%, the projection wasn't
properly redrawn. It seems there's a GEGL bug exposed
by normal layer mode operation fast path.
2013-08-10 16:22:27 +02:00
Michael Natterer c32c1208b0 app: return a GError when flattening the image failed 2013-08-09 21:35:36 +02:00
Simon Budig 514f22f53d app: fix crash when flattening an image with no visible layers 2013-08-09 21:32:42 +02:00
Michael Natterer 40e7ca7442 app: speed up image rendering by removing expose overhead
measure the time it takes to render projection chunks and continue
rendering until 0.01 seconds have passed. This ways we avoid excessive
expose roundtrips.
2013-08-09 20:20:02 +02:00
Michael Natterer b05ff480fd app: move the work of construction the projection into the chunk renderer
so we can control how much time it takes, and can further optimize it.
This is needed for gtk3 because it should happen between clock ticks,
not in the expose handler, and in gtk2 the old code would have the
unfortunate property to potentially render at very high frame rates,
including all the overhead of exposing.
2013-08-09 19:17:02 +02:00
Michael Natterer e72cf05ccb app: port mtime code in gimp_data_save() to GIO
because it gets its stat() calls right.
2013-08-04 16:51:31 +02:00
Michael Natterer 0289eb8898 Bug 705397 - Layer groups are not exported properly/fully
In gimpgrouplayer.c always gimp_pickable_flush() after
gimp_projectable_structure_changed() so all queued updates are
actually flushed to the projection buffer's invalid area, and are
constructed upon reading. This would have been neccessary before for
group layers, but worked anyway until we changed
gimp_projection_get_buffer() to construct the buffer on idle time
initially in order to make images appear more responsively after
loading.
2013-08-04 14:52:01 +02:00
Michael Natterer 3b12541d61 app: rename GimpProjection's IdleRender stuff to ChunkRender
and separate the chunk rendering logic from the fact that it's invoked
from an idle callback. Idle rendering no longer works in GTK+ 3.8 and
later because the expose logic was changed from an idle function to a
frame clock, and when we switch to that in gtk3-port, the diff to
master should stay readable (and rebasable) in this critical part of
the code.
2013-07-28 15:57:28 +02:00
Michael Natterer 37372555e5 Bug 704118 - crash on invalid number of PLTE entries
Make sure an indexed image always has a colormap. This was the case
before, except one could set a NULL colormap via the PDB.

Add gimp_image_unset_colormap(), and make gimp_image_set_colormap()
never set the colormap to NULL, even if NULL is passed. Change the
only places where actual unsetting makes sense to use unset().

Make some GUI places deal gracefully with palettes/colormaps with zero
entries.
2013-07-14 22:25:44 +02:00
Michael Natterer 13614f6182 app: change GimpData:mtime from time_t to gint64 2013-07-12 16:33:12 +02:00
Massimo Valentini 3cc923d5a5 Bug 703806: GIMP crashes when scaling an image
during an image rescale, while spinning the main-loop,
layer-groups preview generation used to start before their
layers were fully rescaled, so it tried to access tiles that
were not yet there
2013-07-09 19:41:52 +02:00
Michael Natterer f33d11b99c app: keep the layer mode node's "linear" property up-to-date
Implement GimpDrawable::set_buffer() and update the mode node if
the layer's "linear" property has changed.
2013-06-29 23:34:12 +02:00
Michael Natterer c8912ceb10 app: remove disabled code from gimp_drawable_real_get_buffer() 2013-06-29 22:12:52 +02:00
Daniel Sabo ff9c91ce6f Use gegl_malloc in GimpTempBuf
Which allocates 16 byte aligned memory for SSE code.
2013-06-25 20:40:27 -07:00
Michael Natterer f56f6d1255 app: follow the GEGL invert -> invert-linear vs. invert-gamma change
and invert masks using invert-linear and other drawables using
invert-gamma. drawable_invert_cmd_callback() still always uses
invert-gamma even though it can be used on layer masks.
2013-06-24 00:45:04 +02:00
Michael Natterer caf73f5f35 Add support for both gamma-corrected and linear for all bit depths
- Add new enum GimpComponentType which contains u8, u16, u32 etc.
- Change GimpPrecision to be u8-linear, u8-gamma, u16-linear etc.
- Add all the needed formats to gimp-babl.c
- Bump the XCF version to 5 and make sure version 4 with the old
  GimpPrecision enum values is loaded correctly

This change blows up the precision enums in "New Image" and
Image->Precision so we can test all this stuff. It is undecided what
format will be user-visible options in 2.10.
2013-06-23 16:51:24 +02:00
Clayton Walker 03f559923b app: properly initialize more variables
Found by Coverity
2013-06-23 13:10:44 +02:00
Michael Natterer 0a8135b8b0 Bug 701335 - Gimp crashing on creating huge clipboard brush
Change the maximum size of clipboard patterns and brushes to 1024x1024.
2013-06-21 12:45:20 +02:00
Michael Natterer 3cf2c4dd87 app: use the "no-cpu-accel" command line option again
Call gimp_cpu_accel_set_use() in app_run(). Add "use_cpu_accel"
parameter to gimp_new() and keep it around in the Gimp instance. Pass
the flag to plug-ins again.
2013-06-19 20:45:17 +02:00
Michael Natterer 150a3e9c7e app: don't run graphs that read and write the same buffer
Work around artifacts at processing chunk borders by dup()ing the
source buffer. See bug #701875.
2013-06-18 08:06:24 +02:00
Mikael Magnusson 0091645129 app: remove pointless NULL checks 2013-06-16 01:31:13 +02:00
Michael Natterer 571350270b app: return 0.0..1.0 from gimp_histogram_get_mean(), median(), std_dev()
Display the float values in the histogram dockable and add a compat
hack to the gimp_histogram() PDB wrapper.
2013-06-12 02:01:24 +02:00
Michael Natterer 6c97908a9e app: add "gboolean gamma_corrected" to gimp_histogram_new()
so we can make histograms of the gamma-corrected image data. Pass
TRUE all over the place so the histogram works perceptually. This
needs more thinking...
2013-06-12 01:02:25 +02:00
Michael Natterer 0f0590426d app: must CLAMP() all valus to 0..1 for calculating histogram bins
The histogram does only 0..1, there are no bins outside that range.
2013-06-11 23:11:37 +02:00
Michael Natterer 8d1cbd95d2 app: rename gimp_histogram_get_channel() to get_component()
Because that's what it is. It also takes a "gint component"
(0..4) and not a "GimpHistogramChannel channel".
2013-06-11 21:32:08 +02:00
Michael Natterer a7f42de4c0 app: turn GimpHistorgram into a GimpObject, no other changes 2013-06-11 21:23:32 +02:00
Michael Natterer 48d312ed94 app: create > 8-bit histograms with 1024 bins
Seems to calculate and draw correctly, just the view's range is
broken now, will fix.
2013-06-11 08:49:28 +02:00
Michael Natterer 96d569a50e app: make GimpHistogram use floats, and make the number of bins flexible
It's still always 256 currently.
2013-06-11 02:24:53 +02:00
Michael Natterer 330d511b33 app: gimp_pickable_pick_color(): return the right color index 2013-06-10 00:30:17 +02:00
Michael Natterer 4e9661bd20 app: use RGBA double to pick and average in gimp_pickable_pick_color()
It was still putting all picked colors through a guchar[4].
2013-06-09 20:13:50 +02:00
Clayton Walker 264d09b417 Rename colour and greyscale to color and grayscale respectively 2013-06-06 23:26:16 +02:00
Michael Natterer ec786816bb */Makefile.am: merge INCLUDES into AM_CPPFLAGS
automake-1.13 finally warns about this anachronism.
2013-06-05 20:48:37 +02:00
Massimo Valentini 63478e3543 app: image_map always set crop extents 2013-06-01 16:43:54 +02:00
Michael Natterer 304e2975ae app: crop GimpImageMap's operation to the selection bounds
so ops are finally working on the right area
(check e.g. Filters/Decor/Vignette).
2013-05-31 09:05:26 +02:00
Michael Natterer 3b68ae0f3c app, pdb, libgimp: Remove all traces of the supersampling recursion level
from all transform APIs. This is no longer used since we use GEGL to
transform, the value was only passed around and never used.
2013-05-31 01:15:32 +02:00
Michael Natterer b8558f8859 app: add coordinates to GimpColorTool's and GimpImageMapTool's "picked"
signals and vfuncs. This is currently unused, but GEGL operations
can soon pick coordinates just like they can pick colors.
2013-05-30 19:29:36 +02:00
Mukund Sivaraman 84f90455b9 app: Remove unused macro 2013-05-30 10:52:09 +05:30
Michael Natterer 5280a02ed8 Bug 700215 - Gradient name changes do not persist across sessions...
if the gradient itself isn't changed.

GimpData: implement GimpObject::name_changed() and set the "dirty"
flag to TRUE. Don't set dirty in GimpData::dirty()'s default impl
because that calls gimp_object_name_changed() anyway.
2013-05-29 22:29:29 +02:00
Michael Natterer 308431f7b6 Bug 701053 - Opening jpg files from Canon camera displays...
...PNG Description encoding error.

Don't unconditionally display all error messages from thumbnail saving.
Instead, return the error from gimp_imagefile_create_thumbnai()
and gimp_imagefile_save_thumbnail() and display it only if thumbnail
creation was the actual user-intended action (like clicking the preview
in a file dialog). Do not display the error when thumbnailing is just
a side effect of loading/saving an image.
2013-05-26 21:31:06 +02:00
Michael Natterer a7dc8d4429 app: remove gimp_get_number_of_processors(), use g_get_num_processors() 2013-05-25 22:50:23 +02:00
Michael Natterer f9b7979af0 app: somehow the new app/core/gimpsettings.[ch] didn't get committed 2013-05-25 16:48:38 +02:00
Michael Natterer a9ddcde6ed app: change projection idle chunk size back to 256x128
because it made applying of expensive filters pretty unresponsive.
Don't revert commit b7b504d624 tho
because it also moves the #defines to a proper place.
2013-05-25 16:37:52 +02:00
Michael Natterer 9072bf331a app: rename GimpImageMapConfig to GimpSettings
It was misnamed from the beginning and has no relation to GimpImageMap
except that it happens to be used by GimpImageMapTools. Now it feels
less weird to potentially use it for other settings too.
2013-05-25 15:26:18 +02:00
Michael Natterer 51181648f7 Bug 700707 - Missing time data in tool-options/*.settings files
strftime() the time using %H:%M:%S which should work on
all platforms, unlike %T.
2013-05-25 11:21:15 +02:00
Michael Natterer f294225af2 app: add new API gimp_image_map_set_region()
which sets either SELECTION or DRAWABLE. In SELECTION mode (the
previous hardcoded default), the effect is offset to the selection
boundary, in DRAWABLE mode, the effect's coordinates are drawable
coordinates.
2013-05-23 19:29:02 +02:00
Michael Natterer b7b504d624 app: double the chunks of the projection idle renderer: 256x128 -> 512x256 2013-05-22 21:20:23 +02:00
Massimo Valentini fd26c2eed4 app: use the update_area passed to gimp_image_map_apply 2013-05-21 19:04:57 +02:00
Michael Natterer ef917b2c5c app: add an "area" parameter to gimp_image_map_apply()
and only update the drawable in that area if it's not NULL. Useful for
expensive interactive operations like warp, where the tool exactly
knows which area has changed.
2013-05-18 01:45:01 +02:00
Michael Muré 7e962d36e2 app: add a quick doc for gimp_item_mask_intersect() 2013-05-18 01:26:13 +02:00
Michael Natterer 26ad350983 app: another small cleanup in GimpImageMap
Factor out drawable updating to a utility function, and some misc
cleanup.
2013-05-17 23:39:42 +02:00
Michael Natterer e3180de960 app: remove GimpPickable implementation from GimpImageMap
It's not needed because we don't modify the drawable's
pixels any more.
2013-05-17 02:02:28 +02:00
Michael Natterer 6872598260 app: make GimpImageMap more robust
Keep track of whether we have actually added a filter to the drawable,
and of the filtered rectangle, so we don't run into broken states in
commit() or abort(). Also make sure we remove the filter on bailing
out in apply().
2013-05-17 01:51:38 +02:00
Michael Natterer 971007796f app: the selection mask was offset in the wrong direction in GimpImageMap
Spotted my Massimo Valentini.
2013-05-13 22:12:25 +02:00
Miroslav Talasek 0d7b10cb74 app: add gimp_channel_new_from_buffer() and gimp_layer_mask_new_from_buffer() 2013-05-07 23:06:43 +02:00
Mikael Magnusson d15f18647e app: Remove an unused variable and associated dead code. 2013-05-02 20:14:40 +02:00
Daniel Sabo 8d88b71fad Implement gimp_drawable_get_linear 2013-04-30 15:36:22 -07:00
Michael Natterer 5c705d27a1 Bug 699279 - GEGL tool preview different from result on image without alpha...
gimp_image_map_apply(): don't let the filter affect the drawable
projection's alpha, because it can't affect the drawable buffer's
alpha either when finally merged.
2013-04-30 18:38:32 +02:00
Michael Natterer c55c2b0c4d app: fix gimp_image_get_active_mask() for GRAY and INDEXED modes
Need to check image->active[ALPHA_G,I] for the alpha component.
2013-04-30 18:35:05 +02:00
Michael Natterer f4d7d1475d app: add debug utility function gimp_create_image_from_buffer() 2013-04-30 17:17:43 +02:00
Michael Natterer 3e132ba18a app: fix GimpScanConvert compositing (as opposed to replacing)
It's only used in the foreground select tool so nobody noticed
that it was broken.
2013-04-29 23:58:44 +02:00
Michael Natterer 9c93df2d4b app: add gimp_drawable_get_linear() which currently always returns FALSE
Add "linear" parameter to GimpApplicator. Pass the drawable's "linear"
to the applicator, and to all calls to gimp_gegl_mode_node_set_mode(),
instead of hardcoding FALSE everywhere.
2013-04-27 08:41:06 +02:00
Michael Natterer bacc9c9635 Bug 688348 - Layer tab and Images tab: not updated on dropping...
...one image onto another

gimp_dock_window_display_changed(): make sure the "auto-follow-active"
logic works both ways: when the active image or display is changed in
a dockable, update the global context. Fixes multi-window mode.

gimp_context_real_set_display(): make sure a context's display and
image are always in a consistent state and never have a display that
is not display->image: when display is the same as context->display,
check that the context's image matches display->image, so that after a
gimp_context_set_display(), the context is consistent in all
cases. Fixes single-window mode.
2013-04-23 21:05:33 +02:00
Michael Natterer a93eaa9122 app: set paint_mode and opacity separately on mode nodes
so we don't constantly change the operation only because the opacity
varies during painting.
2013-04-22 22:53:07 +02:00
Michael Natterer 190fc5bec2 app: gimp_drawable_merge_filter(): remember the aux input in the undo step
Which means that now all color operations and gegl filters can be
modified with Edit->Fade. Poor hackers's nondestructive editing :)
2013-04-22 10:58:37 +02:00
Michael Natterer 457299f199 app: set the applicator on the filter on gimp_image_map_apply() 2013-04-22 10:58:08 +02:00
Michael Natterer cdffff7091 app: add gimp_filter_get,set_applicator()
The filter does absolutely nothing with the applicator, this API is
just for associating an applicator with a filter so it can be found by
other parts of the code.
2013-04-22 10:56:53 +02:00
Michael Natterer a80795e222 app: remove "GeglRectangle visible" from gimp_image_map_apply()
because we now use a filter and the image projection updates
the visible part only.
2013-04-22 00:29:38 +02:00
Massimo Valentini 0909a30b06 app: histogram typos
correctly offset the mask,
don't crash computing the histogram of a GRAY image selection
and don't use an integer division
2013-04-21 20:15:34 +02:00
Michael Natterer e2bcad3cfd app: use GimpApplicator in gimp_image_merge_layers() 2013-04-17 16:17:39 +02:00
Michael Natterer bba89aa87d app: use a GimpApplicator in gimp_drawable_real_apply_buffer() 2013-04-17 14:24:33 +02:00
Michael Natterer e3b2a54da7 app: add a stock_id to GimpImageMap and use it for its filter
Refactor GimpImageMapTool and GimpOperationTool to set the stock_id,
and to be a bit smarter with the image map's undo string.
2013-04-16 20:32:58 +02:00
Michael Natterer 9504e85a7e app: set an icon on the floating selection filter 2013-04-16 20:30:13 +02:00
Michael Natterer 2538d6fea7 app: add gimp_drawable_get_filters() which returns the filter stack 2013-04-16 20:20:00 +02:00
Michael Natterer 8bfb1769b7 app: use a GimpApplicator for floating selection compositing 2013-04-15 01:44:18 +02:00
Michael Natterer 07a220ee9e app: port GimpImageMap to GimpApplicator 2013-04-14 22:46:52 +02:00
Michael Natterer 1235013177 app: add local "private" variables to make drawable's FS code more readable 2013-04-12 21:07:56 +02:00
Michael Natterer d1ab98e1c6 app: make GimpImageMap work again when there is no selection 2013-04-12 18:47:12 +02:00
Michael Natterer 38e983c724 app: fix regression: make the selection clip the FS again 2013-04-12 18:26:34 +02:00
Michael Natterer 05e6f6d848 app: simply merge the FS filter with the drawable to anchor the FS 2013-04-12 16:58:18 +02:00
Michael Natterer 39ab59e032 app: add gimp_drawable_get_floating_sel_filter() 2013-04-12 16:57:39 +02:00
Michael Natterer b16f75b8af app: make the FS' drawable update itself when the active components change
which removes more FS knowledge from the image.
2013-04-12 15:58:42 +02:00
Michael Natterer 538e3813be app: make floating selection compositing honor the image's active components
This was a regression from 2.8
2013-04-12 15:54:05 +02:00
Michael Natterer 1e17f0aed1 app: port GimpImageMap to use the new drawable filters
which makes live update more responsive and removes tons of code, but
adds a delay with progress when finally committing the effect.
2013-04-12 14:35:27 +02:00
Michael Natterer dc964956e7 app: add gimp_drawable_merge_filter() which applies a filter to a drawable
permanently, with undo and progress.
2013-04-12 14:31:50 +02:00
Michael Natterer a1ddd7dfda app: use the newly added drawable filter api to add/remove the fs filter 2013-04-12 12:56:01 +02:00
Michael Natterer 85fef12865 app: add gimpdrawable-filter.[ch] to access the filters 2013-04-12 12:55:15 +02:00
Michael Natterer f3308e6ba3 app: add a GimpFilterStack to each GimpDrawable
which is part of the drawable's source_node, so we can generically
filter a drawable's pixels. Reading from the source_node will
transparently give the filtered results.

Turn floating selection compositing into a GimpFilter and add it to
the filter stack while we have a floating selection on the drawable.
2013-04-11 19:06:23 +02:00
Michael Natterer 7c96952bd4 app: add gimp_filter_stack_new(filter_type) 2013-04-11 19:04:51 +02:00
Michael Natterer a203a270df app: add gimp_filter_new(name) 2013-04-11 19:03:10 +02:00
Michael Natterer fc2ec83723 app: simply put GimpImage's layer and channel stacks on top of each other
which gets rid of the gegl:over we used to combine them.
2013-04-11 14:40:41 +02:00
Michael Natterer e7babfed2e app: make sure GimpFilterStack's initial empty graph passes through 2013-04-11 14:37:43 +02:00
Michael Natterer 51d28340f3 app: always connect GimpFilterStack's input too
so it is actually a "filter" stack and not only an "output" stack :)
2013-04-11 13:03:37 +02:00
Michael Natterer aa56bcd284 app: add new class GimpFilterStack factored out of GimpDrawableStack
and make it the parent class of GimpItemStack. Which means we now have
a generic stack of filters independent of any image items.
2013-04-11 12:25:11 +02:00
Michael Natterer d4c3d35bd8 app: use "filter" not "drawable" in GimpDrawableStack's graph code 2013-04-11 12:25:11 +02:00
Michael Natterer 4ca746eab7 app: move the "is-last-node" property and API from drawable to filter 2013-04-11 12:25:11 +02:00
Michael Natterer 45a6ea432c app: add new class GimpFilter as parent class of GimpItem
and move the item's GeglNode API there. The purpose of this is to
factor out "gimp object that manages a node".
2013-04-11 12:25:10 +02:00
Michael Natterer f84ed04ee5 app: actually remove the node in gimp_item_remove_offset_node()
The function is currently unused, so nobody noticed.
2013-04-11 12:25:10 +02:00
Michael Natterer 46f74d9f46 app: return GeglBuffer from gimp_image_contiguous_region_foo()
now all intermediate masks should be in "Y float" and avoid all
conversions.
2013-04-09 01:38:24 +02:00
Michael Natterer ddc4a057e4 app: factor our more lowlevel GimpChannel code to GeglBuffer utils 2013-04-09 00:38:46 +02:00
Michael Natterer 75c9a0dc27 app: factor out gimp_channel_select_buffer() from select_channel() 2013-04-08 23:31:26 +02:00
Michael Natterer 3cb2756133 app: use float GeglBuffers directly where possible in gimpchannel-select.c
Saving tons of conversions between the selection's actual format and
"Y float", including saving tons of temporary buffers while
processing.
2013-04-08 22:52:26 +02:00
Michael Natterer 5cd8b98efb app: factor out the core mask combine functions to gegl-only functions
so we can use them on plain GeglBuffers. Use them in
gimpchannel-combine.c for now.
2013-04-08 21:54:46 +02:00
Michael Henning e839ae0955 app: speed up gimp_image_contiguous_region_by_seed using a temporary GeglBuffer
This is identical to c204b0ac41, except
it avoids setting the buffer type of the drawable using a buffer copy.
(that issue is explained in d53deda61b)
2013-04-08 15:02:23 -04:00
Michael Natterer 586bb73293 app: add gimp_gegl_apply_feather()
and use it in gimp_channel_real_feather() so the magic factor of 3.5
to turn feather radius into gegl:gaussian-blur's std_dev is hidden
behind an API.
2013-04-08 14:16:33 +02:00
Michael Natterer d49e33da4a app: fix the last commit: it's n_components not 4, sigh 2013-04-08 03:33:39 +02:00
Michael Natterer dd1f731cc9 app: fix format selection in gimpimage-contiguous-region
and also re-enable selecting by H, S, V. Doing that sometimes runs
into an infinite loop though, which I don't think is this code's
fault...
2013-04-08 03:14:06 +02:00
Michael Natterer d53deda61b Revert "core: speed up gimp_image_contiguous_region_by_seed using a temporary GeglBuffer"
This reverts commit c204b0ac41, it's
a nice speedup we should keep, but we can't return a GimpChannel
of != image precision from that function. Needs more thinking.
2013-04-08 02:34:56 +02:00
Michael Henning c204b0ac41 core: speed up gimp_image_contiguous_region_by_seed using a temporary GeglBuffer
By creating a temporary GeglBuffer of the correct format, we avoid a lot of
babl conversions. This is about four times faster than the previous code.
2013-04-07 14:31:51 -04:00
Michael Henning 229ab7caf1 core: remove unneeded call to gegl_buffer_sample_cleanup 2013-04-07 12:30:29 -04:00
Michael Natterer 06968d9bf9 Bug 690325 - Image Display broken: a rectangle undrawn to the top left
Let GimpTileHandlerProjection know how large the projection is so it
can calculate the number of levels in the pyramid, and always
invalidate all levels.
2013-03-30 17:44:59 +01:00
Petr Kubiznak 194ef70d74 Bug 593167 - Support Windows in gimp_get_default_unit()
Function gimp_get_default_unit ported for Windows using standard GetLocaleInfo() function (from windows.h).
2013-03-30 10:19:57 -04:00
Michael Natterer 8bc4f008e7 Bug 692668 - Browse For Patterns
Increase the max size of the clipboard brush and pattern to 2048x2048
pixels. Still arbitrary but much better.
2013-03-26 23:55:40 +01:00
Michael Natterer 84b27e96b9 app: remove temp buffer workaround from gimp_channel_new_from_component()
apparently copying a component directly now works fine, probably
because we use "real" GeglBuffers (not TileManager based ones).
2013-03-13 23:45:46 +01:00
Michael Natterer 872b1f3221 app: don't leak the input stream when loading a viewable's icon pixbuf 2013-03-09 21:12:00 +01:00
Daniel Sabo 2614404764 Add support for custom icons for tool presets
Adds an icon-pixbuf property to GimpViewable that is used for a default
implementation of new_pixbuf.

Extend gimp_icon_picker to allow the user to pick non-stock icons for tool
presets (or any other class derived from GimpViewable). Icons can come
from any file GdkPixbuf can load or from image data on the clipboard.
2013-03-08 08:19:54 -08:00
Michael Natterer 561c250298 app: print 4 decimal places in GIMP_TIMER_END() 2013-03-06 12:50:21 +01:00
Téo Mazars d1cd90c170 Bug 674622 - Misalignment in scaling layers of different sizes
Again bad use of ROUND() on signed values...
2013-02-13 19:59:58 +01:00
Ville Skyttä 6b0d1038cc Bug 692641 - Various spelling fixes 2013-01-27 18:59:02 +01:00
Michael Natterer c262fee244 Bug 689523 - GIMP crashes (segfault) when loading a context with a font...
Make gimp_context_get|set_font_name() actually deal with
context->font_name, so the context can do its job of keeping the name
of an unavailable object around.
2013-01-18 01:02:31 +01:00
Michael Natterer 0a37a0490f app: fix indentation in GimpContext 2013-01-18 00:50:12 +01:00
Nils Philippsen fc625feb40 fix copy-paste error 2013-01-09 15:37:30 +01:00
Michael Natterer 4b6458b83e Revert "app: temp HACK: provide an "RaGaBaA float" buffer to gegl:transform"
This reverts commit 3d8341b6e8.
2012-12-19 00:08:11 +01:00
Michael Natterer 766999ce3f app: make sure the projection buffer exists in gimp_projection_pickable_flush()
This does not make any difference for normal images, but for images
without display (like when creating thumbnails, or for GUI-less
scripting), this is now needed because we create the initial
projection much more lazily, and got an empty projection.
2012-12-18 19:30:33 +01:00
Michael Natterer 2ad8373c42 app: construct the image's first projection incrementally
just as all subsequent ones. Fixes potentially huge delay for new
images, because we used to construct the entire projection in one go.
2012-12-15 19:33:21 +01:00
Michael Natterer af7916b3e6 Bug 689403 - GIMP saves files in strange directories when started from an...
If one single directory is passed on the command line, use it
as default folder for the open/save dialogs.
2012-12-15 00:36:19 +01:00
Michael Natterer efe01acb5d app: formatting cleanup in the last commits, and a format string fix 2012-12-12 11:29:00 +01:00
Jehan 78b2778357 config: migration infrastructure to update configuration files.
This is a generic system based off regular expressions so it can be used
for any configuration file.
Some of the use cases would be for instance to clean out outdated custom
actions (hence remove some loading burden), or rename them (so that
users don't lose their customization if we rename actions), etc.
2012-12-12 16:48:13 +09:00
Michael Natterer d8a9804702 app: support GeglParamSpecSeed in generated operation UI
and add a "New Seed" button next to the random seed entry.
2012-11-30 02:58:48 +01:00
Michael Natterer 3d8341b6e8 app: temp HACK: provide an "RaGaBaA float" buffer to gegl:transform
so we can quickly test the effects proper caching in GEGL itself would
have.
2012-11-27 14:46:42 +01:00
Michael Natterer 908f727f0a Chain up unconditionally in GObject::constructed()
It's supported since GLib 2.28.
2012-11-12 21:51:22 +01:00
Michael Natterer c914aa805d Bug 675747 - Layers with some modes get hidden in layer groups
Add a boolean "is-last-node" property to GimpDrawable and set it from
GimpDrawableStack, which is the place that easily has the information.
In GimpLayer, connect to "notify" and make sure we use NORMAL mode
unless the layer is in NORMAL or DISSOLVE mode.
2012-11-12 10:55:41 +01:00
Jehan 60e0cfe55c Bug 166643 - gimp support for the XDG basedir spec
New configuration directory scheme, consistent across platforms, and
following standards.

UNIX platforms (except OSX): $XDG_CONFIG_HOME/GIMP/{GIMP_APP_VERSION}
Windows: %APPDATA%/GIMP/{GIMP_APP_VERSION}
OSX: NSApplicationSupportDirectory/GIMP/{GIMP_APP_VERSION}
2012-11-11 17:55:31 +01:00
Michael Natterer acdf9bb29b app: fix infinite recursion crash in gimp_item_is_position_locked()
When checking if any linked item is position-locked in
gimp_item_linked_is_locked(), temporarily set the items to not being
linked, or gimp_item_real_is_position_locked() will call
gimp_item_linked_is_locked() again, and so on...
2012-11-11 17:17:47 +01:00
Michael Natterer fe19ad9706 Bug 683694 - Spelling errors
Reworded all places that used to say "allows to".
2012-11-11 15:50:25 +01:00
Michael Natterer a7223bbd2d Bug 352823 - Changing image mode discards text layer information
For conversions that have no dither options (like RGB -> GRAY or u8 ->
u16), always preserve text editability, for conversions that have
dither options (like RGB -> INDEXED or u16 -> u8), give the user the
choice whether to enable dithering.
2012-11-10 18:56:44 +01:00
Michael Natterer d4933b3052 Bug 674160 - Redesign of "Lock panel"
Apply and heavily modify patch from remyDev which adds "lock position"
to GimpItem, similar to "lock content". Lock position disables all
sorts of translation and transform, from the GUI and the PDB.

Cleaned up some aspects of the lock content code as well because a
second instance of similar code always shows what went wrong the first
time.
2012-11-09 11:17:25 +01:00
Michael Natterer 435df29d85 app: add utility functions for applying specific operations to buffers
so gimp_gegl_apply_foo() will run "gegl:foo" with the required
properties on a buffer and write the result to another buffer.
2012-10-31 23:47:45 +01:00
Michael Natterer ca4dadefa4 app: remove gimp_drawable_apply_operation_to_buffer()
it was a completely silly wrapper. Use gimp_gegl_apply_operation()
directly instead.
2012-10-22 16:14:56 +02:00
Michael Natterer eb89a545d5 app: move core/gimp-apply-operation.[ch] to gegl/gimp-gegl-apply-operation.[ch] 2012-10-22 16:03:40 +02:00
Michael Natterer 60305c11d5 app: add "const Babl *new_format" to GimpDrawable::convert_type()
but only to the virtual function, not the public API. Implement it in
GimpSelection and GimpLayerMask, and pass the correct mask format down
to the parent class which does the actual conversion.
2012-10-13 22:56:32 +02:00
Michael Natterer 5dbcdef477 app: implement optional dithering when converting to lower bit depth
Add "layer_dither_type" and "mask_dither_type" to
GimpDrawable::convert_type(), pass around the dither type from the
dialog, and implement dithering using gegl:color-reduction.
2012-10-13 21:46:56 +02:00
Michael Natterer 0f0da94f55 app: fix progress handling in gimp_apply_operation()
Only end the progress if we also started it here.
2012-10-12 20:09:47 +02:00
Michael Natterer 6c41f58fea Bug 682742 - Module manager: turning off modules has no effect
Use gimp_config_writer_string() instead of gimp_config_writer_printf()
to serialize module-load-inhibit so backslashes and other stuff gets
properly escaped.
2012-10-09 01:25:42 +02:00
Michael Natterer 59c0c96921 app: add gimp_data_factory_get_data_type() 2012-10-07 00:17:01 +02:00
Michael Natterer 6ddb977542 app: reimplement image component visibility using gimp:mask-components 2012-10-06 23:58:46 +02:00
Michael Natterer 58506568e5 app: update the progress also when converting the selection's precision 2012-10-01 13:36:50 +02:00
Michael Natterer 1725c6c865 app: make group layer type conversion depend on less side conditions
gimp_group_layer_convert_type() required the image's precision to be
already set to the new value.
2012-09-28 20:58:40 +02:00
Michael Natterer c9e788c39d app: add gimp_babl_mask_format(precision) 2012-09-27 23:50:20 +02:00
Michael Natterer 2a30a2bb74 Bug 684698 - Preferences-Folders: only 15 folder items accepted
Raise "max_paths" from 16 to 256 in all calls to gimp_path_parse().
2012-09-26 23:29:51 +02:00
Michael Natterer 0ca03e8827 app: add a "Convert Precision" dialog for choosing dithering options
Does absolutely nothing yet.
2012-09-23 23:47:28 +02:00
Michael Natterer 3682006dfd app: some cleanup and formatting in image crop and resize 2012-09-22 16:34:14 +02:00
Michael Natterer 303e554ab1 app: remove "gboolean active_layer_only" from gimp_image_crop()
Also a very historic API, it doesn't belong there. Instead, simply
call gimp_item_resize() in GimpCropTool.
2012-09-22 15:08:05 +02:00
Michael Natterer c1811d6bdf app: gimp_image_crop_auto_shrink() -> gimp_pickable_auto_shrink()
It was in gimpimag-crop only for historic reasons. Clean up API
and code to do simpler and more reasonable stuff.
2012-09-22 14:56:52 +02:00
Michael Natterer cd0143c350 app: clarify operator precedence in an expression with % and ? 2012-09-21 10:40:44 +02:00
Michael Natterer 7597b83bd8 app: plug string leak in gimp_image_format_display_uri() 2012-09-21 10:34:17 +02:00
Massimo Valentini a0221bc560 app: plug a memory leak
and make the blend tool (Shape: Shaped (angular)) sligthly
more efficient

with an opaque layer (400x300) goes from:
gradient_fill_region: gradient_fill_region took 52.69 seconds
EEEEeEeek! 2 GeglBuffers leaked
to:
gradient_fill_region: gradient_fill_region took 5.90 seconds
2012-09-19 19:10:49 +02:00
Kevin Cozens a2e037fb00 Corrected spelling errors spotted by Ari Pollak (Mostly fixes bug #683694)
Still need to address the "allows to" grammatical error.
2012-09-10 12:22:12 -04:00
Michael Natterer 4db6a970de app: add a workaround to make GimpModuleDB's "verbose" flag work
so we get module output from gimp --verbose.
2012-09-08 12:48:53 +02:00
Michael Natterer e546f2b43b Bug 683462 - cropping with rectangular select tool leaves misaligned...
Reset the tool on image changes again, but not if only the active
drawable changes, so keep bug #678890 closed:

Introduce new dirty flag GIMP_DIRTY_ACTIVE_DRAWABLE and set it on all
tools' dirty_mask except for rect select. Check the new flag when
reseting the active tool because of a drawable change.
2012-09-06 23:55:35 +02:00
Michael Natterer d7588ba45c Bug 678358 - Add option to skip text layers when resizing the image
Add a "Resize text layers" toggle to the canvas size dialog, and
default to FALSE because this seems the desired behavior in most
cases.
2012-09-05 23:26:54 +02:00
Michael Natterer c7b9728cc8 app: make handling of coordinates more robust against broken input drivers
Initialize the axes[] array with zeros and change pressure curve
mapping to not try to "interpolate" shit like NaN and crash.
2012-09-05 11:36:44 +02:00
Michael Natterer 095561f8bc app: don't always duplicate the source buffer in gimp_buffer_new()
Honor the passed copy_pixels boolean again. This was disabled during
GEGL porting and forgotten.
2012-08-24 22:31:42 +02:00
Michael Natterer 101a9b9887 app: make image and projection size estimations precision-aware
GimpProjection estimation was still assuming 8 bit, so was
GimpTemplate. Also, calculate GIMP_PROJECTION_IDLE_PRIORITY
inatead of hardcoding it.
2012-08-24 22:16:02 +02:00
Mikael Magnusson f6f22ed431 Remove stray semicolons 2012-08-20 15:22:20 +02:00
Michael Natterer 276b507285 Bug 681799 - Canvas size doesn't show preview after canceling once
gimp_viewable_get_pixbuf(): if there is a cached pixbuf of the right
size, actually return it, instead of the local "pixbuf" variable which
is always NULL.
2012-08-14 09:23:16 +02:00
Michael Natterer 47c94fc228 app: improve error message when failing to load an ABR version 6 brush 2012-08-04 00:04:47 +02:00
Michael Natterer eda6fa1c14 Bug 586462 - Layer inserts misplaced
Another attempt to fix paste/drop positions for good.

Paste/drop target is either the selected area of a drawable, the
drawable itself, or the image:

- if the paste is larger than the target, center on the target
- if there is a viewport, and the viewport intersects with the
  target, center on the intersection
- otherwise, center on the target

Finally, if we did viewport-centered pasting, make sure the paste is
as completely within image bounds as possible.
2012-07-30 16:20:11 +02:00
Michael Natterer 16798d839c app: keep the projection around in the image's layer format
so it's not always 8 bit and can be used to copy real data from in all
precisions.
2012-07-30 16:00:02 +02:00
Michael Natterer 220b28677b Bug 676566 - Window title becomes "Untitled" after exporting without saving
Fix this and other issues more globally by moving the logic that
formats the image's display name into the GimpImage object, and return
the properly formatted name, e.g. "Foo.xcf", or "[Foo] (imported)"
from gimp_image_get_display_name().

Also add gimp_image_get_display_path() which returns the full path
instead. Use the two functions for formatting the image title, and
apply various other fixes that make sure the UI always uses the same
string to identify the image.

Call gimp_object_name_changed() whenever the save/export status
changes, so the image's cached display name and path get cleared.
2012-07-17 22:52:49 +02:00
Massimo Valentini f58518dd70 app: plug a memory leak
==7785== 96 bytes in 4 blocks are definitely lost in loss record 16,947 of 20,720
==7785==    at 0x4A0884D: malloc (/builddir/build/BUILD/valgrind-3.7.0/coregrind/m_replacemalloc/vg_replace_malloc.c:263)
==7785==    by 0x87F52DE: g_malloc (glib/glib/gmem.c:159)
==7785==    by 0x8809741: g_slice_alloc (glib/glib/gslice.c:1003)
==7785==    by 0x87EBF0D: g_list_prepend (glib/glib/glist.c:275)
==7785==    by 0x6FA596: gimp_item_stack_get_item_list (gimp/app/core/gimpitemstack.c:175)
==7785==    by 0x6D97B4: gimp_image_convert_precision (gimp/app/core/gimpimage-convert-precision.c:55)
==7785==    by 0x49B62E: image_convert_precision_cmd_callback (gimp/app/actions/image-commands.c:236)
2012-07-07 18:47:02 +02:00
Massimo Valentini 82af5731fa app: small typo
gimp-2.9 used to print:

(gimp-2.9:3): GEGL-gegl-node.c-WARNING **: gegl_node_pads_exist:
   Can't find source property outout of gegl:translate 0x10cbde10

before crashing
2012-07-07 16:18:48 +02:00
Michael Natterer 6b6d39fc64 app: add GimpTileHandlerProjection and use it to validate the projection
as the projection buffer is being read from. Projection performance is
now back at its old speed.
2012-07-05 21:42:26 +02:00
Michael Natterer 8c871b3a5f app: fix buffer == NULL warning in GimpProjection 2012-06-26 16:09:29 +02:00
Michael Natterer fbb2afdf1d app: rename gimpimage-convert.[ch] to gimpimage-convert-type.[ch] 2012-06-26 14:38:33 +02:00
Michael Natterer daad966b8f app: remove GimpImage's cached preview
because GimpViewable already implements exactly the same.
2012-06-25 00:23:07 +02:00
Michael Natterer 373a4e7469 app: completely remove TileManager and friends (base/ and paint-funcs/)
And along with it a lot of stuff like the drawable preview cache, the
gegl tile manager backend, temporary gimp_gegl_buffer_foo() stuff, and
the remaining bits of performance.

The projection is in an evil semi-ported state which makes it work
ok-ish for stuff like layer moving, but absolutely unbearable for
painting, there is also an off-by-one rendering glitch at some zoom
levels.
2012-06-20 21:44:09 +02:00
Michael Natterer 67b5a509b6 Bug 677823 - Shift + mouse click to link all layers does not work
This got lost during layer group porting, reimplement it, but restrict
"all layers" to the clicked layer's branch in the tree.
2012-06-12 21:39:40 +02:00
Michael Natterer 33141419cc app: experimental blend speedup code for review, disabled
Keeps around a cache of gradient values, instead of calling
gimp_gradient_get_color_at() for each rendered pixel.
2012-05-28 22:55:03 +02:00
Michael Natterer 81e3b6ba63 app: remove more stuff from base-types.h 2012-05-21 21:56:22 +02:00
Michael Natterer 513e3b6a78 app: disable the foreground select tool properly: #if 0 everything
so it's not in the way of further cruft removal.
2012-05-21 03:09:08 +02:00
Michael Natterer 4dcd1f3ad4 app: use plain gegl_buffer_new() and _dup(), not the gimp_gegl_ variants
unless the buffers end up being drawable->buffer.
2012-05-20 22:02:59 +02:00
Michael Natterer 236ea4ddfe app: "disable" SIOX but in an evil way that keeps the tool building
Will probably crash hilariously when using it.
2012-05-20 21:05:17 +02:00
Michael Natterer 759b71b8e9 app: remove GimpProjectable::get_layers() and ::get_channels() 2012-05-20 20:28:27 +02:00
Michael Natterer 7539b9e359 app: simplify projection construction by not doing things GEGL should do 2012-05-20 20:24:45 +02:00
Michael Natterer 0d636a3561 app: same ERASE mode fix for gimp_edit_clear() 2012-05-20 17:32:43 +02:00
Michael Natterer 5247f461aa app: remove paint-funcs-types.h 2012-05-19 01:13:21 +02:00
Michael Natterer 01c92a7c4e app: remove all use-gegl config stuff 2012-05-19 00:50:53 +02:00
Michael Natterer 06c59973d3 app: remove the entire legacy composition code 2012-05-19 00:41:43 +02:00
Michael Natterer 07cc3976ca app: remove the !use_gegl case from gimpimage-merge.c 2012-05-19 00:19:49 +02:00