2006-04-07 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable.[ch]: renamed gimp_drawable_cmap() to
gimp_drawable_get_colormap() and let it return a const array.
* app/core/gimpdrawable-convert.c
* app/core/gimpimage-convert.c
* app/core/gimpselection.c
* app/display/gimpdisplayshell-preview.c: changed accordingly.
2006-01-02 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert-data.h
* app/core/gimpimage-convert.c: applied patch by Adam D. Moss that
replaces the default dither matrix by a 32x32 Bayer pattern (see
bug #136604).
2005-07-28 Sven Neumann <sven@gimp.org>
* app/core/Makefile.am
* app/core/cpercep.[ch]: moved cpercep from here ...
* app/base/Makefile.am
* app/base/cpercep.[ch]: ... to here.
* app/base/siox.[ch]: use the cpercep routines for RGB->LAB
conversion, gives a 20% speedup. Removed normalization which seems
redundant. Make it work for grayscale and indexed, not only RGB.
* app/core/gimpdrawable-foreground-extract.c
* app/core/gimpimage-convert.c: changed accordingly.
2005-07-05 Sven Neumann <sven@gimp.org>
* app/core/cpercep.[ch]: renamed cpercep_init_conversions() to
cpercep_init(); only initialize the tables on the first call.
* app/core/gimpimage-convert.c: changed accordingly.
* app/core/gimpimage-convert.c: check for non-empty palette
before converting to indexed using custom palette, otherwise
show warning and abort; fixes bug #170973.
* app/core/gimpimage-convert.c: when converting grayscale
to mono, treat the palette as gray rather than rgb, giving
more than tenfold speedup. Fixes bug #170801.
2005-02-27 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert-fsdither.h
* app/core/gimpimage-convertc: save a kilobyte of data by using
guchar for the range array.
2005-02-18 Sven Neumann <sven@gimp.org>
* app/core/Makefile.am
* app/core/gimpdrawable-convert.[ch]: new files holding
gimp_drawable_convert_rgb() and gimp_drawable_convert_grayscale()
moved out of gimpimage-convert.[ch].
* app/core/gimpchannel.c
* app/core/gimpimage-convert.[ch]
* app/core/gimplayer.c: changed accordingly.
2005-02-18 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert.c: some simple loop unrolling,
converted tabs to spaces and sprinkled the code with const
qualifiers.
2005-02-02 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): relax/rigor
the floating selection around the convert operations so color
analysis for indexed conversion works on the floating selection's
drawable original pixels, and not on the composited one.
Fixes bug #165342.
2004-12-13 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert.c: applied patch from Adam D. Moss with
more fixed dither improvements (bug #161123).
2004-12-12 Sven Neumann <sven@gimp.org>
Applied patch from Adam D. Moss (bug #161113):
* app/core/gimpimage-convert.c: Use a slower but much nicer
technique for finding the two best colours to dither between when
using fixed/positional dither methods. Makes positional dither
much less lame.
2004-08-10 Michael Natterer <mitch@gimp.org>
Redid the whole internal progress stuff: don't pass around
progress_callback and progress_data; instead, provide a
pointer to a GimpProgressInterface which can be implemented
by a variety of backends.
Addresses (but not yet fixes) bugs #6010, #97266 and #135185.
* app/display/Makefile.am
* app/display/gimpprogress.[ch]: removed the old progress hack.
* app/core/Makefile.am
* app/core/core-types.h
* app/core/gimpprogress.[ch]: implement GimpProgressInterface.
* app/widgets/Makefile.am
* app/widgets/widgets-types.h
* app/widgets/gimpprogressdialog.[ch]: the standalone progress
dialog as widget implementing GimpProgressInterface.
* app/display/gimpdisplay.c
* app/display/gimpstatusbar.[ch]
* app/widgets/gimpfiledialog.[ch]
* app/widgets/gimpthumbbox.[ch]: added GimpProgressInterface
implementation to these classes.
* app/core/gimp-gui.[ch]
* app/gui/gui-vtable.c: replaced the old progress vtable entries
by two new to create and destroy a GimpProgressDialog in case
no other progress is available.
* app/pdb/procedural_db.[ch]
* app/plug-in/plug-in-run.[ch]
* tools/pdbgen/app.pl: pass a GimpProgress to all PDB wrappers and
all plug-ins.
* app/plug-in/plug-in.[ch]
* app/plug-in/plug-ins.c
* app/plug-in/plug-in-message.c
* app/plug-in/plug-in-progress.c: handle the case there the
plug-in was crated with a progress as well as the case where it
wasn't.
* app/app_procs.c
* app/batch.c
* app/xcf/xcf.c
* app/file/file-open.[ch]
* app/file/file-save.[ch]
* app/widgets/gimphelp.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimpfontselect.c
* app/widgets/gimpgradientselect.c
* app/widgets/gimppaletteselect.c
* app/widgets/gimppatternselect.c: changed accordingly.
* app/core/gimpimagefile.[ch]
* app/display/gimpdisplayshell-dnd.c
* app/gui/file-open-dialog.c
* app/gui/file-open-location-dialog.c
* app/gui/file-save-dialog.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c: pass a GimpProgress to all file
related functions. Embed the progress in the file dialog where
possible.
* app/core/gimpdrawable-blend.[ch]
* app/core/gimpdrawable-transform.[ch]
* app/core/gimpimage-convert.[ch]
* app/core/gimpimage-flip.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-rotate.[ch]
* app/core/gimpimage-scale.[ch]
* app/core/gimpitem-linked.[ch]
* app/core/gimpitem.[ch]
* app/core/gimpchannel.c
* app/core/gimpdrawable.c
* app/core/gimplayer.c
* app/core/gimpselection.c
* app/vectors/gimpvectors.c: replaced callback/data by GimpProgress.
* app/tools/gimpblendtool.c
* app/tools/gimptransformtool.c
* app/gui/convert-dialog.c
* app/actions/documents-commands.c
* app/actions/file-commands.c
* app/actions/image-commands.c
* app/actions/layers-commands.c
* app/actions/plug-in-commands.c
* app/actions/vectors-commands.c
* tools/pdbgen/pdb/convert.pdb
* tools/pdbgen/pdb/edit.pdb
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/layer.pdb: changed callers accordingly.
* app/pdb/*_cmds.c: regenerated.
2004-08-09 Michael Natterer <mitch@gimp.org>
Applied (slightly modified) patch from Shlomi Fish which adds a
progress bar to the RGB -> INDEXED conversion. Fixes bug #145274
(and shows that we really really need a GimpProgressInterface in
the core to give progress users full access to the progress API)
* app/core/gimpimage-convert.[ch]: added special
GimpImageConvertProgress function typedef to cope with the
different stages of converting. Support passing such a callback &
data to gimp_image_convert() and update the progress accordingly.
* app/gui/convert-dialog.[ch]: added a convert progress callback
and pass it to gimp_image_convert().
* app/actions/image-commands.c
* tools/pdbgen/pdb/convert.pdb: changed accordingly.
* app/pdb/convert_cmds.c: regenerated.
2004-07-14 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c: added properties "gimp", "id", "width",
"height" and "base-type". Moved all code from gimp_image_new()
to GObject::constructor().
* app/core/gimpimage-convert.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-rotate.c
* app/core/gimpimage-scale.c
* app/core/gimpimage-undo-push.c: set "width", "height" and
"base-type" with g_object_set() so "notify" is emitted on the
properties.
* app/core/gimpimage-undo.c (gimp_image_undo_pop_stack):
freeze/thaw property notifications around undoing/redoing so they
are not emitted in the middle of the undo operation.
2004-04-13 Michael Natterer <mitch@gimp.org>
Moved the calls to floating_sel_relax()/rigor() from various
places to two single spots in the core where they are actually
needed. Fixes bug #138356 (which was caused by the projection
being triggered in the middle of changing the floating selection's
size or the size of the drawable it is attached to). This commit
effectively removes floating selection fiddling from the core's
public API.
* app/core/gimpdrawable.[ch] (gimp_drawable_has_floating_sel): new
function which returns TRUE if there is a floating selection
attached to the drawable.
* app/core/gimpdrawable.c (gimp_drawable_translate)
(gimp_drawable_set_tiles_full): if the drawable *has* a floating
selection, relax/rigor it before/after modifying the drawable.
* app/core/gimplayer.c (gimp_layer_translate)
(gimp_layer_set_tiles): if the layer *is* the floating selection,
relax/rigor it before/after modifying it.
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-flip.c
* app/core/gimpimage-resize.c
* app/core/gimpimage-rotate.c
* app/core/gimpimage-scale.c
* app/gui/layers-commands.c
* app/tools/gimpeditselectiontool.c
* tools/pdbgen/pdb/layer.pdb: removed calls to
floating_sel_rigor()/relax() all over the place. Also removed
lots of undo groups which are obsolete now.
* app/pdb/layer_cmds.c: regenerated.
2004-03-15 Michael Natterer <mitch@gimp.org>
* app/core/gimpdrawable.[ch]: added "offset_x" and "offset_y"
parameters to GimpDrawable::set_tiles().
(gimp_drawable_set_tiles): removed the "GimpImageType" parameter.
(gimp_drawable_set_tiles_full): new function adding type, offset_x
and offset_y parameters.
(gimp_drawable_real_set_tiles): set the drawable's offsets from
the offset parameters and its size from the passed TileManager's
size. Emit "size_changed" accordingly.
* app/core/gimpchannel.c
* app/core/gimpdrawable-offset.c
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-undo-push.c
* app/core/gimplayer.c
* app/text/gimptextlayer.c
* app/tools/gimptransformtool.c: changed accordingly: removed
calls to gimp_viewable_size_changed() and all sorts of hackish
assignments of the drawable's width/height/offset_x/offset_y
properties.
2004-03-13 Sven Neumann <sven@gimp.org>
* app/core/gimpdrawable.[ch]: added new virtual function
GimpDrawable::set_tiles().
* app/core/gimpchannel.c
* app/core/gimplayer.c: push an undo before chaining up in
set_tiles().
* app/core/gimpdrawable-transform.c
* app/core/gimpimage-convert.c
* app/tools/gimptransformtool.c: use gimp_drawable_set_tiles()
instead of fiddling with the drawable's tile manager directly.
2004-02-12 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): call
gimp_image_colormap_changed() after installing the colormap.
* app/tools/gimphistogramoptions.h: fixed typedef of
GimpHistogramOptionsClass.
2004-02-12 Michael Natterer <mitch@gimp.org>
Make sure that non-indexed images never have a colormap.
Fixes bug #121033.
* app/core/gimpimage-colormap.c (gimp_image_set_colormap): set
image->cmap to NULL when called with a NULL colormap.
* app/core/gimpimage-undo-push.c: made colormap undo/redo aware
of NULL colormaps.
* app/core/gimpimage-convert.c (gimp_image_convert): remove the
colormap using gimp_image_set_colormap() instead of freeing it
manually.
* app/widgets/gimpcolormapeditor.c: always check if the image
is INDEXED *and* has a colormap before accessing the colormap.
(need this new check because the fixed behaviour of colormap undo
produces undo groups which, when being popped, make the image have
no colormap while still being INDEXED in the small time frame
between the emission of "colormap_changed" and "mode_changed").
2004-02-07 Pedro Gimeno <pggimeno@wanadoo.es>
* app/core/gimpimage-convert.c (median_cut_pass2_no_dither_rgb):
Corrected position for alpha_pix in the case of grayscale images
with custom or mono palette and no dither. Fixes bug #133642.
(median_cut_pass2_fixed_dither_rgb): Ditto for fixed dither
(Positioned Color Dither).
2004-01-31 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-convert.[ch]: use gboolean instead of gint
for "alpha_dither" and "remove_dups" in all public and private
functions. Properly prototyped private functions. Minor cleanup.
* app/gui/convert-dialog.c: pass FALSE instead of 0.
* tools/pdbgen/pdb/convert.pdb: ditto. Also cleaned up a bit: use
generated checks and documentation for enums, removed duplicate
check for enum range (spotted by Kevin Cozens).
* app/pdb/convert_cmds.c
* libgimp/gimpconvert_pdb.c: regenerated.
2003-12-01 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.c: added a default implementation of
GimpImage::mode_changed() which reallocates the projection.
* app/core/gimpimage-convert.c (gimp_image_convert)
* app/core/gimpimage-undo-push.c (undo_pop_image_type): removed
explicit calls to gimp_image_projection_allocate().
2003-11-17 Sven Neumann <sven@gimp.org>
* libgimpcolor/gimprgb.h (GIMP_RGB_INTENSITY): removed the
addition of 0.001 that isn't correct for use with integers (should
be 0.5 then) and just plain wrong for use with floats/doubles.
* app/base/temp-buf.c
* app/core/gimpdrawable.c
* app/core/gimpimage-convert.c
* app/core/gimpimage.c
* plug-ins/common/aa.c
* plug-ins/common/engrave.c
* plug-ins/common/gradmap.c
* plug-ins/common/newsprint.c
* plug-ins/gflare/gflare.c
* plug-ins/gfli/gfli.c
* plug-ins/pagecurl/pagecurl.c: add 0.5 to the result of
GIMP_RGB_INTENSITY() in all places that use it with integers.
2003-10-21 Dave Neary <bolsh@gimp.org>
* app/core/gimpimage-convert.c: Applied a slightly modified
patch from Vesa Halttunen <vesuri@jormas.com> to sort generated
optimum palettes. Closes bug #119824.
2003-08-28 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): free the
colormap and set colormap size to 0 after converting from indexed.
Should make gimp_image_get_cmap() behave as advertized again.
* tools/pdbgen/pdb/image.pdb: use gimp_image_get_colormap_size()
instead of accessing gimage->num_cols directly.
* app/pdb/image_cmds.c: regenerated.
2003-05-26 Michael Natterer <mitch@gimp.org>
* app/base/tile-manager-private.h: added "gint ref_count" to the
TileManager struct.
* app/base/tile-manager.[ch]: replaced tile_manager_destroy()
by tile_manager_ref() and tile_manager_unref().
* app/core/gimpimage-undo-push.c: ref the tile managers stored in
the undo system and DON'T destroy them if no undo could be pushed.
Should fix the remaining crashes with undo disabled like in
bug #9350.
(!!!) Note that the tiles passed to gimp_image_undo_push_image()
and gimp_drawable_push_undo() as well as the tile managers of
drawables passed to gimp_image_undo_push_[layer|channel]_mod()
must be unref'ed by the caller now.
* app/core/gimpdrawable-transform.c (gimp_drawable_transform_paste):
don't take ownership of the passed tiles but ref them if needed.
(!!!) Callers must unref the passed tiles themselves now.
* app/core/gimpbuffer.c
* app/core/gimpdrawable-blend.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-offset.c
* app/core/gimpdrawable.c
* app/core/gimpedit.c
* app/core/gimpimage-convert.c
* app/core/gimpimage-mask.c
* app/core/gimpimage-projection.c
* app/core/gimpimage.c
* app/core/gimpimagemap.c
* app/core/gimplayer-floating-sel.c
* app/core/gimplayer.c
* app/paint/gimppaintcore.c
* app/text/gimptextlayer.c
* app/tools/gimpinktool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimptransformtool-undo.c
* app/tools/gimptransformtool.c: changed accordingly.
2003-05-18 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): push a
colormap undo if the image was INDEXED. Fixes bug #113236.
Minor Cleanups.
2003-03-25 Sven Neumann <sven@gimp.org>
* Makefile.am
* gimpintl.h: removed this header file.
* gimpmiscui.c: include libgimp-intl.h.
* gimp.c (gimp_main): call setlocale() and bind to the libgimp
textdomain so that plug-ins don't need to do that explicitely.
* libgimp/stdplugins-intl.h: added the functionality that used to
live in gimpintl.h and removed the libgimp related stuff. Got rid
of the INIT_I18N_UI() macro.
* plug-ins/*/*.c: removed all occurances of INIT_I18N_UI().
Plug-ins simply call INIT_I18N() once in their run() function.
* plug-ins/script-fu/script-fu-intl.h: added the functionality
that used to live in gimpintl.h and removed the libgimp related
stuff.
* app/Makefile.am
* app/gimp-intl.h: new file that defines the gettext macros for
the GIMP core.
* app/*/*.c: include gimp-intl.h instead of libgimp/gimpintl.h.
* plug-ins/script-fu/scripts/test-sphere.scm: fixed typos.
2003-03-18 Michael Natterer <mitch@gimp.org>
Added an API for image colormap manupulation and made colormap
changes undoable (fixes bug #25963).
* app/core/Makefile.am
* app/core/gimpimage-colormap.[ch]: new files implementing
colormap getters/setters. The setters push undos using the
new function below.
* app/core/core-enums.[ch]: added GIMP_UNDO_IMAGE_COLORMAP.
* app/core/gimpimage-undo-push.[ch]: added
gimp_image_undo_push_image_colormap(). Use GimpItemUndo even more
often. Cleanup.
* app/core/gimpimage.[ch]: removed gimp_image_get_colormap() here.
* app/core/gimpimage-convert.c
* app/gui/colormap-editor-commands.c
* app/widgets/gimpcolormapeditor.c
* app/widgets/gimptoolbox.c
* tools/pdbgen/pdb/image.pdb: use the new API.
* app/pdb/image_cmds.c: regenerated.
* plug-ins/common/vinvert.c: removed the comment about the bug,
cosmetic cleanup.
Unrelated:
* app/gui/splash.c: added a frame around the splash. Please eek
if it doesn't please you.
2002-05-28 Sven Neumann <sven@gimp.org>
* app/core/gimplayer.c (gimp_layer_new_from_drawable): determine
the src_base_type from the passed drawable, not from the image it
is attached to.
* app/core/gimpimage-convert.c (gimp_drawable_convert_rgb)
(gimp_drawable_convert_grayscale): added a check for the expected
bpp of the passed tile_manager.
2002-04-28 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): invalidate layer
previews so we don't crash when an image preview is generated after
converting the image from RGB to GRAY.
* app/core/gimpimage.c (gimp_image_get_new_preview): added some
assertions to make it easier to find similar problems in the future.