minor optimizations.

2005-08-23  Sven Neumann  <sven@gimp.org>

	* app/base/siox.c: minor optimizations.

	* app/actions/gradients-actions.c
	* app/actions/patterns-actions.c
	* plug-ins/metadata/interface.c: applied patch from Stephan Binner
	that fixes wrong use of ellipsis (bug #309657).
This commit is contained in:
Sven Neumann 2005-08-22 23:30:23 +00:00 committed by Sven Neumann
parent b6af2173d1
commit 5ea47e3126
6 changed files with 51 additions and 72 deletions

View file

@ -1,3 +1,12 @@
2005-08-23 Sven Neumann <sven@gimp.org>
* app/base/siox.c: minor optimizations.
* app/actions/gradients-actions.c
* app/actions/patterns-actions.c
* plug-ins/metadata/interface.c: applied patch from Stephan Binner
that fixes wrong use of ellipsis (bug #309657).
2005-08-23 Sven Neumann <sven@gimp.org>
* plug-ins/common/sample_colorize.c: use GTK_STOCK_APPLY and fixed

View file

@ -63,7 +63,7 @@ static GimpActionEntry gradients_actions[] =
GIMP_HELP_GRADIENT_SAVE_AS_POV },
{ "gradients-delete", GTK_STOCK_DELETE,
N_("_Delete Gradient..."), "",
N_("_Delete Gradient"), "",
N_("Delete gradient"),
G_CALLBACK (data_delete_cmd_callback),
GIMP_HELP_GRADIENT_DELETE },

View file

@ -62,7 +62,7 @@ static GimpActionEntry patterns_actions[] =
GIMP_HELP_PATTERN_DUPLICATE },
{ "patterns-delete", GTK_STOCK_DELETE,
N_("_Delete Pattern..."), "",
N_("_Delete Pattern"), "",
N_("Delete pattern"),
G_CALLBACK (data_delete_cmd_callback),
GIMP_HELP_PATTERN_DELETE },

View file

@ -599,38 +599,6 @@ threshold_mask (TileManager *mask,
}
}
static void
set_mask (TileManager *mask,
guchar maskval,
gint x,
gint y,
gint width,
gint height)
{
PixelRegion region;
gpointer pr;
gint row, col;
pixel_region_init (&region, mask, x, y, width, height, TRUE);
for (pr = pixel_regions_register (1, &region);
pr != NULL;
pr = pixel_regions_process (pr))
{
guchar *data = region.data;
for (row = 0; row < region.h; row++)
{
guchar *d = data;
for (col = 0; col < region.w; col++, d++)
*d = *d & maskval;
data += region.rowstride;
}
}
}
/* This method checks out the neighbourhood of the pixel at position
* (pos_x,pos_y) in the TileManager mask, it adds the sourrounding
* pixels to the queue to allow further processing it uses maskVal to
@ -762,27 +730,25 @@ find_max_blob (TileManager *mask,
PixelRegion region;
gpointer pr;
gint row, col;
gint half = (width * height) / 2;
gint maxblob_x = 0;
gint maxblob_y = 0;
gint maxregion = 0;
guchar val;
/* this mask is used to check if a pixel has been visited */
const guchar visited = 0x80;
/* this mask is used to set a pixel to unvisited */
const guchar unvisited = 0x7F;
/* this mask is used to flag a pixel as visited in the first pass */
const guchar visited = 0x40;
/* this mask is used to mark a pixel in the second pass */
const guchar contained = 0x80;
threshold_mask (mask, 0x80, 0x1, x, y, width, height);
/* mark every pixel in the mask as unvisited */
set_mask (mask, unvisited, x, y, width, height);
q = g_queue_new ();
pixel_region_init (&region, mask, x, y, width, height, TRUE);
for (pr = pixel_regions_register (1, &region);
pr != NULL;
pr != NULL && maxregion < half;
pr = pixel_regions_process (pr))
{
const guchar *data = region.data;
@ -790,8 +756,8 @@ find_max_blob (TileManager *mask,
for (row = 0; row < region.h; row++, pos_y++)
{
gint pos_x = region.x;
const guchar *d = data;
gint pos_x = region.x;
const guchar *d = data;
for (col = 0; col < region.w; col++, d++, pos_x++)
{
@ -832,26 +798,23 @@ find_max_blob (TileManager *mask,
}
}
/* clear visited flag for all pixels */
set_mask (mask, unvisited, x, y, width, height);
/* now push maxblob coords onto stack and find maxblob again, so
* that it can be set as resulting mask
/* now push maxblob coords to the queue and find maxblob again,
* so that it can be set as the resulting mask
*/
/* mark startpixel as visited */
read_pixel_data_1 (mask, maxblob_x, maxblob_y, &val);
val |= visited;
val |= contained;
write_pixel_data_1 (mask, maxblob_x, maxblob_y, &val);
process_neighbours (q, maxblob_x, maxblob_y,
mask, visited, x, y, width, height);
maxregion = process_queue (q, mask, visited, x, y, width, height);
mask, contained, x, y, width, height);
maxregion = process_queue (q, mask, contained, x, y, width, height);
g_queue_free (q);
/* set found pixel to 255 in the mask */
threshold_mask (mask, visited, 0xFF, x, y, width, height);
threshold_mask (mask, contained, 0xFF, x, y, width, height);
}
static inline void

View file

@ -663,8 +663,8 @@ metadata_dialog (gint32 image_ID,
NULL, 0,
gimp_standard_help_func, EDITOR_PROC,
_("_Import XMP"), RESPONSE_IMPORT,
_("_Export XMP"), RESPONSE_EXPORT,
_("_Import XMP..."), RESPONSE_IMPORT,
_("_Export XMP..."), RESPONSE_EXPORT,
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
GTK_STOCK_OK, GTK_RESPONSE_OK,

View file

@ -11,6 +11,11 @@
#
# - Modified by jacob berkman <jacob@ximian.com> to install
# Makefile.in.in and po2tbl.sed.in for use with glib-gettextize
#
# - Modified by Rodney Dawes <dobey@novell.com> for use with intltool
#
# We have the following line for use by intltoolize:
# INTLTOOL_MAKEFILE
GETTEXT_PACKAGE = @GETTEXT_PACKAGE@
PACKAGE = @PACKAGE@
@ -27,13 +32,13 @@ VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
datadir = @datadir@
datarootdir = @datarootdir@
libdir = @libdir@
localedir = $(libdir)/locale
gnulocaledir = $(datadir)/locale
gettextsrcdir = $(datadir)/glib-2.0/gettext/po
subdir = po
install_sh = @install_sh@
mkdir_p = @mkdir_p@
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
INSTALL = @INSTALL@
@ -61,7 +66,8 @@ SOURCES =
POFILES = @POFILES@
GMOFILES = @GMOFILES@
DISTFILES = ChangeLog Makefile.in.in POTFILES.in \
$(POFILES) $(GMOFILES) $(SOURCES)
$(POFILES) $(SOURCES)
EXTRA_DISTFILES = POTFILES.skip Makevars LINGUAS
POTFILES = \
@ -77,7 +83,7 @@ INSTOBJEXT = @INSTOBJEXT@
.po.pox:
$(MAKE) $(GETTEXT_PACKAGE).pot
$(MSGMERGE) $< $(top_builddir)/po/$(GETTEXT_PACKAGE).pot -o $*pox
$(MSGMERGE) $< $(GETTEXT_PACKAGE).pot -o $*.pox
.po.mo:
$(MSGFMT) -o $@ $<
@ -174,7 +180,7 @@ uninstall:
rm -f $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \
fi
check: all
check: all $(GETTEXT_PACKAGE).pot
dvi info tags TAGS ID:
@ -186,16 +192,21 @@ mostlyclean:
clean: mostlyclean
distclean: clean
rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m
rm -f Makefile Makefile.in POTFILES
rm -f *.mo *.msg *.cat *.cat.m $(GMOFILES)
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f $(GMOFILES)
rm -f Makefile.in.in
distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir)
dist distdir: $(DISTFILES) $(GETTEXT_PACKAGE).pot
dist distdir: $(DISTFILES)
dists="$(DISTFILES)"; \
extra_dists="$(EXTRA_DISTFILES)"; \
for file in $$extra_dists; do \
test -f $$file && dists="$$dists $$file"; \
done; \
for file in $$dists; do \
ln $(srcdir)/$$file $(distdir) 2> /dev/null \
|| cp -p $(srcdir)/$$file $(distdir); \
@ -232,17 +243,13 @@ update-po: Makefile
# and Intltool tags (enclosed in square brackets), and appending a full
# relative path to them
POTFILES: POTFILES.in
( if test 'x$(srcdir)' != 'x.'; then \
posrcprefix='$(top_srcdir)/'; \
else \
posrcprefix="../"; \
fi; \
( posrcprefix='$(top_srcdir)/'; \
rm -f $@-t $@ \
&& (sed -e '/^#/d' \
-e "s/^\[.*\] +//" \
-e '/^[ ]*$$/d' \
-e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
| sed -e '$$s/\\$$//') > $@-t \
&& (sed -e '/^#/d' \
-e 's/^[[].*] *//' \
-e '/^[ ]*$$/d' \
-e "s@^@ $$posrcprefix@" $(srcdir)/$@.in \
| sed -e '$$!s/$$/ \\/') > $@-t \
&& chmod a-w $@-t \
&& mv $@-t $@ )