mirror of https://github.com/GNOME/gimp.git
app/Makefile.am app/channel_pvt.h app/drawable_pvt.h app/gdisplayF.h
2000-12-29 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/channel_pvt.h * app/drawable_pvt.h * app/gdisplayF.h * app/gimpdrawableP.h * app/gimpimageP.h * app/layer_pvt.h * app/toolsF.h: removed these files. * app/apptypes.h * tools/pdbgen/enums.pl: added tons of opaque typedefs and enums. * tools/pdbgen/pdb/brush_select.pdb * tools/pdbgen/pdb/brushes.pdb * tools/pdbgen/pdb/channel.pdb * tools/pdbgen/pdb/color.pdb * tools/pdbgen/pdb/convert.pdb * tools/pdbgen/pdb/display.pdb * tools/pdbgen/pdb/drawable.pdb * tools/pdbgen/pdb/fileops.pdb * tools/pdbgen/pdb/gradient_select.pdb * tools/pdbgen/pdb/gradients.pdb * tools/pdbgen/pdb/help.pdb * tools/pdbgen/pdb/image.pdb * tools/pdbgen/pdb/layer.pdb * tools/pdbgen/pdb/pattern_select.pdb * tools/pdbgen/pdb/patterns.pdb * tools/pdbgen/pdb/selection.pdb * tools/pdbgen/pdb/tools.pdb * app/*: chainsaw #include cleanup: - Never (never!!) include stuff in header files except where we need access to structures' contents (like derived objects). - Added prototypes and proper formating in many files. - The #include order in *all* *.c files is as follows: #include "config.h" #include <system stuff> #include <gtk/gtk.h> #include "apptypes.h" #include "gimp stuff" #include "libgimp stuff" #include "libgimp/gimpintl.h" By following this scheme we can easily see a file's dependencies from it's #include's and can grep for the inclusion to find out where a file is used. * tools/pdbgen/app.pl: changed to follow the include scheme above. * libgimp/Makefile.am * libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h and from app/apptypes.h. * libgimp/gimpcolorbutton.[ch] * libgimp/gimpdialog.[ch] * libgimp/gimphelpui.[ch] * libgimp/gimpparasite.[ch] * libgimp/gimppatheditor.[ch] * libgimp/gimpprotocol.c * libgimp/gimpquerybox.[ch] * libgimp/gimpsizeentry.[ch] * libgimp/gimptypes.h * libgimp/gimpui.h * libgimp/gimpunit.h * libgimp/gimpunitmenu.[ch] * libgimp/gimpwidgets.[ch]: changed accordingly. * plug-ins/FractalExplorer/Dialogs.c * plug-ins/gdyntext/message_window.c * plug-ins/imagemap/imap_default_dialog.c * plug-ins/imagemap/imap_file.c: these files used to include "libgimp/gimpui.h" without including "libgimp/gimp.h". This is no longer possible because the libgimpui headers don't inlcude "libgimp/gimpunit.h" any more.
This commit is contained in:
parent
bc5a1d561b
commit
8d6c335f8f
84
ChangeLog
84
ChangeLog
|
@ -1,3 +1,87 @@
|
|||
2000-12-29 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
* app/channel_pvt.h
|
||||
* app/drawable_pvt.h
|
||||
* app/gdisplayF.h
|
||||
* app/gimpdrawableP.h
|
||||
* app/gimpimageP.h
|
||||
* app/layer_pvt.h
|
||||
* app/toolsF.h: removed these files.
|
||||
|
||||
* app/apptypes.h
|
||||
* tools/pdbgen/enums.pl: added tons of opaque typedefs and enums.
|
||||
|
||||
* tools/pdbgen/pdb/brush_select.pdb
|
||||
* tools/pdbgen/pdb/brushes.pdb
|
||||
* tools/pdbgen/pdb/channel.pdb
|
||||
* tools/pdbgen/pdb/color.pdb
|
||||
* tools/pdbgen/pdb/convert.pdb
|
||||
* tools/pdbgen/pdb/display.pdb
|
||||
* tools/pdbgen/pdb/drawable.pdb
|
||||
* tools/pdbgen/pdb/fileops.pdb
|
||||
* tools/pdbgen/pdb/gradient_select.pdb
|
||||
* tools/pdbgen/pdb/gradients.pdb
|
||||
* tools/pdbgen/pdb/help.pdb
|
||||
* tools/pdbgen/pdb/image.pdb
|
||||
* tools/pdbgen/pdb/layer.pdb
|
||||
* tools/pdbgen/pdb/pattern_select.pdb
|
||||
* tools/pdbgen/pdb/patterns.pdb
|
||||
* tools/pdbgen/pdb/selection.pdb
|
||||
* tools/pdbgen/pdb/tools.pdb
|
||||
* app/*: chainsaw #include cleanup:
|
||||
|
||||
- Never (never!!) include stuff in header files except where we
|
||||
need access to structures' contents (like derived objects).
|
||||
- Added prototypes and proper formating in many files.
|
||||
- The #include order in *all* *.c files is as follows:
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <system stuff>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimp stuff"
|
||||
|
||||
#include "libgimp stuff"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
By following this scheme we can easily see a file's dependencies
|
||||
from it's #include's and can grep for the inclusion to find out
|
||||
where a file is used.
|
||||
|
||||
* tools/pdbgen/app.pl: changed to follow the include scheme above.
|
||||
|
||||
* libgimp/Makefile.am
|
||||
* libgimp/gimpuitypes.h: new file, included from libgimp/gimpui.h
|
||||
and from app/apptypes.h.
|
||||
|
||||
* libgimp/gimpcolorbutton.[ch]
|
||||
* libgimp/gimpdialog.[ch]
|
||||
* libgimp/gimphelpui.[ch]
|
||||
* libgimp/gimpparasite.[ch]
|
||||
* libgimp/gimppatheditor.[ch]
|
||||
* libgimp/gimpprotocol.c
|
||||
* libgimp/gimpquerybox.[ch]
|
||||
* libgimp/gimpsizeentry.[ch]
|
||||
* libgimp/gimptypes.h
|
||||
* libgimp/gimpui.h
|
||||
* libgimp/gimpunit.h
|
||||
* libgimp/gimpunitmenu.[ch]
|
||||
* libgimp/gimpwidgets.[ch]: changed accordingly.
|
||||
|
||||
* plug-ins/FractalExplorer/Dialogs.c
|
||||
* plug-ins/gdyntext/message_window.c
|
||||
* plug-ins/imagemap/imap_default_dialog.c
|
||||
* plug-ins/imagemap/imap_file.c: these files used to include
|
||||
"libgimp/gimpui.h" without including "libgimp/gimp.h". This is
|
||||
no longer possible because the libgimpui headers don't inlcude
|
||||
"libgimp/gimpunit.h" any more.
|
||||
|
||||
2000-12-29 Asbjorn Pettersen <asbjornP@dualog.no>
|
||||
|
||||
* app/module_db.c: OS/2 fix. remove gimp_color_display_register(),,
|
||||
|
|
|
@ -8,10 +8,8 @@ noinst_LIBRARIES = libgimpim.a
|
|||
libgimpim_a_SOURCES = \
|
||||
gimpdrawable.c \
|
||||
gimpdrawable.h \
|
||||
gimpdrawableP.h \
|
||||
gimpimage.c \
|
||||
gimpimage.h \
|
||||
gimpimageP.h \
|
||||
gimpobject.c \
|
||||
gimpobject.h \
|
||||
gimppreviewcache.h \
|
||||
|
@ -61,7 +59,6 @@ gimp_SOURCES = \
|
|||
by_color_select.h \
|
||||
channel.c \
|
||||
channel.h \
|
||||
channel_pvt.h \
|
||||
channel_cmds.c \
|
||||
channels_dialog.c \
|
||||
channels_dialog.h \
|
||||
|
@ -157,7 +154,6 @@ gimp_SOURCES = \
|
|||
fuzzy_select.h \
|
||||
gdisplay.c \
|
||||
gdisplay.h \
|
||||
gdisplayF.h \
|
||||
gdisplay_ops.c \
|
||||
gdisplay_ops.h \
|
||||
general.c \
|
||||
|
@ -249,7 +245,6 @@ gimp_SOURCES = \
|
|||
iscissors.h \
|
||||
layer.c \
|
||||
layer.h \
|
||||
layer_pvt.h \
|
||||
layer_cmds.c \
|
||||
layer_select.c \
|
||||
layer_select.h \
|
||||
|
@ -388,7 +383,6 @@ gimp_SOURCES = \
|
|||
tool_options.h \
|
||||
tools.c \
|
||||
tools.h \
|
||||
toolsF.h \
|
||||
tools_cmds.c \
|
||||
transform_core.c \
|
||||
transform_core.h \
|
||||
|
|
|
@ -37,9 +37,11 @@
|
|||
#include "libgimp/gimpfeatures.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "pixmaps/wilber2.xpm"
|
||||
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __ABOUT_DIALOG_H__
|
||||
#define __ABOUT_DIALOG_H__
|
||||
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -41,13 +44,17 @@
|
|||
#include "floating_sel.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimphelp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient_select.h"
|
||||
#include "image_render.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "layer.h"
|
||||
#include "nav_window.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
|
@ -58,6 +65,7 @@
|
|||
#include "plug_in.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "selection.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
@ -66,9 +74,12 @@
|
|||
#include "gdisplay_color_ui.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define return_if_no_display(gdisp) \
|
||||
gdisp = gdisplay_active (); \
|
||||
if (!gdisp) return
|
||||
|
@ -252,7 +263,7 @@ edit_clear_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
|
||||
edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -266,7 +277,8 @@ edit_fill_cmd_callback (GtkWidget *widget,
|
|||
return_if_no_display (gdisp);
|
||||
|
||||
fill_type = (GimpFillType) callback_action;
|
||||
edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage), fill_type);
|
||||
edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage),
|
||||
fill_type);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -277,7 +289,7 @@ edit_stroke_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
|
||||
gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -323,7 +335,7 @@ select_float_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage),
|
||||
gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage),
|
||||
0, 0);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
@ -892,13 +904,13 @@ layers_previous_cmd_callback (GtkWidget *widget,
|
|||
return_if_no_display (gdisp);
|
||||
|
||||
current_layer =
|
||||
gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
|
||||
new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer - 1);
|
||||
new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1);
|
||||
|
||||
if (new_layer)
|
||||
{
|
||||
gimage_set_active_layer (gdisp->gimage, new_layer);
|
||||
gimp_image_set_active_layer (gdisp->gimage, new_layer);
|
||||
gdisplays_flush ();
|
||||
layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME);
|
||||
}
|
||||
|
@ -915,13 +927,13 @@ layers_next_cmd_callback (GtkWidget *widget,
|
|||
return_if_no_display (gdisp);
|
||||
|
||||
current_layer =
|
||||
gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
|
||||
new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer + 1);
|
||||
new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1);
|
||||
|
||||
if (new_layer)
|
||||
{
|
||||
gimage_set_active_layer (gdisp->gimage, new_layer);
|
||||
gimp_image_set_active_layer (gdisp->gimage, new_layer);
|
||||
gdisplays_flush ();
|
||||
layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME);
|
||||
}
|
||||
|
@ -934,7 +946,7 @@ layers_raise_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -945,7 +957,7 @@ layers_lower_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -956,7 +968,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -967,7 +979,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -978,7 +990,7 @@ layers_anchor_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
floating_sel_anchor (gimage_get_active_layer (gdisp->gimage));
|
||||
floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -999,7 +1011,7 @@ layers_flatten_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_flatten (gdisp->gimage);
|
||||
gimp_image_flatten (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -1086,7 +1098,7 @@ tools_select_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
(* tool_info[tool_type].init_func) (gdisp);
|
||||
|
||||
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
active_tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
}
|
||||
|
||||
/* setting the gdisp_ptr here is a HACK to allow the tools'
|
||||
|
@ -1316,11 +1328,11 @@ image_resize_callback (GtkWidget *widget,
|
|||
if (image_resize->resize->width > 0 &&
|
||||
image_resize->resize->height > 0)
|
||||
{
|
||||
gimage_resize (gimage,
|
||||
image_resize->resize->width,
|
||||
image_resize->resize->height,
|
||||
image_resize->resize->offset_x,
|
||||
image_resize->resize->offset_y);
|
||||
gimp_image_resize (gimage,
|
||||
image_resize->resize->width,
|
||||
image_resize->resize->height,
|
||||
image_resize->resize->offset_x,
|
||||
image_resize->resize->offset_y);
|
||||
gdisplays_flush ();
|
||||
lc_dialog_update_image_list ();
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
|
@ -88,13 +88,14 @@
|
|||
#include "gdisplay.h"
|
||||
#include "general.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "gradient_select.h"
|
||||
#include "menus.h"
|
||||
#include "pattern_select.h" /* Needed for closing pattern dialogs */
|
||||
#include "plug_in.h"
|
||||
|
||||
#include "tile.h" /* ick. */
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpprotocol.h"
|
||||
|
|
|
@ -29,11 +29,12 @@
|
|||
#include "appenv.h"
|
||||
#include "channel.h"
|
||||
#include "color_panel.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplayF.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "qmask.h"
|
||||
|
@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget,
|
|||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimage_remove_channel (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
}
|
||||
|
||||
|
@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget,
|
|||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty(gimg))
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
{
|
||||
if ((layer = gimage_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget,
|
|||
gmask = channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
"Qmask",
|
||||
"Qmask",
|
||||
(gint)(255*opacity)/100,
|
||||
color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
|
@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget,
|
|||
}
|
||||
else
|
||||
{ /* if selection */
|
||||
gmask = channel_copy (gimage_get_mask (gimg));
|
||||
gmask = channel_copy (gimp_image_get_mask (gimg));
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
channel_set_color (gmask, color);
|
||||
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
|
||||
|
@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
gpointer client_data)
|
||||
{
|
||||
EditQmaskOptions *options;
|
||||
Channel *channel;
|
||||
guchar *tmpcolp;
|
||||
guchar tmpcol[3];
|
||||
gboolean update = FALSE;
|
||||
gint opacity;
|
||||
gint i;
|
||||
Channel *channel;
|
||||
const guchar *tmpcolp;
|
||||
guchar tmpcol[3];
|
||||
gboolean update = FALSE;
|
||||
gint opacity;
|
||||
gint i;
|
||||
|
||||
options = (EditQmaskOptions *) client_data;
|
||||
channel = gimp_image_get_channel_by_name (options->gimage, "Qmask");
|
||||
|
@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
{
|
||||
update = TRUE;
|
||||
}
|
||||
tmpcolp = channel_get_color(channel);
|
||||
tmpcolp = channel_get_color (channel);
|
||||
for (i = 0; i < 3; i++)
|
||||
{ /* don't update if color hasn't changed */
|
||||
tmpcol[i] = tmpcolp[i]; /* initialize to same values */
|
||||
|
|
|
@ -29,11 +29,12 @@
|
|||
#include "appenv.h"
|
||||
#include "channel.h"
|
||||
#include "color_panel.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
#include "gdisplayF.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "qmask.h"
|
||||
|
@ -163,7 +164,7 @@ qmask_deactivate (GtkWidget *widget,
|
|||
the qmask_state to FALSE */
|
||||
undo_push_qmask (gimg);
|
||||
gimage_mask_load (gimg, gmask);
|
||||
gimage_remove_channel (gimg, gmask);
|
||||
gimp_image_remove_channel (gimg, gmask);
|
||||
undo_push_group_end (gimg);
|
||||
}
|
||||
|
||||
|
@ -207,9 +208,9 @@ qmask_activate (GtkWidget *widget,
|
|||
|
||||
undo_push_group_start (gimg, QMASK_UNDO);
|
||||
|
||||
if (gimage_mask_is_empty(gimg))
|
||||
if (gimage_mask_is_empty (gimg))
|
||||
{
|
||||
if ((layer = gimage_floating_sel (gimg)))
|
||||
if ((layer = gimp_image_floating_sel (gimg)))
|
||||
{
|
||||
floating_sel_to_layer (layer);
|
||||
}
|
||||
|
@ -217,7 +218,7 @@ qmask_activate (GtkWidget *widget,
|
|||
gmask = channel_new (gimg,
|
||||
gimg->width,
|
||||
gimg->height,
|
||||
"Qmask",
|
||||
"Qmask",
|
||||
(gint)(255*opacity)/100,
|
||||
color);
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
|
@ -225,7 +226,7 @@ qmask_activate (GtkWidget *widget,
|
|||
}
|
||||
else
|
||||
{ /* if selection */
|
||||
gmask = channel_copy (gimage_get_mask (gimg));
|
||||
gmask = channel_copy (gimp_image_get_mask (gimg));
|
||||
gimp_image_add_channel (gimg, gmask, 0);
|
||||
channel_set_color (gmask, color);
|
||||
drawable_set_name (GIMP_DRAWABLE (gmask), "Qmask");
|
||||
|
@ -331,12 +332,12 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
gpointer client_data)
|
||||
{
|
||||
EditQmaskOptions *options;
|
||||
Channel *channel;
|
||||
guchar *tmpcolp;
|
||||
guchar tmpcol[3];
|
||||
gboolean update = FALSE;
|
||||
gint opacity;
|
||||
gint i;
|
||||
Channel *channel;
|
||||
const guchar *tmpcolp;
|
||||
guchar tmpcol[3];
|
||||
gboolean update = FALSE;
|
||||
gint opacity;
|
||||
gint i;
|
||||
|
||||
options = (EditQmaskOptions *) client_data;
|
||||
channel = gimp_image_get_channel_by_name (options->gimage, "Qmask");
|
||||
|
@ -348,7 +349,7 @@ edit_qmask_query_ok_callback (GtkWidget *widget,
|
|||
{
|
||||
update = TRUE;
|
||||
}
|
||||
tmpcolp = channel_get_color(channel);
|
||||
tmpcolp = channel_get_color (channel);
|
||||
for (i = 0; i < 3; i++)
|
||||
{ /* don't update if color hasn't changed */
|
||||
tmpcol[i] = tmpcolp[i]; /* initialize to same values */
|
||||
|
|
|
@ -28,11 +28,14 @@
|
|||
#include "gdisplay.h"
|
||||
#include "gradient.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpui.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "paint_core.h"
|
||||
#include "paint_options.h"
|
||||
#include "selection.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -295,10 +298,10 @@ airbrush_motion (PaintCore *paint_core,
|
|||
double pressure,
|
||||
PaintApplicationMode mode)
|
||||
{
|
||||
GImage *gimage;
|
||||
TempBuf * area;
|
||||
unsigned char col[MAX_CHANNELS];
|
||||
gdouble scale;
|
||||
GImage *gimage;
|
||||
TempBuf *area;
|
||||
guchar col[MAX_CHANNELS];
|
||||
gdouble scale;
|
||||
|
||||
if (!drawable)
|
||||
return;
|
||||
|
|
|
@ -15,17 +15,23 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __AIRBRUSH_H__
|
||||
#define __AIRBRUSH_H__
|
||||
|
||||
#include "tools.h"
|
||||
#include "paint_core.h"
|
||||
|
||||
void * airbrush_paint_func (PaintCore *, GimpDrawable *, int);
|
||||
gboolean airbrush_non_gui (GimpDrawable *, double, int, double *);
|
||||
gboolean airbrush_non_gui_default (GimpDrawable *, int, double *);
|
||||
Tool * tools_new_airbrush (void);
|
||||
void tools_free_airbrush (Tool *);
|
||||
void * airbrush_paint_func (PaintCore *,
|
||||
GimpDrawable *,
|
||||
gint);
|
||||
gboolean airbrush_non_gui (GimpDrawable *,
|
||||
gdouble,
|
||||
gint,
|
||||
gdouble *);
|
||||
gboolean airbrush_non_gui_default (GimpDrawable *,
|
||||
gint,
|
||||
gdouble *);
|
||||
Tool * tools_new_airbrush (void);
|
||||
void tools_free_airbrush (Tool *);
|
||||
|
||||
|
||||
#endif /* __AIRBRUSH_H__ */
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <signal.h>
|
||||
|
@ -38,9 +39,6 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
|
@ -57,6 +55,7 @@
|
|||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpparasite.h"
|
||||
#include "gimpset.h"
|
||||
|
@ -100,8 +99,13 @@
|
|||
#include "gimpparasite.h"
|
||||
|
||||
#include "libgimp/gimplimits.h"
|
||||
#include "libgimp/gimpfeatures.h"
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimphelpui.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define LOGO_WIDTH_MIN 300
|
||||
#define LOGO_HEIGHT_MIN 110
|
||||
#define AUTHORS "Spencer Kimball & Peter Mattis"
|
||||
|
|
|
@ -15,15 +15,20 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __APP_PROCS_H__
|
||||
#define __APP_PROCS_H__
|
||||
|
||||
/* Function declarations */
|
||||
void gimp_init (int, char **);
|
||||
void app_init (void);
|
||||
void app_exit (gboolean);
|
||||
void app_exit_finish (void);
|
||||
int app_exit_finish_done (void);
|
||||
void app_init_update_status(char *label1val, char *label2val, float pct_progress);
|
||||
|
||||
void gimp_init (gint,
|
||||
gchar **);
|
||||
void app_init (void);
|
||||
void app_exit (gboolean );
|
||||
void app_exit_finish (void);
|
||||
gint app_exit_finish_done (void);
|
||||
void app_init_update_status (gchar *label1val,
|
||||
gchar *label2val,
|
||||
gfloat pct_progress);
|
||||
|
||||
|
||||
#endif /* APP_PROCS_H */
|
||||
|
|
285
app/apptypes.h
285
app/apptypes.h
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __APPTYPES_H__
|
||||
#define __APPTYPES_H__
|
||||
|
||||
|
@ -24,7 +25,15 @@
|
|||
* this file defines those enumeration and opaque struct types that
|
||||
* don't depend on any other header. These problems began creeping up
|
||||
* when we started to actually use these enums in function prototypes.
|
||||
*/
|
||||
*/
|
||||
|
||||
#include "undo_types.h"
|
||||
#include "libgimp/gimpmatrix.h"
|
||||
#include "libgimp/gimpvector.h"
|
||||
#include "libgimp/gimpunit.h"
|
||||
|
||||
#include "libgimp/gimpuitypes.h"
|
||||
|
||||
|
||||
/* Should we instead use the enums in libgimp/gimpenums.h? */
|
||||
|
||||
|
@ -118,7 +127,8 @@ typedef enum /*< chop=ADD_ >*/
|
|||
} AddMaskType;
|
||||
|
||||
/* gradient paint modes */
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
ONCE_FORWARD, /* paint through once, then stop */
|
||||
ONCE_BACKWARDS, /* paint once, then stop, but run the gradient the other way */
|
||||
LOOP_SAWTOOTH, /* keep painting, looping through the grad start->end,start->end /|/|/| */
|
||||
|
@ -135,13 +145,215 @@ typedef enum
|
|||
NEAREST_NEIGHBOR_INTERPOLATION
|
||||
} InterpolationType;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
ORIENTATION_UNKNOWN,
|
||||
ORIENTATION_HORIZONTAL,
|
||||
ORIENTATION_VERTICAL
|
||||
} InternalOrientationType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
HORIZONTAL,
|
||||
VERTICAL,
|
||||
UNKNOWN
|
||||
} OrientationType;
|
||||
|
||||
/* Procedural database types */
|
||||
typedef enum
|
||||
{
|
||||
PDB_INT32,
|
||||
PDB_INT16,
|
||||
PDB_INT8,
|
||||
PDB_FLOAT,
|
||||
PDB_STRING,
|
||||
PDB_INT32ARRAY,
|
||||
PDB_INT16ARRAY,
|
||||
PDB_INT8ARRAY,
|
||||
PDB_FLOATARRAY,
|
||||
PDB_STRINGARRAY,
|
||||
PDB_COLOR,
|
||||
PDB_REGION,
|
||||
PDB_DISPLAY,
|
||||
PDB_IMAGE,
|
||||
PDB_LAYER,
|
||||
PDB_CHANNEL,
|
||||
PDB_DRAWABLE,
|
||||
PDB_SELECTION,
|
||||
PDB_BOUNDARY,
|
||||
PDB_PATH,
|
||||
PDB_PARASITE,
|
||||
PDB_STATUS,
|
||||
PDB_END
|
||||
} PDBArgType;
|
||||
|
||||
/* Error types */
|
||||
typedef enum
|
||||
{
|
||||
PDB_EXECUTION_ERROR,
|
||||
PDB_CALLING_ERROR,
|
||||
PDB_PASS_THROUGH,
|
||||
PDB_SUCCESS,
|
||||
PDB_CANCEL
|
||||
} PDBStatusType;
|
||||
|
||||
|
||||
/* Procedure types */
|
||||
typedef enum /*< chop=PDB_ >*/
|
||||
{
|
||||
PDB_INTERNAL,
|
||||
PDB_PLUGIN,
|
||||
PDB_EXTENSION,
|
||||
PDB_TEMPORARY
|
||||
} PDBProcType;
|
||||
|
||||
/* Selection Boolean operations */
|
||||
typedef enum /*< chop=CHANNEL_OP_ >*/
|
||||
{
|
||||
CHANNEL_OP_ADD,
|
||||
CHANNEL_OP_SUB,
|
||||
CHANNEL_OP_REPLACE,
|
||||
CHANNEL_OP_INTERSECT
|
||||
} ChannelOps;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
SELECTION_ADD = CHANNEL_OP_ADD,
|
||||
SELECTION_SUB = CHANNEL_OP_SUB,
|
||||
SELECTION_REPLACE = CHANNEL_OP_REPLACE,
|
||||
SELECTION_INTERSECT = CHANNEL_OP_INTERSECT,
|
||||
SELECTION_MOVE_MASK,
|
||||
SELECTION_MOVE,
|
||||
SELECTION_ANCHOR
|
||||
} SelectOps;
|
||||
|
||||
/* The possible states for tools */
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
INACTIVE,
|
||||
ACTIVE,
|
||||
PAUSED
|
||||
} ToolState;
|
||||
|
||||
/* Tool control actions */
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
PAUSE,
|
||||
RESUME,
|
||||
HALT,
|
||||
CURSOR_UPDATE,
|
||||
DESTROY,
|
||||
RECREATE
|
||||
} ToolAction;
|
||||
|
||||
/* Tool types */
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
TOOL_TYPE_NONE = -1,
|
||||
FIRST_TOOLBOX_TOOL = 0,
|
||||
RECT_SELECT = FIRST_TOOLBOX_TOOL,
|
||||
ELLIPSE_SELECT,
|
||||
FREE_SELECT,
|
||||
FUZZY_SELECT,
|
||||
BEZIER_SELECT,
|
||||
ISCISSORS,
|
||||
MOVE,
|
||||
MAGNIFY,
|
||||
CROP,
|
||||
ROTATE,
|
||||
SCALE,
|
||||
SHEAR,
|
||||
PERSPECTIVE,
|
||||
FLIP,
|
||||
TEXT,
|
||||
COLOR_PICKER,
|
||||
BUCKET_FILL,
|
||||
BLEND,
|
||||
PENCIL,
|
||||
PAINTBRUSH,
|
||||
ERASER,
|
||||
AIRBRUSH,
|
||||
CLONE,
|
||||
CONVOLVE,
|
||||
INK,
|
||||
DODGEBURN,
|
||||
SMUDGE,
|
||||
MEASURE,
|
||||
LAST_TOOLBOX_TOOL = MEASURE,
|
||||
|
||||
/* Non-toolbox tools */
|
||||
BY_COLOR_SELECT,
|
||||
COLOR_BALANCE,
|
||||
BRIGHTNESS_CONTRAST,
|
||||
HUE_SATURATION,
|
||||
POSTERIZE,
|
||||
THRESHOLD,
|
||||
CURVES,
|
||||
LEVELS,
|
||||
HISTOGRAM
|
||||
} ToolType;
|
||||
|
||||
/* possible transform functions */
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
TRANSFORM_CREATING,
|
||||
TRANSFORM_HANDLE_1,
|
||||
TRANSFORM_HANDLE_2,
|
||||
TRANSFORM_HANDLE_3,
|
||||
TRANSFORM_HANDLE_4,
|
||||
TRANSFORM_HANDLE_CENTER
|
||||
} TransformAction;
|
||||
|
||||
/* the different states that the transformation function can be called with */
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
TRANSFORM_INIT,
|
||||
TRANSFORM_MOTION,
|
||||
TRANSFORM_RECALC,
|
||||
TRANSFORM_FINISH
|
||||
} TransformState;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
CURSOR_MODE_TOOL_ICON,
|
||||
CURSOR_MODE_TOOL_CROSSHAIR,
|
||||
CURSOR_MODE_CROSSHAIR
|
||||
} CursorMode;
|
||||
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
CURSOR_MODIFIER_NONE,
|
||||
CURSOR_MODIFIER_PLUS,
|
||||
CURSOR_MODIFIER_MINUS,
|
||||
CURSOR_MODIFIER_INTERSECT,
|
||||
CURSOR_MODIFIER_MOVE,
|
||||
CURSOR_MODIFIER_RESIZE,
|
||||
CURSOR_MODIFIER_CONTROL,
|
||||
CURSOR_MODIFIER_ANCHOR,
|
||||
CURSOR_MODIFIER_FOREGROUND,
|
||||
CURSOR_MODIFIER_BACKGROUND,
|
||||
CURSOR_MODIFIER_PATTERN,
|
||||
CURSOR_MODIFIER_HAND
|
||||
} CursorModifier;
|
||||
|
||||
|
||||
typedef struct _GimpContext GimpContext;
|
||||
typedef struct _GimpContextPreview GimpContextPreview;
|
||||
|
||||
typedef struct _GimpChannel GimpChannel;
|
||||
typedef struct _GimpChannelClass GimpChannelClass;
|
||||
|
||||
typedef GimpChannel Channel; /* convenience */
|
||||
typedef GimpChannel Channel; /* convenience */
|
||||
|
||||
typedef struct _GDisplay GDisplay;
|
||||
|
||||
typedef struct _GPattern GPattern;
|
||||
|
||||
typedef struct _gradient_t gradient_t;
|
||||
|
||||
typedef struct _PaletteEntries PaletteEntries;
|
||||
typedef struct _PaletteEntry PaletteEntry;
|
||||
|
||||
typedef struct _GimpDrawable GimpDrawable;
|
||||
|
||||
typedef struct _GimpLayer GimpLayer;
|
||||
|
@ -149,10 +361,11 @@ typedef struct _GimpLayerClass GimpLayerClass;
|
|||
typedef struct _GimpLayerMask GimpLayerMask;
|
||||
typedef struct _GimpLayerMaskClass GimpLayerMaskClass;
|
||||
|
||||
typedef GimpLayer Layer; /* convenience */
|
||||
typedef GimpLayerMask LayerMask; /* convenience */
|
||||
typedef GimpLayer Layer; /* convenience */
|
||||
typedef GimpLayerMask LayerMask; /* convenience */
|
||||
|
||||
typedef struct _GimpImage GimpImage;
|
||||
typedef GimpImage GImage;
|
||||
|
||||
typedef struct _GimpSet GimpSet;
|
||||
typedef struct _GimpList GimpList;
|
||||
|
@ -160,10 +373,13 @@ typedef struct _GimpList GimpList;
|
|||
typedef struct _Guide Guide;
|
||||
typedef guint32 Tattoo;
|
||||
|
||||
typedef struct _paint_core PaintCore;
|
||||
typedef struct _PaintCore PaintCore;
|
||||
typedef struct _DrawCore DrawCore;
|
||||
|
||||
typedef struct _GimpBrush GimpBrush;
|
||||
typedef struct _GimpBrushList GimpBrushList;
|
||||
typedef struct _GimpBrushGenerated GimpBrushGenerated;
|
||||
typedef struct _GimpBrushPipe GimpBrushPipe;
|
||||
|
||||
typedef struct _GimpObject GimpObject;
|
||||
|
||||
|
@ -178,11 +394,68 @@ typedef struct _layer_mask_undo LayerMaskUndo;
|
|||
|
||||
typedef struct _fs_to_layer_undo FStoLayerUndo;
|
||||
|
||||
typedef struct _Argument Argument;
|
||||
typedef struct _ProcArg ProcArg;
|
||||
typedef struct _ProcRecord ProcRecord;
|
||||
|
||||
typedef struct _PlugIn PlugIn;
|
||||
typedef struct _PlugInDef PlugInDef;
|
||||
typedef struct _PlugInProcDef PlugInProcDef;
|
||||
|
||||
typedef struct _ParasiteList ParasiteList;
|
||||
|
||||
typedef struct _Tile Tile;
|
||||
typedef struct _TileManager TileManager;
|
||||
|
||||
typedef void (* TileValidateProc) (TileManager *tm,
|
||||
Tile *tile);
|
||||
|
||||
typedef struct _PixelRegionIterator PixelRegionIterator;
|
||||
typedef struct _PixelRegion PixelRegion;
|
||||
typedef struct _PixelRegionHolder PixelRegionHolder;
|
||||
|
||||
typedef struct _GimpParasite GimpParasite;
|
||||
|
||||
typedef struct _Path Path;
|
||||
typedef struct _PathPoint PathPoint;
|
||||
typedef struct _PathList PathList;
|
||||
typedef GSList PathUndo;
|
||||
|
||||
typedef struct _TempBuf TempBuf;
|
||||
typedef struct _TempBuf MaskBuf;
|
||||
|
||||
typedef struct _Tool Tool;
|
||||
typedef struct _ToolInfo ToolInfo;
|
||||
typedef struct _ToolOptions ToolOptions;
|
||||
typedef struct _SelectionOptions SelectionOptions;
|
||||
|
||||
typedef void (* ToolOptionsResetFunc) (void);
|
||||
|
||||
typedef struct _BezierPoint BezierPoint;
|
||||
typedef struct _BezierSelect BezierSelect;
|
||||
|
||||
typedef struct gimp_progress_pvt gimp_progress;
|
||||
typedef void (* progress_func_t) (gint ymin,
|
||||
gint ymax,
|
||||
gint curr_y,
|
||||
gpointer progress_data);
|
||||
|
||||
typedef gpointer ImageMap;
|
||||
typedef void (* ImageMapApplyFunc) (PixelRegion *,
|
||||
PixelRegion *,
|
||||
gpointer);
|
||||
|
||||
typedef struct _TransformCore TransformCore;
|
||||
|
||||
typedef struct _ScanConvertPoint ScanConvertPoint;
|
||||
|
||||
typedef struct _InfoDialog InfoDialog;
|
||||
|
||||
typedef struct _Selection Selection;
|
||||
|
||||
typedef struct _HistogramWidget HistogramWidget;
|
||||
|
||||
typedef struct _GimpImageNewValues GimpImageNewValues;
|
||||
|
||||
|
||||
#endif /* __APPTYPES_H__ */
|
||||
|
|
509
app/asupsample.c
509
app/asupsample.c
|
@ -30,7 +30,6 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
@ -39,303 +38,351 @@
|
|||
|
||||
#include "appenv.h"
|
||||
#include "asupsample.h"
|
||||
#include "gimpprogress.h"
|
||||
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
|
||||
/***** Types *****/
|
||||
|
||||
typedef struct {
|
||||
char ready;
|
||||
color_t color;
|
||||
typedef struct
|
||||
{
|
||||
gchar ready;
|
||||
color_t color;
|
||||
} sample_t;
|
||||
|
||||
|
||||
/***** Local functions *****/
|
||||
|
||||
static unsigned long render_sub_pixel(int max_depth, int depth, sample_t **block,
|
||||
int x, int y, int x1, int y1, int x3, int y3,
|
||||
double threshold, int sub_pixel_size, render_func_t render_func,
|
||||
color_t *color, void *render_data);
|
||||
static gulong render_sub_pixel (gint max_depth,
|
||||
gint depth,
|
||||
sample_t **block,
|
||||
gint x,
|
||||
gint y,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x3,
|
||||
gint y3,
|
||||
gdouble threshold,
|
||||
gint sub_pixel_size,
|
||||
render_func_t render_func,
|
||||
color_t *color,
|
||||
gpointer render_data);
|
||||
|
||||
static double color_dist(color_t c1, color_t c2);
|
||||
static gdouble color_dist (color_t c1,
|
||||
color_t c2);
|
||||
|
||||
|
||||
/***** Functions *****/
|
||||
|
||||
/*****/
|
||||
|
||||
unsigned long
|
||||
adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double threshold,
|
||||
render_func_t render_func, void *render_data,
|
||||
put_pixel_func_t put_pixel_func, void *put_pixel_data,
|
||||
progress_func_t progress_func, void *progress_data)
|
||||
gulong
|
||||
adaptive_supersample_area (gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
render_func_t render_func,
|
||||
gpointer render_data,
|
||||
put_pixel_func_t put_pixel_func,
|
||||
gpointer put_pixel_data,
|
||||
progress_func_t progress_func,
|
||||
gpointer progress_data)
|
||||
{
|
||||
int x, y, width; /* Counters, width of region */
|
||||
int xt, xtt, yt; /* Temporary counters */
|
||||
int sub_pixel_size; /* Numbe of samples per pixel (1D) */
|
||||
size_t row_size; /* Memory needed for one row */
|
||||
color_t color; /* Rendered pixel's color */
|
||||
sample_t tmp_sample; /* For swapping samples */
|
||||
sample_t *top_row, *bot_row, *tmp_row; /* Sample rows */
|
||||
sample_t **block; /* Sample block matrix */
|
||||
unsigned long num_samples;
|
||||
int x, y, width; /* Counters, width of region */
|
||||
int xt, xtt, yt; /* Temporary counters */
|
||||
int sub_pixel_size; /* Numbe of samples per pixel (1D) */
|
||||
size_t row_size; /* Memory needed for one row */
|
||||
color_t color; /* Rendered pixel's color */
|
||||
sample_t tmp_sample; /* For swapping samples */
|
||||
sample_t *top_row, *bot_row, *tmp_row; /* Sample rows */
|
||||
sample_t **block; /* Sample block matrix */
|
||||
unsigned long num_samples;
|
||||
|
||||
/* Initialize color */
|
||||
/* Initialize color */
|
||||
|
||||
color.r = 0.0;
|
||||
color.g = 0.0;
|
||||
color.b = 0.0;
|
||||
color.a = 0.0;
|
||||
color.r = 0.0;
|
||||
color.g = 0.0;
|
||||
color.b = 0.0;
|
||||
color.a = 0.0;
|
||||
|
||||
/* Calculate sub-pixel size */
|
||||
/* Calculate sub-pixel size */
|
||||
|
||||
sub_pixel_size = 1 << max_depth; /* 2**max_depth */
|
||||
sub_pixel_size = 1 << max_depth; /* 2**max_depth */
|
||||
|
||||
/* Create row arrays */
|
||||
/* Create row arrays */
|
||||
|
||||
width = x2 - x1 + 1;
|
||||
width = x2 - x1 + 1;
|
||||
|
||||
row_size = (sub_pixel_size * width + 1) * sizeof(sample_t);
|
||||
row_size = (sub_pixel_size * width + 1) * sizeof(sample_t);
|
||||
|
||||
top_row = g_malloc(row_size);
|
||||
bot_row = g_malloc(row_size);
|
||||
top_row = g_malloc(row_size);
|
||||
bot_row = g_malloc(row_size);
|
||||
|
||||
for (x = 0; x < (sub_pixel_size * width + 1); x++) {
|
||||
top_row[x].ready = 0;
|
||||
for (x = 0; x < (sub_pixel_size * width + 1); x++)
|
||||
{
|
||||
top_row[x].ready = 0;
|
||||
|
||||
top_row[x].color.r = 0.0;
|
||||
top_row[x].color.g = 0.0;
|
||||
top_row[x].color.b = 0.0;
|
||||
top_row[x].color.a = 0.0;
|
||||
top_row[x].color.r = 0.0;
|
||||
top_row[x].color.g = 0.0;
|
||||
top_row[x].color.b = 0.0;
|
||||
top_row[x].color.a = 0.0;
|
||||
|
||||
bot_row[x].ready = 0;
|
||||
bot_row[x].ready = 0;
|
||||
|
||||
bot_row[x].color.r = 0.0;
|
||||
bot_row[x].color.g = 0.0;
|
||||
bot_row[x].color.b = 0.0;
|
||||
bot_row[x].color.a = 0.0;
|
||||
} /* for */
|
||||
bot_row[x].color.r = 0.0;
|
||||
bot_row[x].color.g = 0.0;
|
||||
bot_row[x].color.b = 0.0;
|
||||
bot_row[x].color.a = 0.0;
|
||||
}
|
||||
|
||||
/* Allocate block matrix */
|
||||
/* Allocate block matrix */
|
||||
|
||||
block = g_malloc((sub_pixel_size + 1) * sizeof(sample_t *)); /* Rows */
|
||||
block = g_malloc((sub_pixel_size + 1) * sizeof(sample_t *)); /* Rows */
|
||||
|
||||
for (y = 0; y < (sub_pixel_size + 1); y++) {
|
||||
block[y] = g_malloc((sub_pixel_size + 1) * sizeof(sample_t)); /* Columns */
|
||||
for (y = 0; y < (sub_pixel_size + 1); y++)
|
||||
{
|
||||
block[y] = g_malloc((sub_pixel_size + 1) * sizeof(sample_t)); /* Columns */
|
||||
|
||||
for (x = 0; x < (sub_pixel_size + 1); x++) {
|
||||
block[y][x].ready = 0;
|
||||
for (x = 0; x < (sub_pixel_size + 1); x++)
|
||||
{
|
||||
block[y][x].ready = 0;
|
||||
|
||||
block[y][x].color.r = 0;
|
||||
block[y][x].color.g = 0;
|
||||
block[y][x].color.b = 0;
|
||||
block[y][x].color.a = 0;
|
||||
}
|
||||
block[y][x].color.r = 0;
|
||||
block[y][x].color.g = 0;
|
||||
block[y][x].color.b = 0;
|
||||
block[y][x].color.a = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Render region */
|
||||
|
||||
num_samples = 0;
|
||||
|
||||
for (y = y1; y <= y2; y++)
|
||||
{
|
||||
/* Clear the bottom row */
|
||||
|
||||
for (xt = 0; xt < (sub_pixel_size * width + 1); xt++)
|
||||
bot_row[xt].ready = 0;
|
||||
|
||||
/* Clear first column */
|
||||
|
||||
for (yt = 0; yt < (sub_pixel_size + 1); yt++)
|
||||
block[yt][0].ready = 0;
|
||||
|
||||
/* Render row */
|
||||
|
||||
for (x = x1; x <= x2; x++)
|
||||
{
|
||||
/* Initialize block by clearing all but first row/column */
|
||||
|
||||
for (yt = 1; yt < (sub_pixel_size + 1); yt++)
|
||||
for (xt = 1; xt < (sub_pixel_size + 1); xt++)
|
||||
block[yt][xt].ready = 0;
|
||||
|
||||
/* Copy samples from top row to block */
|
||||
|
||||
for (xtt = 0, xt = (x - x1) * sub_pixel_size;
|
||||
xtt < (sub_pixel_size + 1);
|
||||
xtt++, xt++)
|
||||
block[0][xtt] = top_row[xt];
|
||||
|
||||
/* Render pixel on (x, y) */
|
||||
|
||||
num_samples += render_sub_pixel (max_depth, 1, block, x, y, 0, 0,
|
||||
sub_pixel_size, sub_pixel_size,
|
||||
threshold, sub_pixel_size,
|
||||
render_func, &color,
|
||||
render_data);
|
||||
|
||||
if (put_pixel_func)
|
||||
(*put_pixel_func)(x, y, color, put_pixel_data);
|
||||
|
||||
/* Copy block information to rows */
|
||||
|
||||
top_row[((x - x1) + 1) * sub_pixel_size] = block[0][sub_pixel_size];
|
||||
|
||||
for (xtt = 0, xt = (x - x1) * sub_pixel_size;
|
||||
xtt < (sub_pixel_size + 1);
|
||||
xtt++, xt++)
|
||||
bot_row[xt] = block[sub_pixel_size][xtt];
|
||||
|
||||
/* Swap first and last columns */
|
||||
|
||||
for (yt = 0; yt < (sub_pixel_size + 1); yt++)
|
||||
{
|
||||
tmp_sample = block[yt][0];
|
||||
block[yt][0] = block[yt][sub_pixel_size];
|
||||
block[yt][sub_pixel_size] = tmp_sample;
|
||||
}
|
||||
}
|
||||
|
||||
/* Render region */
|
||||
/* Swap rows */
|
||||
|
||||
num_samples = 0;
|
||||
tmp_row = top_row;
|
||||
top_row = bot_row;
|
||||
bot_row = tmp_row;
|
||||
|
||||
for (y = y1; y <= y2; y++) {
|
||||
/* Clear the bottom row */
|
||||
/* Call progress display function */
|
||||
|
||||
for (xt = 0; xt < (sub_pixel_size * width + 1); xt++)
|
||||
bot_row[xt].ready = 0;
|
||||
if (progress_func && !(y & 0xf))
|
||||
(*progress_func)(y1, y2, y, progress_data);
|
||||
}
|
||||
|
||||
/* Clear first column */
|
||||
/* Free memory */
|
||||
|
||||
for (yt = 0; yt < (sub_pixel_size + 1); yt++)
|
||||
block[yt][0].ready = 0;
|
||||
for (y = 0; y < (sub_pixel_size + 1); y++)
|
||||
g_free (block[y]);
|
||||
|
||||
/* Render row */
|
||||
g_free (block);
|
||||
g_free (top_row);
|
||||
g_free (bot_row);
|
||||
|
||||
for (x = x1; x <= x2; x++) {
|
||||
/* Initialize block by clearing all but first row/column */
|
||||
return num_samples;
|
||||
}
|
||||
|
||||
for (yt = 1; yt < (sub_pixel_size + 1); yt++)
|
||||
for (xt = 1; xt < (sub_pixel_size + 1); xt++)
|
||||
block[yt][xt].ready = 0;
|
||||
|
||||
/* Copy samples from top row to block */
|
||||
|
||||
for (xtt = 0, xt = (x - x1) * sub_pixel_size;
|
||||
xtt < (sub_pixel_size + 1);
|
||||
xtt++, xt++)
|
||||
block[0][xtt] = top_row[xt];
|
||||
|
||||
/* Render pixel on (x, y) */
|
||||
|
||||
num_samples += render_sub_pixel(max_depth, 1, block, x, y, 0, 0,
|
||||
sub_pixel_size, sub_pixel_size,
|
||||
threshold, sub_pixel_size, render_func, &color,
|
||||
render_data);
|
||||
|
||||
if (put_pixel_func)
|
||||
(*put_pixel_func)(x, y, color, put_pixel_data);
|
||||
|
||||
/* Copy block information to rows */
|
||||
|
||||
top_row[((x - x1) + 1) * sub_pixel_size] = block[0][sub_pixel_size];
|
||||
|
||||
for (xtt = 0, xt = (x - x1) * sub_pixel_size;
|
||||
xtt < (sub_pixel_size + 1);
|
||||
xtt++, xt++)
|
||||
bot_row[xt] = block[sub_pixel_size][xtt];
|
||||
|
||||
/* Swap first and last columns */
|
||||
|
||||
for (yt = 0; yt < (sub_pixel_size + 1); yt++) {
|
||||
tmp_sample = block[yt][0];
|
||||
block[yt][0] = block[yt][sub_pixel_size];
|
||||
block[yt][sub_pixel_size] = tmp_sample;
|
||||
} /* for */
|
||||
} /* for */
|
||||
|
||||
/* Swap rows */
|
||||
|
||||
tmp_row = top_row;
|
||||
top_row = bot_row;
|
||||
bot_row = tmp_row;
|
||||
|
||||
/* Call progress display function */
|
||||
|
||||
if (progress_func && !(y & 0xf))
|
||||
(*progress_func)(y1, y2, y, progress_data);
|
||||
} /* for */
|
||||
|
||||
/* Free memory */
|
||||
|
||||
for (y = 0; y < (sub_pixel_size + 1); y++)
|
||||
g_free(block[y]);
|
||||
|
||||
g_free(block);
|
||||
g_free(top_row);
|
||||
g_free(bot_row);
|
||||
|
||||
return num_samples;
|
||||
} /* adaptive_supersample_area */
|
||||
|
||||
|
||||
/*****/
|
||||
|
||||
static unsigned long
|
||||
render_sub_pixel(int max_depth, int depth, sample_t **block,
|
||||
int x, int y, int x1, int y1, int x3, int y3,
|
||||
double threshold, int sub_pixel_size, render_func_t render_func,
|
||||
color_t *color, void *render_data)
|
||||
static gulong
|
||||
render_sub_pixel (gint max_depth,
|
||||
gint depth,
|
||||
sample_t **block,
|
||||
gint x,
|
||||
gint y,
|
||||
gint x1,
|
||||
gint y1,
|
||||
gint x3,
|
||||
gint y3,
|
||||
double threshold,
|
||||
gint sub_pixel_size,
|
||||
render_func_t render_func,
|
||||
color_t *color,
|
||||
gpointer render_data)
|
||||
{
|
||||
int x2, y2; /* Coords of center sample */
|
||||
double dx1, dy1; /* Delta to upper left sample */
|
||||
double dx3, dy3; /* Delta to lower right sample */
|
||||
color_t c1, c2, c3, c4; /* Sample colors */
|
||||
unsigned long num_samples;
|
||||
int x2, y2; /* Coords of center sample */
|
||||
double dx1, dy1; /* Delta to upper left sample */
|
||||
double dx3, dy3; /* Delta to lower right sample */
|
||||
color_t c1, c2, c3, c4; /* Sample colors */
|
||||
unsigned long num_samples;
|
||||
|
||||
/* Get offsets for corners */
|
||||
/* Get offsets for corners */
|
||||
|
||||
dx1 = (double) (x1 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
dx3 = (double) (x3 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
dx1 = (double) (x1 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
dx3 = (double) (x3 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
|
||||
dy1 = (double) (y1 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
dy3 = (double) (y3 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
dy1 = (double) (y1 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
dy3 = (double) (y3 - sub_pixel_size / 2) / sub_pixel_size;
|
||||
|
||||
num_samples = 0;
|
||||
num_samples = 0;
|
||||
|
||||
/* Render upper left sample */
|
||||
/* Render upper left sample */
|
||||
|
||||
if (!block[y1][x1].ready) {
|
||||
num_samples++;
|
||||
(*render_func)(x + dx1, y + dy1, &c1, render_data);
|
||||
if (!block[y1][x1].ready)
|
||||
{
|
||||
num_samples++;
|
||||
(*render_func)(x + dx1, y + dy1, &c1, render_data);
|
||||
|
||||
block[y1][x1].ready = 1;
|
||||
block[y1][x1].color = c1;
|
||||
} else
|
||||
c1 = block[y1][x1].color;
|
||||
block[y1][x1].ready = 1;
|
||||
block[y1][x1].color = c1;
|
||||
}
|
||||
else
|
||||
{
|
||||
c1 = block[y1][x1].color;
|
||||
}
|
||||
|
||||
/* Render upper right sample */
|
||||
/* Render upper right sample */
|
||||
|
||||
if (!block[y1][x3].ready) {
|
||||
num_samples++;
|
||||
(*render_func)(x + dx3, y + dy1, &c2, render_data);
|
||||
if (!block[y1][x3].ready)
|
||||
{
|
||||
num_samples++;
|
||||
(*render_func)(x + dx3, y + dy1, &c2, render_data);
|
||||
|
||||
block[y1][x3].ready = 1;
|
||||
block[y1][x3].color = c2;
|
||||
} else
|
||||
c2 = block[y1][x3].color;
|
||||
block[y1][x3].ready = 1;
|
||||
block[y1][x3].color = c2;
|
||||
}
|
||||
else
|
||||
{
|
||||
c2 = block[y1][x3].color;
|
||||
}
|
||||
|
||||
/* Render lower left sample */
|
||||
/* Render lower left sample */
|
||||
|
||||
if (!block[y3][x1].ready) {
|
||||
num_samples++;
|
||||
(*render_func)(x + dx1, y + dy3, &c3, render_data);
|
||||
if (!block[y3][x1].ready)
|
||||
{
|
||||
num_samples++;
|
||||
(*render_func)(x + dx1, y + dy3, &c3, render_data);
|
||||
|
||||
block[y3][x1].ready = 1;
|
||||
block[y3][x1].color = c3;
|
||||
} else
|
||||
c3 = block[y3][x1].color;
|
||||
block[y3][x1].ready = 1;
|
||||
block[y3][x1].color = c3;
|
||||
}
|
||||
else
|
||||
{
|
||||
c3 = block[y3][x1].color;
|
||||
}
|
||||
|
||||
/* Render lower right sample */
|
||||
/* Render lower right sample */
|
||||
|
||||
if (!block[y3][x3].ready) {
|
||||
num_samples++;
|
||||
(*render_func)(x + dx3, y + dy3, &c4, render_data);
|
||||
if (!block[y3][x3].ready)
|
||||
{
|
||||
num_samples++;
|
||||
(*render_func)(x + dx3, y + dy3, &c4, render_data);
|
||||
|
||||
block[y3][x3].ready = 1;
|
||||
block[y3][x3].color = c4;
|
||||
} else
|
||||
c4 = block[y3][x3].color;
|
||||
block[y3][x3].ready = 1;
|
||||
block[y3][x3].color = c4;
|
||||
}
|
||||
else
|
||||
{
|
||||
c4 = block[y3][x3].color;
|
||||
}
|
||||
|
||||
/* Check for supersampling */
|
||||
/* Check for supersampling */
|
||||
|
||||
if (depth <= max_depth) {
|
||||
/* Check whether we have tu supersample */
|
||||
if (depth <= max_depth)
|
||||
{
|
||||
/* Check whether we have tu supersample */
|
||||
|
||||
if ((color_dist(c1, c2) >= threshold) ||
|
||||
(color_dist(c1, c3) >= threshold) ||
|
||||
(color_dist(c1, c4) >= threshold) ||
|
||||
(color_dist(c2, c3) >= threshold) ||
|
||||
(color_dist(c2, c4) >= threshold) ||
|
||||
(color_dist(c3, c4) >= threshold)) {
|
||||
/* Calc coordinates of center subsample */
|
||||
if ((color_dist(c1, c2) >= threshold) ||
|
||||
(color_dist(c1, c3) >= threshold) ||
|
||||
(color_dist(c1, c4) >= threshold) ||
|
||||
(color_dist(c2, c3) >= threshold) ||
|
||||
(color_dist(c2, c4) >= threshold) ||
|
||||
(color_dist(c3, c4) >= threshold)) {
|
||||
/* Calc coordinates of center subsample */
|
||||
|
||||
x2 = (x1 + x3) / 2;
|
||||
y2 = (y1 + y3) / 2;
|
||||
x2 = (x1 + x3) / 2;
|
||||
y2 = (y1 + y3) / 2;
|
||||
|
||||
/* Render sub-blocks */
|
||||
/* Render sub-blocks */
|
||||
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x1, y1, x2, y2,
|
||||
threshold, sub_pixel_size, render_func, &c1,
|
||||
render_data);
|
||||
num_samples += render_sub_pixel (max_depth, depth + 1, block, x, y, x1, y1, x2, y2,
|
||||
threshold, sub_pixel_size, render_func, &c1,
|
||||
render_data);
|
||||
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y1, x3, y2,
|
||||
threshold, sub_pixel_size, render_func, &c2,
|
||||
render_data);
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y1, x3, y2,
|
||||
threshold, sub_pixel_size, render_func, &c2,
|
||||
render_data);
|
||||
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x1, y2, x2, y3,
|
||||
threshold, sub_pixel_size, render_func, &c3,
|
||||
render_data);
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x1, y2, x2, y3,
|
||||
threshold, sub_pixel_size, render_func, &c3,
|
||||
render_data);
|
||||
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y2, x3, y3,
|
||||
threshold, sub_pixel_size, render_func, &c4,
|
||||
render_data);
|
||||
} /* if */
|
||||
} /* if */
|
||||
num_samples += render_sub_pixel(max_depth, depth + 1, block, x, y, x2, y2, x3, y3,
|
||||
threshold, sub_pixel_size, render_func, &c4,
|
||||
render_data);
|
||||
}
|
||||
}
|
||||
|
||||
color->r = 0.25 * (c1.r + c2.r + c3.r + c4.r);
|
||||
color->g = 0.25 * (c1.g + c2.g + c3.g + c4.g);
|
||||
color->b = 0.25 * (c1.b + c2.b + c3.b + c4.b);
|
||||
color->a = 0.25 * (c1.a + c2.a + c3.a + c4.a);
|
||||
color->r = 0.25 * (c1.r + c2.r + c3.r + c4.r);
|
||||
color->g = 0.25 * (c1.g + c2.g + c3.g + c4.g);
|
||||
color->b = 0.25 * (c1.b + c2.b + c3.b + c4.b);
|
||||
color->a = 0.25 * (c1.a + c2.a + c3.a + c4.a);
|
||||
|
||||
return num_samples;
|
||||
} /* render_sub_pixel */
|
||||
return num_samples;
|
||||
}
|
||||
|
||||
|
||||
/*****/
|
||||
|
||||
static double
|
||||
color_dist(color_t c1, color_t c2)
|
||||
static gdouble
|
||||
color_dist (color_t c1,
|
||||
color_t c2)
|
||||
{
|
||||
return fabs(c1.r - c2.r) +
|
||||
fabs(c1.g - c2.g) +
|
||||
fabs(c1.b - c2.b) +
|
||||
fabs(c1.a - c2.a);
|
||||
} /* color_dist */
|
||||
return (fabs (c1.r - c2.r) +
|
||||
fabs (c1.g - c2.g) +
|
||||
fabs (c1.b - c2.b) +
|
||||
fabs (c1.a - c2.a));
|
||||
}
|
||||
|
|
|
@ -20,28 +20,37 @@
|
|||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __ASUPSAMPLE_H__
|
||||
#define __ASUPSAMPLE_H__
|
||||
|
||||
#include "gimpprogress.h"
|
||||
|
||||
/***** Types *****/
|
||||
|
||||
typedef struct {
|
||||
double r, g, b, a; /* Range is [0, 1] */
|
||||
typedef struct
|
||||
{
|
||||
gdouble r, g, b, a; /* Range is [0, 1] */
|
||||
} color_t;
|
||||
|
||||
typedef void (*render_func_t) (double x, double y, color_t *color, void *render_data);
|
||||
typedef void (*put_pixel_func_t) (int x, int y, color_t color, void *put_pixel_data);
|
||||
typedef void (* render_func_t) (gdouble x,
|
||||
gdouble y,
|
||||
color_t *color,
|
||||
gpointer render_data);
|
||||
typedef void (* put_pixel_func_t) (gint x,
|
||||
gint y,
|
||||
color_t color,
|
||||
gpointer put_pixel_data);
|
||||
|
||||
|
||||
/***** Functions *****/
|
||||
|
||||
unsigned long adaptive_supersample_area(int x1, int y1, int x2, int y2, int max_depth, double threshold,
|
||||
render_func_t render_func, void *render_data,
|
||||
put_pixel_func_t put_pixel_func, void *put_pixel_data,
|
||||
progress_func_t progress_func, void *progress_data);
|
||||
gulong adaptive_supersample_area (gint x1,
|
||||
gint y1,
|
||||
gint x2,
|
||||
gint y2,
|
||||
gint max_depth,
|
||||
gdouble threshold,
|
||||
render_func_t render_func,
|
||||
gpointer render_data,
|
||||
put_pixel_func_t put_pixel_func,
|
||||
gpointer put_pixel_data,
|
||||
progress_func_t progress_func,
|
||||
gpointer progress_data);
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* __ASUPSAMPLE_H__ */
|
||||
|
|
|
@ -27,7 +27,10 @@
|
|||
#include "appenv.h"
|
||||
#include "errors.h"
|
||||
#include "boundary.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
|
||||
/* half intensity for mask */
|
||||
#define HALF_WAY 127
|
||||
|
|
|
@ -16,25 +16,31 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "brush_scale.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
||||
MaskBuf *
|
||||
brush_scale_mask (MaskBuf *brush_mask,
|
||||
int dest_width,
|
||||
int dest_height)
|
||||
gint dest_width,
|
||||
gint dest_height)
|
||||
{
|
||||
MaskBuf *scale_brush;
|
||||
int src_width;
|
||||
int src_height;
|
||||
int value;
|
||||
int area;
|
||||
int i, j;
|
||||
int x, x0, y, y0;
|
||||
int dx, dx0, dy, dy0;
|
||||
int fx, fx0, fy, fy0;
|
||||
unsigned char *src, *dest;
|
||||
gint src_width;
|
||||
gint src_height;
|
||||
gint value;
|
||||
gint area;
|
||||
gint i, j;
|
||||
gint x, x0, y, y0;
|
||||
gint dx, dx0, dy, dy0;
|
||||
gint fx, fx0, fy, fy0;
|
||||
guchar *src, *dest;
|
||||
|
||||
g_return_val_if_fail (brush_mask != NULL &&
|
||||
dest_width != 0 && dest_height != 0, NULL);
|
||||
|
@ -174,20 +180,20 @@ brush_scale_mask (MaskBuf *brush_mask,
|
|||
|
||||
MaskBuf *
|
||||
brush_scale_pixmap (MaskBuf *pixmap,
|
||||
int dest_width,
|
||||
int dest_height)
|
||||
gint dest_width,
|
||||
gint dest_height)
|
||||
{
|
||||
MaskBuf *scale_brush;
|
||||
int src_width;
|
||||
int src_height;
|
||||
int value[3];
|
||||
int factor;
|
||||
int area;
|
||||
int i, j;
|
||||
int x, x0, y, y0;
|
||||
int dx, dx0, dy, dy0;
|
||||
int fx, fx0, fy, fy0;
|
||||
unsigned char *src, *src_ptr, *dest;
|
||||
gint src_width;
|
||||
gint src_height;
|
||||
gint value[3];
|
||||
gint factor;
|
||||
gint area;
|
||||
gint i, j;
|
||||
gint x, x0, y, y0;
|
||||
gint dx, dx0, dy, dy0;
|
||||
gint fx, fx0, fy, fy0;
|
||||
guchar *src, *src_ptr, *dest;
|
||||
|
||||
g_return_val_if_fail (pixmap != NULL && pixmap->bytes == 3 &&
|
||||
dest_width != 0 && dest_height != 0, NULL);
|
||||
|
|
|
@ -15,15 +15,18 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BRUSH_SCALE_H__
|
||||
#define __BRUSH_SCALE_H__
|
||||
|
||||
#include "temp_buf.h"
|
||||
|
||||
/* functions */
|
||||
MaskBuf * brush_scale_mask (MaskBuf *brush_mask,
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
MaskBuf * brush_scale_pixmap (MaskBuf *pixmap,
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
|
||||
MaskBuf * brush_scale_mask (MaskBuf *, int, int);
|
||||
MaskBuf * brush_scale_pixmap (MaskBuf *, int, int);
|
||||
|
||||
#endif /* __BRUSH_SCALE_H__ */
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -27,13 +27,18 @@
|
|||
#include "color_transfer.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "image_map.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpcolorspace.h"
|
||||
|
||||
|
||||
#define CYAN_RED 0x1
|
||||
#define MAGENTA_GREEN 0x2
|
||||
#define YELLOW_BLUE 0x4
|
||||
|
@ -212,7 +217,7 @@ color_balance_initialize (GDisplay *gdisp)
|
|||
{
|
||||
gint i;
|
||||
|
||||
if (! drawable_color (gimage_active_drawable (gdisp->gimage)))
|
||||
if (! drawable_color (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
g_message (_("Color balance operates only on RGB color drawables."));
|
||||
return;
|
||||
|
@ -232,7 +237,7 @@ color_balance_initialize (GDisplay *gdisp)
|
|||
color_balance_dialog->yellow_blue[i] = 0.0;
|
||||
}
|
||||
|
||||
color_balance_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
color_balance_dialog->image_map =
|
||||
image_map_create (gdisp, color_balance_dialog->drawable);
|
||||
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
#define __COLOR_BALANCE_H__
|
||||
|
||||
|
||||
#include "image_map.h"
|
||||
#include "tools.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SHADOWS,
|
||||
|
|
|
@ -26,18 +26,24 @@
|
|||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "curves.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimphistogram.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "curves.h"
|
||||
#include "gimplut.h"
|
||||
#include "image_map.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define GRAPH 0x1
|
||||
#define XRANGE_TOP 0x2
|
||||
#define XRANGE_BOTTOM 0x4
|
||||
|
@ -284,7 +290,7 @@ curves_button_press (Tool *tool,
|
|||
GimpDrawable *drawable;
|
||||
|
||||
gdisp = gdisp_ptr;
|
||||
drawable = gimage_active_drawable (gdisp->gimage);
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
tool->gdisp_ptr = gdisp;
|
||||
|
||||
|
@ -322,7 +328,7 @@ curves_button_release (Tool *tool,
|
|||
|
||||
if(!curves_dialog ||
|
||||
!gdisp ||
|
||||
!(drawable = gimage_active_drawable (gdisp->gimage)))
|
||||
!(drawable = gimp_image_active_drawable (gdisp->gimage)))
|
||||
return;
|
||||
|
||||
gdisplay_untransform_coords (gdisp, bevent->x, bevent->y, &x, &y, FALSE, FALSE);
|
||||
|
@ -357,9 +363,9 @@ curves_motion (Tool *tool,
|
|||
|
||||
gdisp = (GDisplay *) gdisp_ptr;
|
||||
|
||||
if(!curves_dialog ||
|
||||
!gdisp ||
|
||||
!(drawable = gimage_active_drawable (gdisp->gimage)))
|
||||
if (! curves_dialog ||
|
||||
! gdisp ||
|
||||
! (drawable = gimp_image_active_drawable (gdisp->gimage)))
|
||||
return;
|
||||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y, FALSE, FALSE);
|
||||
|
@ -443,7 +449,7 @@ curves_initialize (GDisplay *gdisp)
|
|||
{
|
||||
gint i, j;
|
||||
|
||||
if (drawable_indexed (gimage_active_drawable (gdisp->gimage)))
|
||||
if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
g_message (_("Curves for indexed drawables cannot be adjusted."));
|
||||
return;
|
||||
|
@ -466,7 +472,7 @@ curves_initialize (GDisplay *gdisp)
|
|||
curves_channel_reset (i);
|
||||
}
|
||||
|
||||
curves_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
curves_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
curves_dialog->color = drawable_color (curves_dialog->drawable);
|
||||
curves_dialog->image_map = image_map_create (gdisp, curves_dialog->drawable);
|
||||
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
#ifndef __CURVES_H__
|
||||
#define __CURVES_H__
|
||||
|
||||
#include "image_map.h"
|
||||
#include "lut_funcs.h"
|
||||
#include "tools.h"
|
||||
|
||||
#define SMOOTH 0
|
||||
#define GFREE 1
|
||||
|
@ -63,16 +60,17 @@ struct _CurvesDialog
|
|||
GimpLut *lut;
|
||||
};
|
||||
|
||||
Tool * tools_new_curves (void);
|
||||
void tools_free_curves (Tool *tool);
|
||||
Tool * tools_new_curves (void);
|
||||
void tools_free_curves (Tool *tool);
|
||||
|
||||
void curves_dialog_hide (void);
|
||||
void curves_initialize (GDisplay *gdisp);
|
||||
void curves_free (void);
|
||||
gfloat curves_lut_func (CurvesDialog *cd,
|
||||
gint nchannels,
|
||||
gint channel,
|
||||
gfloat value);
|
||||
void curves_calculate_curve (CurvesDialog *cd);
|
||||
|
||||
void curves_dialog_hide (void);
|
||||
void curves_initialize (GDisplay *gdisp);
|
||||
void curves_free (void);
|
||||
float curves_lut_func (CurvesDialog *cd,
|
||||
gint nchannels,
|
||||
gint channel,
|
||||
gfloat value);
|
||||
void curves_calculate_curve (CurvesDialog *cd);
|
||||
|
||||
#endif /* __CURVES_H__ */
|
||||
|
|
|
@ -24,16 +24,21 @@
|
|||
#include <pthread.h>
|
||||
#endif /* ENABLE_MP */
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <libgimp/gimpmath.h>
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "drawable.h"
|
||||
#include "gimphistogram.h"
|
||||
#include "pixel_region.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "channel.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "pixel_processor.h"
|
||||
|
||||
#include <libgimp/gimphelpui.h>
|
||||
#include <libgimp/gimpmath.h>
|
||||
|
||||
|
||||
struct _GimpHistogram
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#ifndef __GIMP_HISTOGRAM_H__
|
||||
#define __GIMP_HISTOGRAM_H__
|
||||
|
||||
#include "pixel_region.h"
|
||||
#include "gimpdrawable.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
|
|
@ -27,67 +27,73 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "gimplut.h"
|
||||
#include "pixel_region.h"
|
||||
|
||||
|
||||
GimpLut *
|
||||
gimp_lut_new ()
|
||||
gimp_lut_new (void)
|
||||
{
|
||||
GimpLut *lut;
|
||||
lut = g_new(GimpLut, 1);
|
||||
lut->luts = NULL;
|
||||
|
||||
lut = g_new (GimpLut, 1);
|
||||
|
||||
lut->luts = NULL;
|
||||
lut->nchannels = 0;
|
||||
|
||||
return lut;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_lut_free (GimpLut *lut)
|
||||
{
|
||||
int i;
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < lut->nchannels; i++)
|
||||
g_free(lut->luts[i]);
|
||||
if (lut->luts)
|
||||
g_free(lut->luts);
|
||||
g_free (lut->luts[i]);
|
||||
g_free (lut->luts);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_lut_setup (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
void *user_data,
|
||||
int nchannels)
|
||||
gint nchannels)
|
||||
{
|
||||
int i, v;
|
||||
double val;
|
||||
gint i, v;
|
||||
gdouble val;
|
||||
|
||||
if (lut->luts)
|
||||
{
|
||||
for (i = 0; i < lut->nchannels; i++)
|
||||
g_free(lut->luts[i]);
|
||||
g_free(lut->luts);
|
||||
}
|
||||
lut->nchannels = nchannels;
|
||||
lut->luts = g_new(unsigned char*, lut->nchannels);
|
||||
for (i = 0; i < lut->nchannels; i++)
|
||||
{
|
||||
lut->luts[i] = g_new(unsigned char, 256);
|
||||
for (v = 0; v < 256; v++)
|
||||
{ /* to add gamma correction use func(v ^ g) ^ 1/g instead. */
|
||||
val = 255.0 * func(user_data, lut->nchannels, i, v/255.0) + 0.5;
|
||||
if (val < 0.0)
|
||||
lut->luts[i][v] = 0;
|
||||
else if (val >= 255.0)
|
||||
lut->luts[i][v] = 255;
|
||||
else
|
||||
lut->luts[i][v] = val;
|
||||
{
|
||||
for (i = 0; i < lut->nchannels; i++)
|
||||
g_free (lut->luts[i]);
|
||||
g_free (lut->luts);
|
||||
}
|
||||
lut->nchannels = nchannels;
|
||||
lut->luts = g_new (guchar*, lut->nchannels);
|
||||
|
||||
for (i = 0; i < lut->nchannels; i++)
|
||||
{
|
||||
lut->luts[i] = g_new (guchar, 256);
|
||||
for (v = 0; v < 256; v++)
|
||||
{ /* to add gamma correction use func(v ^ g) ^ 1/g instead. */
|
||||
val = 255.0 * func (user_data, lut->nchannels, i, v/255.0) + 0.5;
|
||||
if (val < 0.0)
|
||||
lut->luts[i][v] = 0;
|
||||
else if (val >= 255.0)
|
||||
lut->luts[i][v] = 255;
|
||||
else
|
||||
lut->luts[i][v] = val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_lut_setup_exact (GimpLut *lut,
|
||||
GimpLutFunc func,
|
||||
void *user_data,
|
||||
int nchannels)
|
||||
gint nchannels)
|
||||
{
|
||||
gimp_lut_setup(lut, func, user_data, nchannels);
|
||||
gimp_lut_setup (lut, func, user_data, nchannels);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -95,9 +101,9 @@ gimp_lut_process (GimpLut *lut,
|
|||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR)
|
||||
{
|
||||
int h, width, src_r_i, dest_r_i;
|
||||
unsigned char *src, *dest;
|
||||
unsigned char *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL;
|
||||
gint h, width, src_r_i, dest_r_i;
|
||||
guchar *src, *dest;
|
||||
guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL;
|
||||
|
||||
if (lut->nchannels > 0)
|
||||
lut0 = lut->luts[0];
|
||||
|
@ -116,68 +122,70 @@ gimp_lut_process (GimpLut *lut,
|
|||
dest_r_i = destPR->rowstride - (destPR->bytes * srcPR->w);
|
||||
|
||||
if (src_r_i == 0 && dest_r_i == 0)
|
||||
{
|
||||
width *= h;
|
||||
h = 1;
|
||||
}
|
||||
while (h--)
|
||||
{
|
||||
switch (lut->nchannels)
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*dest = lut0[*src];
|
||||
src++;
|
||||
dest++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
dest += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
dest += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
dest[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
dest += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
width *= h;
|
||||
h = 1;
|
||||
}
|
||||
|
||||
while (h--)
|
||||
{
|
||||
switch (lut->nchannels)
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*dest = lut0[*src];
|
||||
src++;
|
||||
dest++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
dest += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
dest += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
dest[0] = lut0[src[0]];
|
||||
dest[1] = lut1[src[1]];
|
||||
dest[2] = lut2[src[2]];
|
||||
dest[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
dest += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
}
|
||||
|
||||
width = srcPR->w;
|
||||
src += src_r_i;
|
||||
dest += dest_r_i;
|
||||
}
|
||||
width = srcPR->w;
|
||||
src += src_r_i;
|
||||
dest += dest_r_i;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gimp_lut_process_inline (GimpLut *lut,
|
||||
PixelRegion *srcPR)
|
||||
{
|
||||
int h, width, src_r_i;
|
||||
unsigned char *src;
|
||||
unsigned char *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL;
|
||||
gint h, width, src_r_i;
|
||||
guchar *src;
|
||||
guchar *lut0 = NULL, *lut1 = NULL, *lut2 = NULL, *lut3 = NULL;
|
||||
|
||||
if (lut->nchannels > 0)
|
||||
lut0 = lut->luts[0];
|
||||
|
@ -194,54 +202,55 @@ gimp_lut_process_inline (GimpLut *lut,
|
|||
src_r_i = srcPR->rowstride - (srcPR->bytes * srcPR->w);
|
||||
|
||||
if (src_r_i == 0)
|
||||
{
|
||||
width *= h;
|
||||
h = 1;
|
||||
}
|
||||
while (h--)
|
||||
{
|
||||
switch (lut->nchannels)
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*src = lut0[*src];
|
||||
src++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
width *= h;
|
||||
h = 1;
|
||||
}
|
||||
|
||||
while (h--)
|
||||
{
|
||||
switch (lut->nchannels)
|
||||
{
|
||||
case 1:
|
||||
while (width--)
|
||||
{
|
||||
*src = lut0[*src];
|
||||
src++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src += 2;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src += 3;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
while (width--)
|
||||
{
|
||||
src[0] = lut0[src[0]];
|
||||
src[1] = lut1[src[1]];
|
||||
src[2] = lut2[src[2]];
|
||||
src[3] = lut3[src[3]];
|
||||
src += 4;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_warning ("gimplut: Error: nchannels = %d\n", lut->nchannels);
|
||||
}
|
||||
width = srcPR->w;
|
||||
src += src_r_i;
|
||||
}
|
||||
width = srcPR->w;
|
||||
src += src_r_i;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -249,5 +258,5 @@ gimp_lut_process_2 (PixelRegion *srcPR,
|
|||
PixelRegion *destPR,
|
||||
GimpLut *lut)
|
||||
{
|
||||
gimp_lut_process(lut, srcPR, destPR);
|
||||
gimp_lut_process (lut, srcPR, destPR);
|
||||
}
|
||||
|
|
|
@ -22,9 +22,6 @@
|
|||
#define __GIMP_LUT_H__
|
||||
|
||||
|
||||
#include "pixel_region.h"
|
||||
|
||||
|
||||
struct _GimpLut
|
||||
{
|
||||
guchar **luts;
|
||||
|
|
|
@ -15,9 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -25,8 +26,13 @@
|
|||
#include "drawable.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "image_map.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpcolorspace.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
@ -287,7 +293,7 @@ hue_saturation_initialize (GDisplay *gdisp)
|
|||
{
|
||||
gint i;
|
||||
|
||||
if (! drawable_color (gimage_active_drawable (gdisp->gimage)))
|
||||
if (! drawable_color (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
g_message (_("Hue-Saturation operates only on RGB color drawables."));
|
||||
return;
|
||||
|
@ -307,7 +313,7 @@ hue_saturation_initialize (GDisplay *gdisp)
|
|||
hue_saturation_dialog->saturation[i] = 0.0;
|
||||
}
|
||||
|
||||
hue_saturation_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
hue_saturation_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
hue_saturation_dialog->image_map =
|
||||
image_map_create (gdisp, hue_saturation_dialog->drawable);
|
||||
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
#ifndef __HUE_SATURATION_H__
|
||||
#define __HUE_SATURATION_H__
|
||||
|
||||
#include "image_map.h"
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -57,16 +54,17 @@ struct _HueSaturationDialog
|
|||
gboolean preview;
|
||||
};
|
||||
|
||||
Tool * tools_new_hue_saturation (void);
|
||||
void tools_free_hue_saturation (Tool *tool);
|
||||
Tool * tools_new_hue_saturation (void);
|
||||
void tools_free_hue_saturation (Tool *tool);
|
||||
|
||||
void hue_saturation_initialize (GDisplay *gdisp);
|
||||
void hue_saturation_free (void);
|
||||
void hue_saturation_dialog_hide (void);
|
||||
void hue_saturation (PixelRegion *srcPR,
|
||||
PixelRegion *destPR,
|
||||
void *data);
|
||||
void hue_saturation_initialize (GDisplay *gdisp);
|
||||
void hue_saturation_free (void);
|
||||
void hue_saturation_dialog_hide (void);
|
||||
void hue_saturation (PixelRegion *srcPR,
|
||||
PixelRegion *destPR,
|
||||
void *data);
|
||||
|
||||
void hue_saturation_calculate_transfers (HueSaturationDialog *hsd);
|
||||
|
||||
void hue_saturation_calculate_transfers (HueSaturationDialog *hsd);
|
||||
|
||||
#endif /* __HUE_SATURATION_H__ */
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -31,6 +30,7 @@
|
|||
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
|
||||
/* ---------- Brightness/Contrast -----------*/
|
||||
|
||||
typedef struct B_C_struct
|
||||
|
|
|
@ -20,45 +20,53 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include "pixel_processor.h"
|
||||
#include "pixel_region.h"
|
||||
#include "gimprc.h"
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef ENABLE_MP
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
#define IF_THREAD(statement) statement
|
||||
|
||||
#else /* !ENABLE_MP */
|
||||
|
||||
#define IF_THREAD(statement)
|
||||
|
||||
#endif /* ENABLE_MP */
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <apptypes.h>
|
||||
|
||||
#include "pixel_processor.h"
|
||||
#include "pixel_region.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
||||
typedef void (*p1_func)(void *, PixelRegion *);
|
||||
typedef void (*p2_func)(void *, PixelRegion * ,PixelRegion *);
|
||||
typedef void (*p3_func)(void *, PixelRegion * ,PixelRegion *, PixelRegion *);
|
||||
typedef void (*p4_func)(void *, PixelRegion * ,PixelRegion *, PixelRegion *,
|
||||
PixelRegion *);
|
||||
typedef void (* p1_func) (gpointer ,
|
||||
PixelRegion *);
|
||||
typedef void (* p2_func) (gpointer ,
|
||||
PixelRegion * ,
|
||||
PixelRegion *);
|
||||
typedef void (* p3_func) (gpointer ,
|
||||
PixelRegion *,
|
||||
PixelRegion *,
|
||||
PixelRegion *);
|
||||
typedef void (* p4_func) (gpointer ,
|
||||
PixelRegion *,
|
||||
PixelRegion *,
|
||||
PixelRegion *,
|
||||
PixelRegion *);
|
||||
|
||||
struct _PixelProcessor
|
||||
{
|
||||
void *data;
|
||||
p_func f;
|
||||
gpointer data;
|
||||
p_func f;
|
||||
PixelRegionIterator *PRI;
|
||||
IF_THREAD(pthread_mutex_t mutex;)
|
||||
int nthreads;
|
||||
int n_regions;
|
||||
PixelRegion *r[4];
|
||||
gint nthreads;
|
||||
gint n_regions;
|
||||
PixelRegion *r[4];
|
||||
|
||||
void *progress_report_data;
|
||||
ProgressReportFunc progress_report_func;
|
||||
void *progress_report_data;
|
||||
ProgressReportFunc progress_report_func;
|
||||
};
|
||||
|
||||
IF_THREAD(
|
||||
|
|
|
@ -21,20 +21,31 @@
|
|||
#ifndef __PIXEL_PROCESSOR_H__
|
||||
#define __PIXEL_PROCESSOR_H__
|
||||
|
||||
|
||||
typedef struct _PixelProcessor PixelProcessor;
|
||||
|
||||
typedef void (*p_func)(void);
|
||||
typedef int (*ProgressReportFunc)(void *, int, int, int, int);
|
||||
typedef void (* p_func) (void);
|
||||
typedef gint (* ProgressReportFunc) (void *,
|
||||
gint,
|
||||
gint,
|
||||
gint,
|
||||
gint);
|
||||
|
||||
void pixel_regions_process_parallel (p_func f, void *data, int num_regions,
|
||||
...);
|
||||
PixelProcessor *pixel_process_progress (p_func f, void *data,
|
||||
ProgressReportFunc progress_func,
|
||||
void *progress_data,
|
||||
int num_regions, ...);
|
||||
|
||||
void pixel_processor_free (PixelProcessor *);
|
||||
void pixel_processor_stop (PixelProcessor *);
|
||||
PixelProcessor *pixel_processor_cont (PixelProcessor *);
|
||||
void pixel_regions_process_parallel (p_func f,
|
||||
gpointer data,
|
||||
gint num_regions,
|
||||
...);
|
||||
PixelProcessor * pixel_process_progress (p_func f,
|
||||
gpointer data,
|
||||
ProgressReportFunc progress_func,
|
||||
gpointer progress_data,
|
||||
gint num_regions,
|
||||
...);
|
||||
|
||||
void pixel_processor_free (PixelProcessor *);
|
||||
void pixel_processor_stop (PixelProcessor *);
|
||||
PixelProcessor * pixel_processor_cont (PixelProcessor *);
|
||||
|
||||
|
||||
#endif /* __PIXEL_PROCESSOR_H__ */
|
||||
|
|
|
@ -21,15 +21,17 @@
|
|||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tile_manager_pvt.h"
|
||||
#include "tile.h" /* ick. */
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
/*********************/
|
||||
|
|
|
@ -15,15 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __PIXEL_REGION_H__
|
||||
#define __PIXEL_REGION_H__
|
||||
|
||||
#include "tile_manager.h"
|
||||
#include "pixel_processor.h" /* this is temporary, */
|
||||
|
||||
|
||||
typedef struct _PixelRegion PixelRegion;
|
||||
|
||||
struct _PixelRegion
|
||||
{
|
||||
guchar *data; /* pointer to region data */
|
||||
|
@ -41,9 +36,6 @@ struct _PixelRegion
|
|||
gint process_count; /* used internally */
|
||||
};
|
||||
|
||||
|
||||
typedef struct _PixelRegionHolder PixelRegionHolder;
|
||||
|
||||
struct _PixelRegionHolder
|
||||
{
|
||||
PixelRegion *PR;
|
||||
|
@ -53,9 +45,6 @@ struct _PixelRegionHolder
|
|||
gint count;
|
||||
};
|
||||
|
||||
|
||||
typedef struct _PixelRegionIterator PixelRegionIterator;
|
||||
|
||||
struct _PixelRegionIterator
|
||||
{
|
||||
GSList *pixel_regions;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -39,16 +39,20 @@
|
|||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "pixel_region.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimpcolorspace.h"
|
||||
|
||||
|
||||
static guchar * temp_buf_allocate (guint);
|
||||
static void temp_buf_to_color (TempBuf *, TempBuf *);
|
||||
static void temp_buf_to_gray (TempBuf *, TempBuf *);
|
||||
static void temp_buf_to_color (TempBuf *,
|
||||
TempBuf *);
|
||||
static void temp_buf_to_gray (TempBuf *,
|
||||
TempBuf *);
|
||||
|
||||
|
||||
/* Memory management */
|
||||
|
|
|
@ -15,11 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __TEMP_BUF_H__
|
||||
#define __TEMP_BUF_H__
|
||||
|
||||
typedef struct _TempBuf TempBuf;
|
||||
typedef struct _TempBuf MaskBuf;
|
||||
|
||||
struct _TempBuf
|
||||
{
|
||||
|
@ -37,17 +36,34 @@ struct _TempBuf
|
|||
|
||||
/* The temp buffer functions */
|
||||
|
||||
TempBuf * temp_buf_new (gint, gint, gint, gint, gint, guchar *);
|
||||
TempBuf * temp_buf_copy (TempBuf *, TempBuf *);
|
||||
TempBuf * temp_buf_resize (TempBuf *, gint, gint, gint, gint, gint);
|
||||
TempBuf * temp_buf_copy_area (TempBuf *, TempBuf *,
|
||||
gint, gint, gint, gint, gint);
|
||||
TempBuf * temp_buf_new (gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
guchar *);
|
||||
TempBuf * temp_buf_copy (TempBuf *,
|
||||
TempBuf *);
|
||||
TempBuf * temp_buf_resize (TempBuf *,
|
||||
gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gint );
|
||||
TempBuf * temp_buf_copy_area (TempBuf *,
|
||||
TempBuf *,
|
||||
gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gint ,
|
||||
gint );
|
||||
void temp_buf_free (TempBuf *);
|
||||
guchar * temp_buf_data (TempBuf *);
|
||||
|
||||
/* The mask buffer functions */
|
||||
|
||||
MaskBuf * mask_buf_new (gint, gint);
|
||||
MaskBuf * mask_buf_new (gint ,
|
||||
gint );
|
||||
void mask_buf_free (MaskBuf *);
|
||||
guchar * mask_buf_data (MaskBuf *);
|
||||
|
||||
|
@ -62,4 +78,5 @@ void temp_buf_swap_free (TempBuf *);
|
|||
|
||||
void swapping_free (void);
|
||||
|
||||
|
||||
#endif /* __TEMP_BUF_H__ */
|
||||
|
|
|
@ -18,15 +18,23 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimphistogram.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "histogramwidget.h"
|
||||
#include "image_map.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "pixel_region.h"
|
||||
#include "threshold.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
@ -212,7 +220,7 @@ tools_free_threshold (Tool *tool)
|
|||
void
|
||||
threshold_initialize (GDisplay *gdisp)
|
||||
{
|
||||
if (drawable_indexed (gimage_active_drawable (gdisp->gimage)))
|
||||
if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
g_message (_("Threshold does not operate on indexed drawables."));
|
||||
return;
|
||||
|
@ -228,7 +236,7 @@ threshold_initialize (GDisplay *gdisp)
|
|||
threshold_dialog->low_threshold = 127;
|
||||
threshold_dialog->high_threshold = 255;
|
||||
|
||||
threshold_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
threshold_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
threshold_dialog->color = drawable_color (threshold_dialog->drawable);
|
||||
threshold_dialog->image_map =
|
||||
image_map_create (gdisp, threshold_dialog->drawable);
|
||||
|
|
|
@ -19,10 +19,6 @@
|
|||
#ifndef __THRESHOLD_H__
|
||||
#define __THRESHOLD_H__
|
||||
|
||||
#include "image_map.h"
|
||||
#include "histogramwidget.h"
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
typedef struct _ThresholdDialog ThresholdDialog;
|
||||
|
||||
|
@ -46,14 +42,15 @@ struct _ThresholdDialog
|
|||
gboolean preview;
|
||||
};
|
||||
|
||||
Tool * tools_new_threshold (void);
|
||||
void tools_free_threshold (Tool *tool);
|
||||
|
||||
Tool * tools_new_threshold (void);
|
||||
void tools_free_threshold (Tool *tool);
|
||||
|
||||
void threshold_dialog_hide (void);
|
||||
void threshold_initialize (GDisplay *gdisp);
|
||||
void threshold_2 (void *data,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR);
|
||||
void threshold_initialize (GDisplay *gdisp);
|
||||
void threshold_2 (gpointer data,
|
||||
PixelRegion *srcPR,
|
||||
PixelRegion *destPR);
|
||||
|
||||
|
||||
#endif /* __THRESHOLD_H__ */
|
||||
|
|
|
@ -1,16 +1,38 @@
|
|||
#include <gtk/gtkmain.h>
|
||||
#include <glib.h>
|
||||
#include "gimprc.h"
|
||||
#include "tile.h"
|
||||
#include "tile_cache.h"
|
||||
#include "tile_swap.h"
|
||||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef USE_PTHREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#include "tile_pvt.h" /* ick. */
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "gimprc.h"
|
||||
#include "tile.h"
|
||||
#include "tile_cache.h"
|
||||
#include "tile_swap.h"
|
||||
#include "tile_pvt.h"
|
||||
|
||||
#include "stdio.h"
|
||||
|
||||
/* This is the percentage of the maximum cache size that should be cleared
|
||||
* from the cache when an eviction is necessary
|
||||
|
|
|
@ -1,13 +1,28 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __TILE_CACHE_H__
|
||||
#define __TILE_CACHE_H__
|
||||
|
||||
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
void tile_cache_insert (Tile *tile);
|
||||
void tile_cache_flush (Tile *tile);
|
||||
void tile_cache_set_size (unsigned long cache_size);
|
||||
void tile_cache_insert (Tile *tile);
|
||||
void tile_cache_flush (Tile *tile);
|
||||
void tile_cache_set_size (gulong cache_size);
|
||||
|
||||
|
||||
#endif /* __TILE_CACHE_H__ */
|
||||
|
|
|
@ -15,27 +15,28 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __TILE_MANAGER_PVT_H__
|
||||
#define __TILE_MANAGER_PVT_H__
|
||||
|
||||
#include "tile.h"
|
||||
|
||||
struct _TileManager
|
||||
{
|
||||
int x, y; /* tile manager offsets */
|
||||
gint x, y; /* tile manager offsets */
|
||||
|
||||
int width; /* the width of the tiled area */
|
||||
int height; /* the height of the tiled area */
|
||||
int bpp; /* the bpp of each tile */
|
||||
gint width; /* the width of the tiled area */
|
||||
gint height; /* the height of the tiled area */
|
||||
gint bpp; /* the bpp of each tile */
|
||||
|
||||
int ntile_rows; /* the number of tiles in each row */
|
||||
int ntile_cols; /* the number of tiles in each columns */
|
||||
gint ntile_rows; /* the number of tiles in each row */
|
||||
gint ntile_cols; /* the number of tiles in each columns */
|
||||
|
||||
Tile **tiles; /* the tiles for this level */
|
||||
TileValidateProc validate_proc; /* this proc is called when an attempt to get an
|
||||
* invalid tile is made.
|
||||
*/
|
||||
void *user_data; /* hook for hanging data off of */
|
||||
Tile **tiles; /* the tiles for this level */
|
||||
TileValidateProc validate_proc; /* this proc is called when an attempt
|
||||
* to get an invalid tile is made.
|
||||
*/
|
||||
|
||||
gpointer user_data; /* hook for hanging data off of */
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -16,8 +16,14 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "tile_cache.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tile_swap.h"
|
||||
|
@ -26,33 +32,34 @@
|
|||
#include "tile_pvt.h" /* ick. */
|
||||
|
||||
|
||||
static int tile_manager_get_tile_num (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel);
|
||||
static gint tile_manager_get_tile_num (TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel);
|
||||
|
||||
|
||||
TileManager*
|
||||
tile_manager_new (int toplevel_width,
|
||||
int toplevel_height,
|
||||
int bpp)
|
||||
TileManager *
|
||||
tile_manager_new (gint toplevel_width,
|
||||
gint toplevel_height,
|
||||
gint bpp)
|
||||
{
|
||||
TileManager *tm;
|
||||
int width, height;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
tm = g_new (TileManager, 1);
|
||||
|
||||
tm->user_data = NULL;
|
||||
tm->user_data = NULL;
|
||||
tm->validate_proc = NULL;
|
||||
|
||||
width = toplevel_width;
|
||||
width = toplevel_width;
|
||||
height = toplevel_height;
|
||||
|
||||
tm->width = width;
|
||||
tm->height = height;
|
||||
tm->bpp = bpp;
|
||||
tm->width = width;
|
||||
tm->height = height;
|
||||
tm->bpp = bpp;
|
||||
tm->ntile_rows = (height + TILE_HEIGHT - 1) / TILE_HEIGHT;
|
||||
tm->ntile_cols = (width + TILE_WIDTH - 1) / TILE_WIDTH;
|
||||
tm->tiles = NULL;
|
||||
tm->ntile_cols = (width + TILE_WIDTH - 1) / TILE_WIDTH;
|
||||
tm->tiles = NULL;
|
||||
|
||||
return tm;
|
||||
}
|
||||
|
@ -60,8 +67,8 @@ tile_manager_new (int toplevel_width,
|
|||
void
|
||||
tile_manager_destroy (TileManager *tm)
|
||||
{
|
||||
int ntiles;
|
||||
int i;
|
||||
gint ntiles;
|
||||
gint i;
|
||||
|
||||
if (tm->tiles)
|
||||
{
|
||||
|
@ -88,14 +95,14 @@ tile_manager_set_validate_proc (TileManager *tm,
|
|||
}
|
||||
|
||||
|
||||
Tile*
|
||||
Tile *
|
||||
tile_manager_get_tile (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel,
|
||||
int wantread,
|
||||
int wantwrite)
|
||||
gint xpixel,
|
||||
gint ypixel,
|
||||
gint wantread,
|
||||
gint wantwrite)
|
||||
{
|
||||
int tile_num;
|
||||
gint tile_num;
|
||||
|
||||
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
|
||||
if (tile_num < 0)
|
||||
|
@ -104,19 +111,19 @@ tile_manager_get_tile (TileManager *tm,
|
|||
return tile_manager_get (tm, tile_num, wantread, wantwrite);
|
||||
}
|
||||
|
||||
Tile*
|
||||
Tile *
|
||||
tile_manager_get (TileManager *tm,
|
||||
int tile_num,
|
||||
int wantread,
|
||||
int wantwrite)
|
||||
gint tile_num,
|
||||
gint wantread,
|
||||
gint wantwrite)
|
||||
{
|
||||
Tile **tiles;
|
||||
Tile **tile_ptr;
|
||||
int ntiles;
|
||||
int nrows, ncols;
|
||||
int right_tile;
|
||||
int bottom_tile;
|
||||
int i, j, k;
|
||||
gint ntiles;
|
||||
gint nrows, ncols;
|
||||
gint right_tile;
|
||||
gint bottom_tile;
|
||||
gint i, j, k;
|
||||
|
||||
ntiles = tm->ntile_rows * tm->ntile_cols;
|
||||
|
||||
|
@ -125,13 +132,13 @@ tile_manager_get (TileManager *tm,
|
|||
|
||||
if (!tm->tiles)
|
||||
{
|
||||
tm->tiles = g_new (Tile*, ntiles);
|
||||
tm->tiles = g_new (Tile *, ntiles);
|
||||
tiles = tm->tiles;
|
||||
|
||||
nrows = tm->ntile_rows;
|
||||
ncols = tm->ntile_cols;
|
||||
|
||||
right_tile = tm->width - ((ncols - 1) * TILE_WIDTH);
|
||||
right_tile = tm->width - ((ncols - 1) * TILE_WIDTH);
|
||||
bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT);
|
||||
|
||||
for (i = 0, k = 0; i < nrows; i++)
|
||||
|
@ -229,11 +236,11 @@ tile_manager_get (TileManager *tm,
|
|||
|
||||
void
|
||||
tile_manager_get_async (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel)
|
||||
gint xpixel,
|
||||
gint ypixel)
|
||||
{
|
||||
Tile *tile_ptr;
|
||||
int tile_num;
|
||||
gint tile_num;
|
||||
|
||||
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
|
||||
if (tile_num < 0)
|
||||
|
@ -269,9 +276,9 @@ void
|
|||
tile_manager_invalidate_tiles (TileManager *tm,
|
||||
Tile *toplevel_tile)
|
||||
{
|
||||
double x, y;
|
||||
int row, col;
|
||||
int num;
|
||||
gdouble x, y;
|
||||
gint row, col;
|
||||
gint num;
|
||||
|
||||
col = toplevel_tile->tlink->tile_num % tm->ntile_cols;
|
||||
row = toplevel_tile->tlink->tile_num / tm->ntile_cols;
|
||||
|
@ -290,26 +297,31 @@ tile_manager_invalidate_tiles (TileManager *tm,
|
|||
|
||||
|
||||
void
|
||||
tile_invalidate_tile (Tile **tile_ptr, TileManager *tm,
|
||||
int xpixel, int ypixel)
|
||||
tile_invalidate_tile (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel)
|
||||
{
|
||||
int tile_num;
|
||||
gint tile_num;
|
||||
|
||||
tile_num = tile_manager_get_tile_num (tm, xpixel, ypixel);
|
||||
if (tile_num < 0) return;
|
||||
if (tile_num < 0)
|
||||
return;
|
||||
|
||||
tile_invalidate (tile_ptr, tm, tile_num);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
tile_invalidate (Tile **tile_ptr, TileManager *tm, int tile_num)
|
||||
tile_invalidate (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint tile_num)
|
||||
{
|
||||
Tile *tile = *tile_ptr;
|
||||
|
||||
TILE_MUTEX_LOCK (tile);
|
||||
|
||||
if (!tile->valid)
|
||||
if (!tile->valid)
|
||||
goto leave;
|
||||
|
||||
if (tile->share_count > 1)
|
||||
|
@ -350,13 +362,13 @@ leave:
|
|||
|
||||
void
|
||||
tile_manager_map_tile (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel,
|
||||
gint xpixel,
|
||||
gint ypixel,
|
||||
Tile *srctile)
|
||||
{
|
||||
int tile_row;
|
||||
int tile_col;
|
||||
int tile_num;
|
||||
gint tile_row;
|
||||
gint tile_col;
|
||||
gint tile_num;
|
||||
|
||||
if ((xpixel < 0) || (xpixel >= tm->width) ||
|
||||
(ypixel < 0) || (ypixel >= tm->height))
|
||||
|
@ -374,16 +386,16 @@ tile_manager_map_tile (TileManager *tm,
|
|||
|
||||
void
|
||||
tile_manager_map (TileManager *tm,
|
||||
int tile_num,
|
||||
gint tile_num,
|
||||
Tile *srctile)
|
||||
{
|
||||
Tile **tiles;
|
||||
Tile **tile_ptr;
|
||||
int ntiles;
|
||||
int nrows, ncols;
|
||||
int right_tile;
|
||||
int bottom_tile;
|
||||
int i, j, k;
|
||||
gint ntiles;
|
||||
gint nrows, ncols;
|
||||
gint right_tile;
|
||||
gint bottom_tile;
|
||||
gint i, j, k;
|
||||
|
||||
ntiles = tm->ntile_rows * tm->ntile_cols;
|
||||
|
||||
|
@ -397,13 +409,13 @@ tile_manager_map (TileManager *tm,
|
|||
{
|
||||
g_warning ("tile_manager_map: empty tile level - init'ing.");
|
||||
|
||||
tm->tiles = g_new (Tile*, ntiles);
|
||||
tm->tiles = g_new (Tile *, ntiles);
|
||||
tiles = tm->tiles;
|
||||
|
||||
nrows = tm->ntile_rows;
|
||||
ncols = tm->ntile_cols;
|
||||
|
||||
right_tile = tm->width - ((ncols - 1) * TILE_WIDTH);
|
||||
right_tile = tm->width - ((ncols - 1) * TILE_WIDTH);
|
||||
bottom_tile = tm->height - ((nrows - 1) * TILE_HEIGHT);
|
||||
|
||||
for (i = 0, k = 0; i < nrows; i++)
|
||||
|
@ -437,10 +449,11 @@ tile_manager_map (TileManager *tm,
|
|||
TILE_MUTEX_LOCK (*tile_ptr);
|
||||
if ((*tile_ptr)->ewidth != srctile->ewidth ||
|
||||
(*tile_ptr)->eheight != srctile->eheight ||
|
||||
(*tile_ptr)->bpp != srctile->bpp) {
|
||||
g_warning ("tile_manager_map: nonconformant map (%p -> %p)",
|
||||
srctile, *tile_ptr);
|
||||
}
|
||||
(*tile_ptr)->bpp != srctile->bpp)
|
||||
{
|
||||
g_warning ("tile_manager_map: nonconformant map (%p -> %p)",
|
||||
srctile, *tile_ptr);
|
||||
}
|
||||
tile_detach (*tile_ptr, tm, tile_num);
|
||||
|
||||
|
||||
|
@ -460,12 +473,12 @@ tile_manager_map (TileManager *tm,
|
|||
|
||||
static int
|
||||
tile_manager_get_tile_num (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel)
|
||||
gint xpixel,
|
||||
gint ypixel)
|
||||
{
|
||||
int tile_row;
|
||||
int tile_col;
|
||||
int tile_num;
|
||||
gint tile_row;
|
||||
gint tile_col;
|
||||
gint tile_num;
|
||||
|
||||
if ((xpixel < 0) || (xpixel >= tm->width) ||
|
||||
(ypixel < 0) || (ypixel >= tm->height))
|
||||
|
@ -480,37 +493,40 @@ tile_manager_get_tile_num (TileManager *tm,
|
|||
|
||||
void
|
||||
tile_manager_set_user_data (TileManager *tm,
|
||||
void *user_data)
|
||||
gpointer user_data)
|
||||
{
|
||||
tm->user_data = user_data;
|
||||
}
|
||||
|
||||
void *
|
||||
tile_manager_get_user_data (TileManager *tm)
|
||||
gpointer
|
||||
tile_manager_get_user_data (const TileManager *tm)
|
||||
{
|
||||
return tm->user_data;
|
||||
}
|
||||
|
||||
int
|
||||
tile_manager_level_width (TileManager *tm)
|
||||
tile_manager_level_width (const TileManager *tm)
|
||||
{
|
||||
return tm->width;
|
||||
}
|
||||
|
||||
int
|
||||
tile_manager_level_height (TileManager *tm)
|
||||
tile_manager_level_height (const TileManager *tm)
|
||||
{
|
||||
return tm->height;
|
||||
}
|
||||
|
||||
int
|
||||
tile_manager_level_bpp (TileManager *tm)
|
||||
tile_manager_level_bpp (const TileManager *tm)
|
||||
{
|
||||
return tm->bpp;
|
||||
}
|
||||
|
||||
void
|
||||
tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, int *x, int *y)
|
||||
tile_manager_get_tile_coordinates (TileManager *tm,
|
||||
Tile *tile,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
TileLink *tl;
|
||||
|
||||
|
@ -531,7 +547,9 @@ tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile, int *x, int *y)
|
|||
|
||||
|
||||
void
|
||||
tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile)
|
||||
tile_manager_map_over_tile (TileManager *tm,
|
||||
Tile *tile,
|
||||
Tile *srctile)
|
||||
{
|
||||
TileLink *tl;
|
||||
|
||||
|
@ -548,7 +566,3 @@ tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile)
|
|||
|
||||
tile_manager_map (tm, tl->tile_num, srctile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -15,19 +15,11 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __TILE_MANAGER_H__
|
||||
#define __TILE_MANAGER_H__
|
||||
|
||||
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
typedef struct _TileManager TileManager;
|
||||
|
||||
typedef void (*TileValidateProc) (TileManager *tm,
|
||||
Tile *tile);
|
||||
|
||||
|
||||
/* Creates a new tile manager with the specified
|
||||
* width for the toplevel. The toplevel sizes is
|
||||
* used to compute the number of levels and there
|
||||
|
@ -37,13 +29,13 @@ typedef void (*TileValidateProc) (TileManager *tm,
|
|||
* hierarchy is "nlevels - 1". That level will be smaller
|
||||
* than TILE_WIDTH x TILE_HEIGHT
|
||||
*/
|
||||
TileManager* tile_manager_new (int toplevel_width,
|
||||
int toplevel_height,
|
||||
int bpp);
|
||||
TileManager * tile_manager_new (gint toplevel_width,
|
||||
gint toplevel_height,
|
||||
gint bpp);
|
||||
|
||||
/* Destroy a tile manager and all the tiles it contains.
|
||||
*/
|
||||
void tile_manager_destroy (TileManager *tm);
|
||||
void tile_manager_destroy (TileManager *tm);
|
||||
|
||||
/* Set the validate procedure for the tile manager.
|
||||
* The validate procedure is called when an invalid tile
|
||||
|
@ -51,70 +43,76 @@ void tile_manager_destroy (TileManager *tm);
|
|||
* is set to valid and its memory is allocated, but
|
||||
* not initialized.
|
||||
*/
|
||||
void tile_manager_set_validate_proc (TileManager *tm,
|
||||
TileValidateProc proc);
|
||||
void tile_manager_set_validate_proc (TileManager *tm,
|
||||
TileValidateProc proc);
|
||||
|
||||
/* Get a specified tile from a tile manager.
|
||||
*/
|
||||
Tile* tile_manager_get_tile (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel,
|
||||
int wantread,
|
||||
int wantwrite);
|
||||
Tile * tile_manager_get_tile (TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel,
|
||||
gint wantread,
|
||||
gint wantwrite);
|
||||
|
||||
/* Get a specified tile from a tile manager.
|
||||
*/
|
||||
Tile* tile_manager_get (TileManager *tm,
|
||||
int tile_num,
|
||||
int wantread,
|
||||
int wantwrite);
|
||||
Tile * tile_manager_get (TileManager *tm,
|
||||
gint tile_num,
|
||||
gint wantread,
|
||||
gint wantwrite);
|
||||
|
||||
/* Request that (if possible) the tile at x,y be swapped
|
||||
* in. This is only a hint to improve performance; no guarantees.
|
||||
* The tile may be swapped in or otherwise made more accessible
|
||||
* if it is convenient...
|
||||
*/
|
||||
void tile_manager_get_async (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel);
|
||||
void tile_manager_get_async (TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel);
|
||||
|
||||
void tile_manager_map_tile (TileManager *tm,
|
||||
int xpixel,
|
||||
int ypixel,
|
||||
Tile *srctile);
|
||||
void tile_manager_map_tile (TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel,
|
||||
Tile *srctile);
|
||||
|
||||
void tile_manager_map (TileManager *tm,
|
||||
int time_num,
|
||||
Tile *srctile);
|
||||
void tile_manager_map (TileManager *tm,
|
||||
gint time_num,
|
||||
Tile *srctile);
|
||||
|
||||
/* Validate a tiles memory.
|
||||
*/
|
||||
void tile_manager_validate (TileManager *tm,
|
||||
Tile *tile);
|
||||
void tile_manager_validate (TileManager *tm,
|
||||
Tile *tile);
|
||||
|
||||
void tile_invalidate (Tile **tile_ptr, TileManager *tm, int tile_num);
|
||||
void tile_invalidate_tile (Tile **tile_ptr, TileManager *tm,
|
||||
int xpixel, int ypixel);
|
||||
void tile_invalidate (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint tile_num);
|
||||
void tile_invalidate_tile (Tile **tile_ptr,
|
||||
TileManager *tm,
|
||||
gint xpixel,
|
||||
gint ypixel);
|
||||
|
||||
/* Given a toplevel tile, this procedure will invalidate
|
||||
* (set the dirty bit) for this toplevel tile.
|
||||
*/
|
||||
void tile_manager_invalidate_tiles (TileManager *tm,
|
||||
Tile *toplevel_tile);
|
||||
void tile_manager_invalidate_tiles (TileManager *tm,
|
||||
Tile *toplevel_tile);
|
||||
|
||||
void tile_manager_set_user_data (TileManager *tm,
|
||||
void *user_data);
|
||||
void tile_manager_set_user_data (TileManager *tm,
|
||||
gpointer user_data);
|
||||
gpointer tile_manager_get_user_data (const TileManager *tm);
|
||||
|
||||
void *tile_manager_get_user_data (TileManager *tm);
|
||||
gint tile_manager_level_width (const TileManager *tm);
|
||||
gint tile_manager_level_height (const TileManager *tm);
|
||||
gint tile_manager_level_bpp (const TileManager *tm);
|
||||
|
||||
int tile_manager_level_width (TileManager *tm);
|
||||
int tile_manager_level_height (TileManager *tm);
|
||||
int tile_manager_level_bpp (TileManager *tm);
|
||||
|
||||
void tile_manager_get_tile_coordinates (TileManager *tm, Tile *tile,
|
||||
int *x, int *y);
|
||||
|
||||
void tile_manager_map_over_tile (TileManager *tm, Tile *tile, Tile *srctile);
|
||||
void tile_manager_get_tile_coordinates (TileManager *tm,
|
||||
Tile *tile,
|
||||
gint *x,
|
||||
gint *y);
|
||||
|
||||
void tile_manager_map_over_tile (TileManager *tm,
|
||||
Tile *tile,
|
||||
Tile *srctile);
|
||||
|
||||
#endif /* __TILE_MANAGER_H__ */
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
#ifndef __TILE_PVT_H__
|
||||
#define __TILE_PVT_H__
|
||||
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <glib.h>
|
||||
|
||||
|
@ -27,26 +27,26 @@ struct _TileLink
|
|||
|
||||
struct _Tile
|
||||
{
|
||||
short ref_count; /* reference count. when the reference count is
|
||||
gshort ref_count; /* reference count. when the reference count is
|
||||
* non-zero then the "data" for this tile must
|
||||
* be valid. when the reference count for a tile
|
||||
* is 0 then the "data" for this tile must be
|
||||
* NULL.
|
||||
*/
|
||||
short write_count; /* write count: number of references that are
|
||||
gshort write_count; /* write count: number of references that are
|
||||
for write access */
|
||||
short share_count; /* share count: number of tile managers that
|
||||
gshort share_count; /* share count: number of tile managers that
|
||||
hold this tile */
|
||||
guint dirty : 1; /* is the tile dirty? has it been modified? */
|
||||
guint valid : 1; /* is the tile valid? */
|
||||
|
||||
unsigned char bpp; /* the bytes per pixel (1, 2, 3 or 4) */
|
||||
unsigned short ewidth; /* the effective width of the tile */
|
||||
unsigned short eheight; /* the effective height of the tile */
|
||||
/* a tile's effective width and height may be smaller
|
||||
* (but not larger) than TILE_WIDTH and TILE_HEIGHT.
|
||||
* this is to handle edge tiles of a drawable.
|
||||
*/
|
||||
guchar bpp; /* the bytes per pixel (1, 2, 3 or 4) */
|
||||
gushort ewidth; /* the effective width of the tile */
|
||||
gushort eheight; /* the effective height of the tile
|
||||
* a tile's effective width and height may be smaller
|
||||
* (but not larger) than TILE_WIDTH and TILE_HEIGHT.
|
||||
* this is to handle edge tiles of a drawable.
|
||||
*/
|
||||
|
||||
TileRowHint *rowhint; /* An array of hints for rendering purposes */
|
||||
|
||||
|
@ -54,24 +54,26 @@ struct _Tile
|
|||
* case the tile data is on disk.
|
||||
*/
|
||||
|
||||
int swap_num; /* the index into the file table of the file to be used
|
||||
* for swapping. swap_num 1 is always the global swap file.
|
||||
*/
|
||||
gint swap_num; /* the index into the file table of the file to be used
|
||||
* for swapping. swap_num 1 is always the global
|
||||
* swap file.
|
||||
*/
|
||||
off_t swap_offset; /* the offset within the swap file of the tile data.
|
||||
* if the tile data is in memory this will be set to -1.
|
||||
* if the tile data is in memory this will be set to -1.
|
||||
*/
|
||||
TileLink *tlink;
|
||||
|
||||
Tile *next;
|
||||
Tile *prev; /* List pointers for the tile cache lists */
|
||||
void *listhead; /* Pointer to the head of the list this tile is on */
|
||||
Tile *next;
|
||||
Tile *prev; /* List pointers for the tile cache lists */
|
||||
gpointer listhead; /* Pointer to the head of the list this tile is on */
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
pthread_mutex_t mutex;
|
||||
#endif
|
||||
};
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
#define TILE_MUTEX_LOCK(tile) pthread_mutex_lock(&((tile)->mutex))
|
||||
#define TILE_MUTEX_LOCK(tile) pthread_mutex_lock(&((tile)->mutex))
|
||||
#define TILE_MUTEX_UNLOCK(tile) pthread_mutex_unlock(&((tile)->mutex))
|
||||
#else
|
||||
#define TILE_MUTEX_LOCK(tile) /* nothing */
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
@ -26,12 +44,14 @@
|
|||
#define _O_TEMPORARY 0
|
||||
#endif
|
||||
|
||||
#define MAX_OPEN_SWAP_FILES 16
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "tile.h"
|
||||
#include "tile_swap.h"
|
||||
#include "tile_pvt.h" /* ick. */
|
||||
|
||||
#define MAX_OPEN_SWAP_FILES 16
|
||||
|
||||
typedef struct _SwapFile SwapFile;
|
||||
typedef struct _DefSwapFile DefSwapFile;
|
||||
typedef struct _Gap Gap;
|
||||
|
|
|
@ -1,11 +1,27 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __TILE_SWAP_H__
|
||||
#define __TILE_SWAP_H__
|
||||
|
||||
|
||||
#include "tile.h"
|
||||
|
||||
|
||||
typedef enum {
|
||||
typedef enum
|
||||
{
|
||||
SWAP_IN = 1,
|
||||
SWAP_IN_ASYNC,
|
||||
SWAP_OUT,
|
||||
|
@ -13,22 +29,22 @@ typedef enum {
|
|||
SWAP_COMPRESS
|
||||
} SwapCommand;
|
||||
|
||||
typedef int (*SwapFunc) (int fd,
|
||||
Tile *tile,
|
||||
int cmd,
|
||||
gpointer user_data);
|
||||
typedef gint (*SwapFunc) (gint fd,
|
||||
Tile *tile,
|
||||
gint cmd,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
void tile_swap_exit (void);
|
||||
int tile_swap_add (char *filename,
|
||||
SwapFunc swap_func,
|
||||
gpointer user_data);
|
||||
void tile_swap_remove (int swap_num);
|
||||
void tile_swap_in (Tile *tile);
|
||||
void tile_swap_in_async (Tile *tile);
|
||||
void tile_swap_out (Tile *tile);
|
||||
void tile_swap_delete (Tile *tile);
|
||||
void tile_swap_compress (int swap_num);
|
||||
void tile_swap_exit (void);
|
||||
gint tile_swap_add (gchar *filename,
|
||||
SwapFunc swap_func,
|
||||
gpointer user_data);
|
||||
void tile_swap_remove (gint swap_num);
|
||||
void tile_swap_in (Tile *tile);
|
||||
void tile_swap_in_async (Tile *tile);
|
||||
void tile_swap_out (Tile *tile);
|
||||
void tile_swap_delete (Tile *tile);
|
||||
void tile_swap_compress (gint swap_num);
|
||||
|
||||
|
||||
#endif /* __TILE_SWAP_H__ */
|
||||
|
|
|
@ -1,5 +1,29 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <apptypes.h>
|
||||
|
||||
#include "tile.h"
|
||||
#include "tile_pvt.h"
|
||||
#include "tile_cache.h"
|
||||
|
@ -14,7 +38,7 @@ int tile_count = 0;
|
|||
void
|
||||
tile_sanitize_rowhints (Tile *tile)
|
||||
{
|
||||
int height, y;
|
||||
gint height, y;
|
||||
|
||||
/* If tile has rowhints array already, do nothing. */
|
||||
if (tile->rowhint)
|
||||
|
@ -31,7 +55,8 @@ tile_sanitize_rowhints (Tile *tile)
|
|||
}
|
||||
|
||||
TileRowHint
|
||||
tile_get_rowhint (Tile *tile, int yoff)
|
||||
tile_get_rowhint (Tile *tile,
|
||||
gint yoff)
|
||||
{
|
||||
#ifdef HINTS_SANITY
|
||||
if (yoff < tile_eheight(tile) && yoff>=0)
|
||||
|
@ -47,7 +72,9 @@ tile_get_rowhint (Tile *tile, int yoff)
|
|||
}
|
||||
|
||||
void
|
||||
tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint)
|
||||
tile_set_rowhint (Tile *tile,
|
||||
gint yoff,
|
||||
TileRowHint rowhint)
|
||||
{
|
||||
#ifdef HINTS_SANITY
|
||||
if (yoff < tile_eheight(tile) && yoff>=0)
|
||||
|
@ -63,23 +90,24 @@ tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint)
|
|||
|
||||
void
|
||||
tile_init (Tile *tile,
|
||||
int bpp)
|
||||
gint bpp)
|
||||
{
|
||||
tile->ref_count = 0;
|
||||
tile->ref_count = 0;
|
||||
tile->write_count = 0;
|
||||
tile->share_count = 0;
|
||||
tile->dirty = FALSE;
|
||||
tile->valid = FALSE;
|
||||
tile->data = NULL;
|
||||
tile->ewidth = TILE_WIDTH;
|
||||
tile->eheight = TILE_HEIGHT;
|
||||
tile->bpp = bpp;
|
||||
tile->swap_num = 1;
|
||||
tile->dirty = FALSE;
|
||||
tile->valid = FALSE;
|
||||
tile->data = NULL;
|
||||
tile->ewidth = TILE_WIDTH;
|
||||
tile->eheight = TILE_HEIGHT;
|
||||
tile->bpp = bpp;
|
||||
tile->swap_num = 1;
|
||||
tile->swap_offset = -1;
|
||||
tile->tlink = NULL;
|
||||
tile->next = tile->prev = NULL;
|
||||
tile->listhead = NULL;
|
||||
tile->rowhint = NULL;
|
||||
tile->tlink = NULL;
|
||||
tile->next = NULL;
|
||||
tile->prev = NULL;
|
||||
tile->listhead = NULL;
|
||||
tile->rowhint = NULL;
|
||||
|
||||
#ifdef USE_PTHREADS
|
||||
{
|
||||
|
|
|
@ -1,3 +1,21 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __TILE_H__
|
||||
#define __TILE_H__
|
||||
|
||||
|
@ -12,18 +30,12 @@
|
|||
/* sanity checking on new tile hinting code */
|
||||
/* #define HINTS_SANITY */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <glib.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
typedef struct _Tile Tile;
|
||||
|
||||
/* explicit guchar type rather than enum since gcc chooses an int
|
||||
* representation but arrays of TileRowHints are quite space-critical
|
||||
* in GIMP.
|
||||
*/
|
||||
typedef guchar TileRowHint;
|
||||
|
||||
#define TILEROWHINT_BROKEN 0
|
||||
#define TILEROWHINT_OPAQUE 1
|
||||
#define TILEROWHINT_TRANSPARENT 2
|
||||
|
@ -35,8 +47,8 @@ typedef guchar TileRowHint;
|
|||
|
||||
/* Initializes the fields of a tile to "good" values.
|
||||
*/
|
||||
void tile_init (Tile *tile,
|
||||
int bpp);
|
||||
void tile_init (Tile *tile,
|
||||
gint bpp);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -48,31 +60,37 @@ void tile_init (Tile *tile,
|
|||
* write access. (This is a hack, and should be handled better.)
|
||||
*/
|
||||
|
||||
void tile_lock (Tile *);
|
||||
void tile_release (Tile *, int);
|
||||
void tile_lock (Tile *tile);
|
||||
void tile_release (Tile *tile,
|
||||
gint);
|
||||
|
||||
/* Allocate the data for the tile.
|
||||
*/
|
||||
void tile_alloc (Tile *tile);
|
||||
void tile_alloc (Tile *tile);
|
||||
|
||||
/* Return the size in bytes of the tiles data.
|
||||
*/
|
||||
int tile_size (Tile *tile);
|
||||
gint tile_size (Tile *tile);
|
||||
|
||||
int tile_ewidth (Tile *tile);
|
||||
int tile_eheight (Tile *tile);
|
||||
int tile_bpp (Tile *tile);
|
||||
gint tile_ewidth (Tile *tile);
|
||||
gint tile_eheight (Tile *tile);
|
||||
gint tile_bpp (Tile *tile);
|
||||
|
||||
int tile_is_valid (Tile *tile);
|
||||
gint tile_is_valid (Tile *tile);
|
||||
|
||||
void tile_mark_valid (Tile *tile);
|
||||
void tile_mark_valid (Tile *tile);
|
||||
|
||||
/* DOCUMENT ME -- adm */
|
||||
TileRowHint tile_get_rowhint (Tile *tile, int yoff);
|
||||
void tile_set_rowhint (Tile *tile, int yoff, TileRowHint rowhint);
|
||||
void tile_sanitize_rowhints (Tile *tile);
|
||||
TileRowHint tile_get_rowhint (Tile *tile,
|
||||
gint yoff);
|
||||
void tile_set_rowhint (Tile *tile,
|
||||
gint yoff,
|
||||
TileRowHint rowhint);
|
||||
void tile_sanitize_rowhints (Tile *tile);
|
||||
|
||||
void *tile_data_pointer (Tile *tile, int xoff, int yoff);
|
||||
void * tile_data_pointer (Tile *tile,
|
||||
gint xoff,
|
||||
gint yoff);
|
||||
|
||||
/* tile_attach attaches a tile to a tile manager: this function
|
||||
* increments the tile's share count and inserts a tilelink into the
|
||||
|
@ -81,8 +99,12 @@ void *tile_data_pointer (Tile *tile, int xoff, int yoff);
|
|||
* discarded.
|
||||
*/
|
||||
|
||||
void tile_attach (Tile *tile, void *tm, int tile_num);
|
||||
void tile_detach (Tile *tile, void *tm, int tile_num);
|
||||
void tile_attach (Tile *tile,
|
||||
void *tm,
|
||||
gint tile_num);
|
||||
void tile_detach (Tile *tile,
|
||||
void *tm,
|
||||
gint tile_num);
|
||||
|
||||
|
||||
#endif /* __TILE_H__ */
|
||||
|
|
|
@ -24,17 +24,25 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "channel.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
#include "edit_selection.h"
|
||||
#include "errors.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "rect_select.h"
|
||||
#include "bezier_select.h"
|
||||
#include "bezier_selectP.h"
|
||||
#include "paths_dialogP.h"
|
||||
#include "pixel_region.h"
|
||||
#include "procedural_db.h"
|
||||
#include "selection_options.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
@ -972,7 +980,7 @@ bezier_select_button_press (Tool *tool,
|
|||
|
||||
gdisp = (GDisplay *) gdisp_ptr;
|
||||
|
||||
tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
bezier_sel = tool->private;
|
||||
grab_pointer = FALSE;
|
||||
|
@ -1020,7 +1028,7 @@ bezier_select_button_press (Tool *tool,
|
|||
/* break; */
|
||||
/* } */
|
||||
/* else if (!(bevent->state & GDK_SHIFT_MASK) && !(bevent->state & GDK_CONTROL_MASK)) */
|
||||
/* if (! (layer_is_floating_sel (gimage_get_active_layer (gdisp->gimage))) && */
|
||||
/* if (! (layer_is_floating_sel (gimp_image_get_active_layer (gdisp->gimage))) && */
|
||||
/* gdisplay_mask_value (gdisp, bevent->x, bevent->y) > HALF_WAY) */
|
||||
/* { */
|
||||
/* init_edit_selection (tool, gdisp_ptr, bevent, EDIT_MASK_TO_LAYER_TRANSLATE); */
|
||||
|
@ -1249,16 +1257,16 @@ bezier_select_button_press (Tool *tool,
|
|||
|
||||
if ((bevent->state & GDK_SHIFT_MASK) &&
|
||||
!(bevent->state & GDK_CONTROL_MASK))
|
||||
op = ADD;
|
||||
op = CHANNEL_OP_ADD;
|
||||
else if ((bevent->state & GDK_CONTROL_MASK) &&
|
||||
!(bevent->state & GDK_SHIFT_MASK))
|
||||
op = SUB;
|
||||
op = CHANNEL_OP_SUB;
|
||||
else if ((bevent->state & GDK_CONTROL_MASK) &&
|
||||
(bevent->state & GDK_SHIFT_MASK))
|
||||
op = INTERSECT;
|
||||
op = CHANNEL_OP_INTERSECT;
|
||||
else
|
||||
{
|
||||
op = ADD;
|
||||
op = CHANNEL_OP_ADD;
|
||||
replace = TRUE;
|
||||
}
|
||||
|
||||
|
@ -2514,10 +2522,13 @@ bezier_convert (BezierSelect *bezier_sel,
|
|||
points = next_curve;
|
||||
} while (next_curve);
|
||||
|
||||
pixel_region_init (&maskPR, drawable_data (GIMP_DRAWABLE(bezier_sel->mask)),
|
||||
pixel_region_init (&maskPR,
|
||||
gimp_drawable_data (GIMP_DRAWABLE (bezier_sel->mask)),
|
||||
0, 0,
|
||||
drawable_width (GIMP_DRAWABLE(bezier_sel->mask)),
|
||||
drawable_height (GIMP_DRAWABLE(bezier_sel->mask)), TRUE);
|
||||
gimp_drawable_width (GIMP_DRAWABLE (bezier_sel->mask)),
|
||||
gimp_drawable_height (GIMP_DRAWABLE (bezier_sel->mask)),
|
||||
TRUE);
|
||||
|
||||
for (i = 0; i < height; i++)
|
||||
{
|
||||
list = bezier_sel->scanlines[i];
|
||||
|
@ -2567,7 +2578,7 @@ bezier_convert (BezierSelect *bezier_sel,
|
|||
}
|
||||
|
||||
pixel_region_set_row (&maskPR, 0, (i / SUPERSAMPLE),
|
||||
drawable_width (GIMP_DRAWABLE(bezier_sel->mask)), buf);
|
||||
gimp_drawable_width (GIMP_DRAWABLE (bezier_sel->mask)), buf);
|
||||
}
|
||||
|
||||
g_slist_free (bezier_sel->scanlines[i]);
|
||||
|
@ -2794,7 +2805,7 @@ bezier_paste_bezierselect_to_current(GDisplay *gdisp,BezierSelect *bsel)
|
|||
gimp_context_set_tool (gimp_context_get_user (), BEZIER_SELECT);
|
||||
active_tool->paused_count = 0;
|
||||
active_tool->gdisp_ptr = gdisp;
|
||||
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
active_tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
tool = active_tool;
|
||||
|
||||
|
@ -2894,12 +2905,12 @@ bezier_to_sel_internal(BezierSelect *bezier_sel,
|
|||
|
||||
if (bezier_options->feather)
|
||||
channel_feather (bezier_sel->mask,
|
||||
gimage_get_mask (gdisp->gimage),
|
||||
gimp_image_get_mask (gdisp->gimage),
|
||||
bezier_options->feather_radius,
|
||||
bezier_options->feather_radius,
|
||||
op, 0, 0);
|
||||
else
|
||||
channel_combine_mask (gimage_get_mask (gdisp->gimage),
|
||||
channel_combine_mask (gimp_image_get_mask (gdisp->gimage),
|
||||
bezier_sel->mask, op, 0, 0);
|
||||
|
||||
/* show selection on all views */
|
||||
|
@ -3167,7 +3178,7 @@ bezier_to_selection (BezierSelect *bezier_sel,
|
|||
* This loads it into curSel for this image
|
||||
*/
|
||||
bezier_paste_bezierselect_to_current (gdisp, bezier_sel);
|
||||
bezier_to_sel_internal (curSel, curTool, gdisp, ADD, TRUE);
|
||||
bezier_to_sel_internal (curSel, curTool, gdisp, CHANNEL_OP_ADD, TRUE);
|
||||
}
|
||||
|
||||
/* unused
|
||||
|
@ -3456,7 +3467,7 @@ bezier_stroke (BezierSelect *bezier_sel,
|
|||
gint offset_x, offset_y;
|
||||
gdouble *ptr;
|
||||
|
||||
drawable = gimage_active_drawable (gdisp->gimage);
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
gimp_drawable_offsets (drawable, &offset_x, &offset_y);
|
||||
|
||||
ptr = rpnts->stroke_points;
|
||||
|
|
|
@ -19,16 +19,11 @@
|
|||
#ifndef __BEZIER_SELECT_H__
|
||||
#define __BEZIER_SELECT_H__
|
||||
|
||||
#include "toolsF.h"
|
||||
|
||||
typedef struct _BezierPoint BezierPoint;
|
||||
typedef struct _BezierSelect BezierSelect;
|
||||
|
||||
/* bezier select functions */
|
||||
|
||||
Tool * tools_new_bezier_select (void);
|
||||
void tools_free_bezier_select (Tool *tool);
|
||||
|
||||
gboolean bezier_tool_selected (void);
|
||||
|
||||
|
||||
#endif /* __BEZIER_SELECT_H__ */
|
||||
|
|
24
app/blend.c
24
app/blend.c
|
@ -33,16 +33,22 @@
|
|||
#include "errors.h"
|
||||
#include "fuzzy_select.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimpui.h"
|
||||
#include "gradient.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "paint_options.h"
|
||||
#include "pixel_region.h"
|
||||
#include "selection.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "libgimp/gimpcolorspace.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
@ -434,7 +440,7 @@ blend_button_press (Tool *tool,
|
|||
gdisp = (GDisplay *) gdisp_ptr;
|
||||
blend_tool = (BlendTool *) tool->private;
|
||||
|
||||
switch (drawable_type (gimage_active_drawable (gdisp->gimage)))
|
||||
switch (drawable_type (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
|
||||
g_message (_("Blend: Invalid for indexed images."));
|
||||
|
@ -506,7 +512,7 @@ blend_button_release (Tool *tool,
|
|||
return_vals =
|
||||
procedural_db_run_proc ("gimp_blend",
|
||||
&nreturn_vals,
|
||||
PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gimage)),
|
||||
PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gimage)),
|
||||
PDB_INT32, (gint32) blend_options->blend_mode,
|
||||
PDB_INT32, (gint32) PAINT_OPTIONS_GET_PAINT_MODE (blend_options),
|
||||
PDB_INT32, (gint32) blend_options->gradient_type,
|
||||
|
@ -534,7 +540,7 @@ blend_button_release (Tool *tool,
|
|||
progress = progress_start (gdisp, _("Blending..."), FALSE, NULL, NULL);
|
||||
|
||||
blend (gimage,
|
||||
gimage_active_drawable (gimage),
|
||||
gimp_image_active_drawable (gimage),
|
||||
blend_options->blend_mode,
|
||||
gimp_context_get_paint_mode (NULL),
|
||||
blend_options->gradient_type,
|
||||
|
@ -642,7 +648,7 @@ blend_cursor_update (Tool *tool,
|
|||
|
||||
gdisp = (GDisplay *) gdisp_ptr;
|
||||
|
||||
switch (drawable_type (gimage_active_drawable (gdisp->gimage)))
|
||||
switch (drawable_type (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
case INDEXED_GIMAGE:
|
||||
case INDEXEDA_GIMAGE:
|
||||
|
@ -800,8 +806,8 @@ blend (GImage *gimage,
|
|||
progress_callback, progress_data);
|
||||
|
||||
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
|
||||
gimage_apply_image (gimage, drawable, &bufPR, TRUE,
|
||||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
|
||||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
@ -1186,14 +1192,14 @@ gradient_precalc_shapeburst (GImage *gimage,
|
|||
if (! gimage_mask_is_empty (gimage))
|
||||
{
|
||||
PixelRegion maskR;
|
||||
int x1, y1, x2, y2;
|
||||
int offx, offy;
|
||||
gint x1, y1, x2, y2;
|
||||
gint offx, offy;
|
||||
|
||||
drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||
drawable_offsets (drawable, &offx, &offy);
|
||||
|
||||
/* the selection mask */
|
||||
mask = gimage_get_mask (gimage);
|
||||
mask = gimp_image_get_mask (gimage);
|
||||
pixel_region_init (&maskR, drawable_data (GIMP_DRAWABLE(mask)),
|
||||
x1 + offx, y1 + offy, (x2 - x1), (y2 - y1), FALSE);
|
||||
|
||||
|
|
28
app/blend.h
28
app/blend.h
|
@ -15,11 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BLEND_H__
|
||||
#define __BLEND_H__
|
||||
|
||||
#include "gimpprogress.h"
|
||||
#include "tools.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -54,11 +53,26 @@ typedef enum
|
|||
REPEAT_LAST /*< skip >*/
|
||||
} RepeatMode;
|
||||
|
||||
void blend (GimpImage *, GimpDrawable *, BlendMode, int, GradientType,
|
||||
double, double, RepeatMode, int, int, double, double,
|
||||
double, double, double, progress_func_t, void *);
|
||||
void blend (GimpImage *,
|
||||
GimpDrawable *,
|
||||
BlendMode,
|
||||
gint,
|
||||
GradientType,
|
||||
gdouble,
|
||||
gdouble,
|
||||
RepeatMode,
|
||||
gint,
|
||||
gint,
|
||||
gdouble,
|
||||
gdouble,
|
||||
gdouble,
|
||||
gdouble,
|
||||
gdouble,
|
||||
progress_func_t,
|
||||
gpointer);
|
||||
|
||||
Tool * tools_new_blend (void);
|
||||
void tools_free_blend (Tool *tool);
|
||||
|
||||
Tool * tools_new_blend (void);
|
||||
void tools_free_blend (Tool *);
|
||||
|
||||
#endif /* __BLEND_H__ */
|
||||
|
|
60
app/blob.h
60
app/blob.h
|
@ -25,32 +25,58 @@
|
|||
#ifndef __BLOB_H__
|
||||
#define __BLOB_H__
|
||||
|
||||
|
||||
typedef struct _BlobPoint BlobPoint;
|
||||
typedef struct _BlobSpan BlobSpan;
|
||||
typedef struct _Blob Blob;
|
||||
typedef struct _BlobSpan BlobSpan;
|
||||
typedef struct _Blob Blob;
|
||||
|
||||
struct _BlobPoint {
|
||||
int x;
|
||||
int y;
|
||||
struct _BlobPoint
|
||||
{
|
||||
gint x;
|
||||
gint y;
|
||||
};
|
||||
|
||||
struct _BlobSpan {
|
||||
int left;
|
||||
int right;
|
||||
struct _BlobSpan
|
||||
{
|
||||
gint left;
|
||||
gint right;
|
||||
};
|
||||
|
||||
struct _Blob {
|
||||
int y;
|
||||
int height;
|
||||
struct _Blob
|
||||
{
|
||||
gint y;
|
||||
gint height;
|
||||
BlobSpan data[1];
|
||||
};
|
||||
|
||||
|
||||
Blob *blob_convex_union (Blob *b1, Blob *b2);
|
||||
Blob *blob_polygon (BlobPoint *points, int npoints);
|
||||
Blob *blob_square (double xc, double yc, double xp, double yp, double xq, double yq);
|
||||
Blob *blob_diamond (double xc, double yc, double xp, double yp, double xq, double yq);
|
||||
Blob *blob_ellipse (double xc, double yc, double xp, double yp, double xq, double yq);
|
||||
void blob_bounds(Blob *b, int *x, int *y, int *width, int *height);
|
||||
Blob * blob_convex_union (Blob *b1,
|
||||
Blob *b2);
|
||||
Blob * blob_polygon (BlobPoint *points,
|
||||
gint npoints);
|
||||
Blob * blob_square (gdouble xc,
|
||||
gdouble yc,
|
||||
gdouble xp,
|
||||
gdouble yp,
|
||||
gdouble xq,
|
||||
gdouble yq);
|
||||
Blob * blob_diamond (gdouble xc,
|
||||
gdouble yc,
|
||||
gdouble xp,
|
||||
gdouble yp,
|
||||
gdouble xq,
|
||||
gdouble yq);
|
||||
Blob * blob_ellipse (gdouble xc,
|
||||
gdouble yc,
|
||||
gdouble xp,
|
||||
gdouble yp,
|
||||
gdouble xq,
|
||||
gdouble yq);
|
||||
void blob_bounds (Blob *b,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height);
|
||||
|
||||
|
||||
#endif /* __BLOB_H__ */
|
||||
|
|
|
@ -27,7 +27,10 @@
|
|||
#include "appenv.h"
|
||||
#include "errors.h"
|
||||
#include "boundary.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
|
||||
/* half intensity for mask */
|
||||
#define HALF_WAY 127
|
||||
|
|
|
@ -25,11 +25,15 @@
|
|||
#include "appenv.h"
|
||||
#include "brightness_contrast.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimplut.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "image_map.h"
|
||||
#include "lut_funcs.h"
|
||||
#include "tool_options.h"
|
||||
#include "tools.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
@ -170,7 +174,7 @@ tools_free_brightness_contrast (Tool *tool)
|
|||
void
|
||||
brightness_contrast_initialize (GDisplay *gdisp)
|
||||
{
|
||||
if (drawable_indexed (gimage_active_drawable (gdisp->gimage)))
|
||||
if (drawable_indexed (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
g_message (_("Brightness-Contrast does not operate on indexed drawables."));
|
||||
return;
|
||||
|
@ -186,7 +190,8 @@ brightness_contrast_initialize (GDisplay *gdisp)
|
|||
brightness_contrast_dialog->brightness = 0.0;
|
||||
brightness_contrast_dialog->contrast = 0.0;
|
||||
|
||||
brightness_contrast_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
brightness_contrast_dialog->drawable =
|
||||
gimp_image_active_drawable (gdisp->gimage);
|
||||
brightness_contrast_dialog->image_map =
|
||||
image_map_create (gdisp, brightness_contrast_dialog->drawable);
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BRIGHTNESS_CONTRAST_H__
|
||||
#define __BRIGHTNESS_CONTRAST_H__
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
Tool * tools_new_brightness_contrast (void);
|
||||
void tools_free_brightness_contrast (Tool *tool);
|
||||
|
@ -27,4 +27,5 @@ void brightness_contrast_dialog_hide (void);
|
|||
|
||||
void brightness_contrast_initialize (GDisplay *gdisp);
|
||||
|
||||
|
||||
#endif /* __BRIGHTNESS_CONTRAST_H__ */
|
||||
|
|
|
@ -30,7 +30,9 @@
|
|||
#include "gimpbrushgenerated.h"
|
||||
#include "brush_edit.h"
|
||||
#include "gimpui.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
#ifndef __BRUSH_EDIT_H__
|
||||
#define __BRUSH_EDIT_H__
|
||||
|
||||
#include "gimpbrushgenerated.h"
|
||||
|
||||
typedef struct _BrushEditGeneratedWindow BrushEditGeneratedWindow;
|
||||
|
||||
|
@ -46,7 +45,7 @@ struct _BrushEditGeneratedWindow
|
|||
|
||||
BrushEditGeneratedWindow * brush_edit_generated_new (void);
|
||||
|
||||
void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw,
|
||||
GimpBrush *brush);
|
||||
void brush_edit_generated_set_brush (BrushEditGeneratedWindow *begw,
|
||||
GimpBrush *brush);
|
||||
|
||||
#endif /* __BRUSH_EDIT_H__ */
|
||||
|
|
|
@ -16,25 +16,31 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "brush_scale.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
|
||||
MaskBuf *
|
||||
brush_scale_mask (MaskBuf *brush_mask,
|
||||
int dest_width,
|
||||
int dest_height)
|
||||
gint dest_width,
|
||||
gint dest_height)
|
||||
{
|
||||
MaskBuf *scale_brush;
|
||||
int src_width;
|
||||
int src_height;
|
||||
int value;
|
||||
int area;
|
||||
int i, j;
|
||||
int x, x0, y, y0;
|
||||
int dx, dx0, dy, dy0;
|
||||
int fx, fx0, fy, fy0;
|
||||
unsigned char *src, *dest;
|
||||
gint src_width;
|
||||
gint src_height;
|
||||
gint value;
|
||||
gint area;
|
||||
gint i, j;
|
||||
gint x, x0, y, y0;
|
||||
gint dx, dx0, dy, dy0;
|
||||
gint fx, fx0, fy, fy0;
|
||||
guchar *src, *dest;
|
||||
|
||||
g_return_val_if_fail (brush_mask != NULL &&
|
||||
dest_width != 0 && dest_height != 0, NULL);
|
||||
|
@ -174,20 +180,20 @@ brush_scale_mask (MaskBuf *brush_mask,
|
|||
|
||||
MaskBuf *
|
||||
brush_scale_pixmap (MaskBuf *pixmap,
|
||||
int dest_width,
|
||||
int dest_height)
|
||||
gint dest_width,
|
||||
gint dest_height)
|
||||
{
|
||||
MaskBuf *scale_brush;
|
||||
int src_width;
|
||||
int src_height;
|
||||
int value[3];
|
||||
int factor;
|
||||
int area;
|
||||
int i, j;
|
||||
int x, x0, y, y0;
|
||||
int dx, dx0, dy, dy0;
|
||||
int fx, fx0, fy, fy0;
|
||||
unsigned char *src, *src_ptr, *dest;
|
||||
gint src_width;
|
||||
gint src_height;
|
||||
gint value[3];
|
||||
gint factor;
|
||||
gint area;
|
||||
gint i, j;
|
||||
gint x, x0, y, y0;
|
||||
gint dx, dx0, dy, dy0;
|
||||
gint fx, fx0, fy, fy0;
|
||||
guchar *src, *src_ptr, *dest;
|
||||
|
||||
g_return_val_if_fail (pixmap != NULL && pixmap->bytes == 3 &&
|
||||
dest_width != 0 && dest_height != 0, NULL);
|
||||
|
|
|
@ -15,15 +15,18 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BRUSH_SCALE_H__
|
||||
#define __BRUSH_SCALE_H__
|
||||
|
||||
#include "temp_buf.h"
|
||||
|
||||
/* functions */
|
||||
MaskBuf * brush_scale_mask (MaskBuf *brush_mask,
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
MaskBuf * brush_scale_pixmap (MaskBuf *pixmap,
|
||||
gint dest_width,
|
||||
gint dest_height);
|
||||
|
||||
MaskBuf * brush_scale_mask (MaskBuf *, int, int);
|
||||
MaskBuf * brush_scale_pixmap (MaskBuf *, int, int);
|
||||
|
||||
#endif /* __BRUSH_SCALE_H__ */
|
||||
|
||||
|
|
|
@ -38,11 +38,15 @@
|
|||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "paint_options.h"
|
||||
#include "procedural_db.h"
|
||||
#include "session.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
|
||||
#include "config.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define MIN_CELL_SIZE 25
|
||||
#define MAX_CELL_SIZE 25 /* disable variable brush preview size */
|
||||
|
||||
|
|
|
@ -20,29 +20,25 @@
|
|||
#define __BRUSH_SELECT_H__
|
||||
|
||||
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpcontext.h"
|
||||
|
||||
|
||||
typedef struct _BrushSelect BrushSelect;
|
||||
|
||||
struct _BrushSelect
|
||||
{
|
||||
GtkWidget *shell;
|
||||
GtkWidget *shell;
|
||||
|
||||
/* Place holders which enable global<->per-tool paint options switching */
|
||||
GtkWidget *left_box;
|
||||
GtkWidget *right_box;
|
||||
GtkWidget *brush_selection_box;
|
||||
GtkWidget *paint_options_box;
|
||||
GtkWidget *left_box;
|
||||
GtkWidget *right_box;
|
||||
GtkWidget *brush_selection_box;
|
||||
GtkWidget *paint_options_box;
|
||||
|
||||
/* The preview and it's vscale data */
|
||||
GtkWidget *preview;
|
||||
GtkAdjustment *sbar_data;
|
||||
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *brush_name;
|
||||
GtkWidget *brush_size;
|
||||
GtkWidget *options_box;
|
||||
GtkWidget *brush_name;
|
||||
GtkWidget *brush_size;
|
||||
|
||||
GtkAdjustment *opacity_data;
|
||||
GtkAdjustment *spacing_data;
|
||||
|
@ -51,32 +47,32 @@ struct _BrushSelect
|
|||
GtkWidget *option_menu;
|
||||
|
||||
/* Brush popup */
|
||||
GtkWidget *brush_popup;
|
||||
GtkWidget *brush_preview;
|
||||
guint popup_timeout_tag;
|
||||
guint popup_anim_timeout_tag;
|
||||
guint popup_pipe_index;
|
||||
GtkWidget *brush_popup;
|
||||
GtkWidget *brush_preview;
|
||||
guint popup_timeout_tag;
|
||||
guint popup_anim_timeout_tag;
|
||||
guint popup_pipe_index;
|
||||
|
||||
/* Callback function name */
|
||||
gchar *callback_name;
|
||||
gchar *callback_name;
|
||||
|
||||
/* Context to store the current brush & paint options */
|
||||
GimpContext *context;
|
||||
gint spacing_value;
|
||||
GimpContext *context;
|
||||
gint spacing_value;
|
||||
|
||||
GimpBrush *dnd_brush;
|
||||
GimpBrush *dnd_brush;
|
||||
|
||||
/* Some variables to keep the GUI consistent */
|
||||
gint cell_width;
|
||||
gint cell_height;
|
||||
gint scroll_offset;
|
||||
gint old_row;
|
||||
gint old_col;
|
||||
gint NUM_BRUSH_COLUMNS;
|
||||
gint NUM_BRUSH_ROWS;
|
||||
gint cell_width;
|
||||
gint cell_height;
|
||||
gint scroll_offset;
|
||||
gint old_row;
|
||||
gint old_col;
|
||||
gint NUM_BRUSH_COLUMNS;
|
||||
gint NUM_BRUSH_ROWS;
|
||||
|
||||
gboolean redraw;
|
||||
gboolean freeze; /* so we don't waste so much time during refresh */
|
||||
gboolean redraw;
|
||||
gboolean freeze; /* so we don't waste so much time during refresh */
|
||||
};
|
||||
|
||||
/* list of active dialogs */
|
||||
|
|
|
@ -18,13 +18,18 @@
|
|||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "procedural_db.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "brush_select.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "gimpcontext.h"
|
||||
|
||||
static ProcRecord brushes_popup_proc;
|
||||
static ProcRecord brushes_close_popup_proc;
|
||||
|
|
|
@ -18,15 +18,20 @@
|
|||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "procedural_db.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpbrushlist.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimplist.h"
|
||||
#include "temp_buf.h"
|
||||
|
||||
static ProcRecord brushes_refresh_proc;
|
||||
static ProcRecord brushes_get_brush_proc;
|
||||
|
|
|
@ -25,24 +25,34 @@
|
|||
|
||||
#include "appenv.h"
|
||||
#include "bucket_fill.h"
|
||||
#include "channel.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "fuzzy_select.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "paint_options.h"
|
||||
#include "patterns.h"
|
||||
#include "pixel_region.h"
|
||||
#include "procedural_db.h"
|
||||
#include "selection.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* the bucket fill structures */
|
||||
|
||||
typedef struct _BucketTool BucketTool;
|
||||
|
||||
struct _BucketTool
|
||||
{
|
||||
gint target_x; /* starting x coord */
|
||||
|
@ -50,6 +60,7 @@ struct _BucketTool
|
|||
};
|
||||
|
||||
typedef struct _BucketOptions BucketOptions;
|
||||
|
||||
struct _BucketOptions
|
||||
{
|
||||
PaintOptions paint_options;
|
||||
|
@ -232,7 +243,7 @@ bucket_fill_button_release (Tool *tool,
|
|||
return_vals =
|
||||
procedural_db_run_proc ("gimp_bucket_fill",
|
||||
&nreturn_vals,
|
||||
PDB_DRAWABLE, drawable_ID (gimage_active_drawable (gdisp->gimage)),
|
||||
PDB_DRAWABLE, drawable_ID (gimp_image_active_drawable (gdisp->gimage)),
|
||||
PDB_INT32, (gint32) bucket_options->fill_mode,
|
||||
PDB_INT32, (gint32) gimp_context_get_paint_mode (NULL),
|
||||
PDB_FLOAT, (gdouble) gimp_context_get_opacity (NULL) * 100,
|
||||
|
@ -269,7 +280,7 @@ bucket_fill_cursor_update (Tool *tool,
|
|||
|
||||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y,
|
||||
&x, &y, FALSE, FALSE);
|
||||
if ((layer = gimage_get_active_layer (gdisp->gimage)))
|
||||
if ((layer = gimp_image_get_active_layer (gdisp->gimage)))
|
||||
{
|
||||
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
|
||||
|
@ -360,9 +371,9 @@ bucket_fill (GimpImage *gimage,
|
|||
pat_buf = NULL;
|
||||
|
||||
if (fill_mode == FG_BUCKET_FILL)
|
||||
gimage_get_foreground (gimage, drawable, col);
|
||||
gimp_image_get_foreground (gimage, drawable, col);
|
||||
else if (fill_mode == BG_BUCKET_FILL)
|
||||
gimage_get_background (gimage, drawable, col);
|
||||
gimp_image_get_background (gimage, drawable, col);
|
||||
else if (fill_mode == PATTERN_BUCKET_FILL)
|
||||
{
|
||||
pattern = gimp_context_get_pattern (NULL);
|
||||
|
@ -392,8 +403,8 @@ bucket_fill (GimpImage *gimage,
|
|||
size = pattern->mask->width * pattern->mask->height;
|
||||
while (size--)
|
||||
{
|
||||
gimage_transform_color (gimage, drawable, d1, d2,
|
||||
(pattern->mask->bytes == 3) ? RGB : GRAY);
|
||||
gimp_image_transform_color (gimage, drawable, d1, d2,
|
||||
(pattern->mask->bytes == 3) ? RGB : GRAY);
|
||||
d1 += pattern->mask->bytes;
|
||||
d2 += pat_buf->bytes;
|
||||
}
|
||||
|
@ -464,8 +475,8 @@ bucket_fill (GimpImage *gimage,
|
|||
bucket_fill_region (fill_mode, &bufPR, NULL, col, pat_buf, x1, y1, has_alpha);
|
||||
|
||||
pixel_region_init (&bufPR, buf_tiles, 0, 0, (x2 - x1), (y2 - y1), FALSE);
|
||||
gimage_apply_image (gimage, drawable, &bufPR, TRUE,
|
||||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
gimp_image_apply_image (gimage, drawable, &bufPR, TRUE,
|
||||
(opacity * 255) / 100, paint_mode, NULL, x1, y1);
|
||||
|
||||
/* update the image */
|
||||
drawable_update (drawable, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
#ifndef __BUCKET_FILL_H__
|
||||
#define __BUCKET_FILL_H__
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -29,27 +27,28 @@ typedef enum
|
|||
PATTERN_BUCKET_FILL
|
||||
} BucketFillMode;
|
||||
|
||||
void bucket_fill (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BucketFillMode fill_mode,
|
||||
gint paint_mode,
|
||||
gdouble opacity,
|
||||
gdouble threshold,
|
||||
gboolean sample_merged,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
|
||||
void bucket_fill_region (BucketFillMode fill_mode,
|
||||
PixelRegion *bufPR,
|
||||
PixelRegion *maskPR,
|
||||
guchar *col,
|
||||
TempBuf *pattern,
|
||||
gint off_x,
|
||||
gint off_y,
|
||||
gboolean has_alpha);
|
||||
void bucket_fill (GimpImage *gimage,
|
||||
GimpDrawable *drawable,
|
||||
BucketFillMode fill_mode,
|
||||
gint paint_mode,
|
||||
gdouble opacity,
|
||||
gdouble threshold,
|
||||
gboolean sample_merged,
|
||||
gdouble x,
|
||||
gdouble y);
|
||||
|
||||
Tool * tools_new_bucket_fill (void);
|
||||
void tools_free_bucket_fill (Tool *tool);
|
||||
void bucket_fill_region (BucketFillMode fill_mode,
|
||||
PixelRegion *bufPR,
|
||||
PixelRegion *maskPR,
|
||||
guchar *col,
|
||||
TempBuf *pattern,
|
||||
gint off_x,
|
||||
gint off_y,
|
||||
gboolean has_alpha);
|
||||
|
||||
Tool * tools_new_bucket_fill (void);
|
||||
void tools_free_bucket_fill (Tool *tool);
|
||||
|
||||
|
||||
#endif /* __BUCKET_FILL_H__ */
|
||||
|
|
|
@ -26,21 +26,29 @@
|
|||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "by_color_select.h"
|
||||
#include "channel.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "draw_core.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "pixel_region.h"
|
||||
#include "selection_options.h"
|
||||
|
||||
#include "tile.h" /* ick. */
|
||||
#include "temp_buf.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define PREVIEW_WIDTH 256
|
||||
#define PREVIEW_HEIGHT 256
|
||||
#define PREVIEW_EVENT_MASK GDK_EXPOSURE_MASK | \
|
||||
|
@ -204,15 +212,15 @@ by_color_select_color (GImage *gimage,
|
|||
/* Get the image information */
|
||||
if (sample_merged)
|
||||
{
|
||||
bytes = gimage_composite_bytes (gimage);
|
||||
d_type = gimage_composite_type (gimage);
|
||||
bytes = gimp_image_composite_bytes (gimage);
|
||||
d_type = gimp_image_composite_type (gimage);
|
||||
has_alpha = (d_type == RGBA_GIMAGE ||
|
||||
d_type == GRAYA_GIMAGE ||
|
||||
d_type == INDEXEDA_GIMAGE);
|
||||
indexed = d_type == INDEXEDA_GIMAGE || d_type == INDEXED_GIMAGE;
|
||||
width = gimage->width;
|
||||
height = gimage->height;
|
||||
pixel_region_init (&imagePR, gimage_composite (gimage),
|
||||
pixel_region_init (&imagePR, gimp_image_composite (gimage),
|
||||
0, 0, width, height, FALSE);
|
||||
}
|
||||
else
|
||||
|
@ -259,7 +267,7 @@ by_color_select_color (GImage *gimage,
|
|||
for (j = 0; j < imagePR.w; j++)
|
||||
{
|
||||
/* Get the rgb values for the color */
|
||||
gimage_get_color (gimage, d_type, rgb, idata);
|
||||
gimp_image_get_color (gimage, d_type, rgb, idata);
|
||||
|
||||
/* Plug the alpha channel in there */
|
||||
if (has_alpha)
|
||||
|
@ -318,12 +326,12 @@ by_color_select (GImage *gimage,
|
|||
drawable_offsets (drawable, &off_x, &off_y);
|
||||
|
||||
if (feather)
|
||||
channel_feather (new_mask, gimage_get_mask (gimage),
|
||||
channel_feather (new_mask, gimp_image_get_mask (gimage),
|
||||
feather_radius,
|
||||
feather_radius,
|
||||
op, off_x, off_y);
|
||||
else
|
||||
channel_combine_mask (gimage_get_mask (gimage),
|
||||
channel_combine_mask (gimp_image_get_mask (gimage),
|
||||
new_mask, op, off_x, off_y);
|
||||
|
||||
channel_delete (new_mask);
|
||||
|
@ -342,7 +350,7 @@ by_color_select_button_press (Tool *tool,
|
|||
gdisp = (GDisplay *) gdisp_ptr;
|
||||
by_color_sel = (ByColorSelect *) tool->private;
|
||||
|
||||
tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
if (!by_color_dialog)
|
||||
return;
|
||||
|
@ -396,7 +404,7 @@ by_color_select_button_release (Tool *tool,
|
|||
|
||||
gdisp = (GDisplay *) gdisp_ptr;
|
||||
by_color_sel = (ByColorSelect *) tool->private;
|
||||
drawable = gimage_active_drawable (gdisp->gimage);
|
||||
drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
|
||||
gdk_pointer_ungrab (bevent->time);
|
||||
|
||||
|
@ -462,7 +470,7 @@ by_color_select_cursor_update (Tool *tool,
|
|||
&x, &y, FALSE, FALSE);
|
||||
|
||||
if (by_color_options->sample_merged ||
|
||||
((layer = gimage_pick_correlate_layer (gdisp->gimage, x, y)) &&
|
||||
((layer = gimp_image_pick_correlate_layer (gdisp->gimage, x, y)) &&
|
||||
layer == gdisp->gimage->active_layer))
|
||||
{
|
||||
switch (by_col_sel->operation)
|
||||
|
@ -878,7 +886,7 @@ by_color_select_render (ByColorDialog *bcd,
|
|||
gint i;
|
||||
gint scale;
|
||||
|
||||
mask = gimage_get_mask (gimage);
|
||||
mask = gimp_image_get_mask (gimage);
|
||||
if ((drawable_width (GIMP_DRAWABLE(mask)) > PREVIEW_WIDTH) ||
|
||||
(drawable_height (GIMP_DRAWABLE(mask)) > PREVIEW_HEIGHT))
|
||||
{
|
||||
|
@ -986,7 +994,7 @@ by_color_select_draw (ByColorDialog *bcd,
|
|||
|
||||
/* Update the gimage label to reflect the displayed gimage name */
|
||||
gtk_label_set_text (GTK_LABEL (bcd->gimage_name),
|
||||
g_basename (gimage_filename (gimage)));
|
||||
g_basename (gimp_image_filename (gimage)));
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -1032,7 +1040,7 @@ by_color_select_invert_callback (GtkWidget *widget,
|
|||
return;
|
||||
|
||||
/* check if the image associated to the mask still exists */
|
||||
if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage))))
|
||||
if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
|
||||
return;
|
||||
|
||||
/* invert the mask */
|
||||
|
@ -1058,7 +1066,7 @@ by_color_select_select_all_callback (GtkWidget *widget,
|
|||
return;
|
||||
|
||||
/* check if the image associated to the mask still exists */
|
||||
if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage))))
|
||||
if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
|
||||
return;
|
||||
|
||||
/* fill the mask */
|
||||
|
@ -1084,7 +1092,7 @@ by_color_select_select_none_callback (GtkWidget *widget,
|
|||
return;
|
||||
|
||||
/* check if the image associated to the mask still exists */
|
||||
if (!drawable_gimage (GIMP_DRAWABLE (gimage_get_mask (bcd->gimage))))
|
||||
if (!drawable_gimage (GIMP_DRAWABLE (gimp_image_get_mask (bcd->gimage))))
|
||||
return;
|
||||
|
||||
/* reset the mask */
|
||||
|
@ -1129,7 +1137,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd,
|
|||
if (!bcd->gimage)
|
||||
return;
|
||||
|
||||
drawable = gimage_active_drawable (bcd->gimage);
|
||||
drawable = gimp_image_active_drawable (bcd->gimage);
|
||||
|
||||
/* check if the gimage associated to the drawable still exists */
|
||||
if (!drawable_gimage (drawable))
|
||||
|
@ -1161,7 +1169,7 @@ by_color_select_preview_button_press (ByColorDialog *bcd,
|
|||
y = bcd->gimage->height * bevent->y / bcd->preview->requisition.height;
|
||||
if (x < 0 || y < 0 || x >= bcd->gimage->width || y >= bcd->gimage->height)
|
||||
return;
|
||||
tile = tile_manager_get_tile (gimage_composite (bcd->gimage),
|
||||
tile = tile_manager_get_tile (gimp_image_composite (bcd->gimage),
|
||||
x, y, TRUE, FALSE);
|
||||
col = tile_data_pointer (tile, x % TILE_WIDTH, y % TILE_HEIGHT);
|
||||
}
|
||||
|
@ -1205,12 +1213,12 @@ by_color_select_color_drop (GtkWidget *widget,
|
|||
gpointer data)
|
||||
|
||||
{
|
||||
GimpDrawable *drawable;
|
||||
GimpDrawable *drawable;
|
||||
ByColorDialog *bcd;
|
||||
guchar col[3];
|
||||
guchar col[3];
|
||||
|
||||
bcd = (ByColorDialog*) data;
|
||||
drawable = gimage_active_drawable (bcd->gimage);
|
||||
drawable = gimp_image_active_drawable (bcd->gimage);
|
||||
|
||||
col[0] = r;
|
||||
col[1] = g;
|
||||
|
|
|
@ -15,12 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __BY_COLOR_SELECT_H__
|
||||
#define __BY_COLOR_SELECT_H__
|
||||
|
||||
#include "tools.h"
|
||||
#include "gdisplayF.h"
|
||||
#include "gimage.h"
|
||||
|
||||
Tool * tools_new_by_color_select (void);
|
||||
void tools_free_by_color_select (Tool *tool);
|
||||
|
@ -38,4 +36,5 @@ void by_color_select (GimpImage *gimage,
|
|||
gdouble feather_radius,
|
||||
gboolean sample_merged);
|
||||
|
||||
|
||||
#endif /* __BY_COLOR_SELECT_H__ */
|
||||
|
|
|
@ -26,23 +26,25 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "channel.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpsignal.h"
|
||||
#include "gimppreviewcache.h"
|
||||
#include "gimplut.h"
|
||||
#include "layer.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "parasitelist.h"
|
||||
#include "temp_buf.h"
|
||||
#include "undo.h"
|
||||
#include "gimpsignal.h"
|
||||
#include "gimppreviewcache.h"
|
||||
|
||||
#include "channel_pvt.h"
|
||||
#include "tile.h"
|
||||
|
||||
#include "gimplut.h"
|
||||
#include "pixel_processor.h"
|
||||
#include "pixel_region.h"
|
||||
#include "lut_funcs.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile.h"
|
||||
#include "tile_manager.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
|
@ -1004,14 +1006,14 @@ channel_combine_rect (Channel *mask,
|
|||
|
||||
pixel_region_init (&maskPR, GIMP_DRAWABLE (mask)->tiles,
|
||||
x, y, x2 - x, y2 - y, TRUE);
|
||||
if (op == ADD || op == REPLACE)
|
||||
if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE)
|
||||
color = 255;
|
||||
else
|
||||
color = 0;
|
||||
color_region (&maskPR, &color);
|
||||
|
||||
/* Determine new boundary */
|
||||
if (mask->bounds_known && (op == ADD) && !mask->empty)
|
||||
if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty)
|
||||
{
|
||||
if (x < mask->x1)
|
||||
mask->x1 = x;
|
||||
|
@ -1022,7 +1024,7 @@ channel_combine_rect (Channel *mask,
|
|||
if ((y + h) > mask->y2)
|
||||
mask->y2 = (y + h);
|
||||
}
|
||||
else if (op == REPLACE || mask->empty)
|
||||
else if (op == CHANNEL_OP_REPLACE || mask->empty)
|
||||
{
|
||||
mask->empty = FALSE;
|
||||
mask->x1 = x;
|
||||
|
@ -1084,10 +1086,11 @@ channel_combine_ellipse (Channel *mask,
|
|||
|
||||
switch (op)
|
||||
{
|
||||
case ADD: case REPLACE:
|
||||
case CHANNEL_OP_ADD:
|
||||
case CHANNEL_OP_REPLACE:
|
||||
channel_add_segment (mask, x1, i, (x2 - x1), 255);
|
||||
break;
|
||||
case SUB :
|
||||
case CHANNEL_OP_SUB:
|
||||
channel_sub_segment (mask, x1, i, (x2 - x1), 255);
|
||||
break;
|
||||
default:
|
||||
|
@ -1127,10 +1130,11 @@ channel_combine_ellipse (Channel *mask,
|
|||
{
|
||||
switch (op)
|
||||
{
|
||||
case ADD: case REPLACE:
|
||||
case CHANNEL_OP_ADD:
|
||||
case CHANNEL_OP_REPLACE:
|
||||
channel_add_segment (mask, x0, i, j - x0, last);
|
||||
break;
|
||||
case SUB:
|
||||
case CHANNEL_OP_SUB:
|
||||
channel_sub_segment (mask, x0, i, j - x0, last);
|
||||
break;
|
||||
default:
|
||||
|
@ -1152,9 +1156,9 @@ channel_combine_ellipse (Channel *mask,
|
|||
|
||||
if (last)
|
||||
{
|
||||
if (op == ADD || op == REPLACE)
|
||||
if (op == CHANNEL_OP_ADD || op == CHANNEL_OP_REPLACE)
|
||||
channel_add_segment (mask, x0, i, j - x0, last);
|
||||
else if (op == SUB)
|
||||
else if (op == CHANNEL_OP_SUB)
|
||||
channel_sub_segment (mask, x0, i, j - x0, last);
|
||||
else
|
||||
g_warning ("Only ADD, REPLACE and SUB are valid for channel_combine!");
|
||||
|
@ -1165,7 +1169,7 @@ channel_combine_ellipse (Channel *mask,
|
|||
}
|
||||
|
||||
/* Determine new boundary */
|
||||
if (mask->bounds_known && (op == ADD) && !mask->empty)
|
||||
if (mask->bounds_known && (op == CHANNEL_OP_ADD) && !mask->empty)
|
||||
{
|
||||
if (x < mask->x1)
|
||||
mask->x1 = x;
|
||||
|
@ -1176,7 +1180,7 @@ channel_combine_ellipse (Channel *mask,
|
|||
if ((y + h) > mask->y2)
|
||||
mask->y2 = (y + h);
|
||||
}
|
||||
else if (op == REPLACE || mask->empty)
|
||||
else if (op == CHANNEL_OP_REPLACE || mask->empty)
|
||||
{
|
||||
mask->empty = FALSE;
|
||||
mask->x1 = x;
|
||||
|
@ -1293,15 +1297,16 @@ channel_combine_mask (Channel *mask,
|
|||
|
||||
switch (op)
|
||||
{
|
||||
case ADD: case REPLACE:
|
||||
case CHANNEL_OP_ADD:
|
||||
case CHANNEL_OP_REPLACE:
|
||||
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_add,
|
||||
NULL, 2, &srcPR, &destPR);
|
||||
break;
|
||||
case SUB:
|
||||
case CHANNEL_OP_SUB:
|
||||
pixel_regions_process_parallel ((p_func) channel_combine_sub_region_sub,
|
||||
NULL, 2, &srcPR, &destPR);
|
||||
break;
|
||||
case INTERSECT:
|
||||
case CHANNEL_OP_INTERSECT:
|
||||
pixel_regions_process_parallel ((p_func)
|
||||
channel_combine_sub_region_intersect,
|
||||
NULL, 2, &srcPR, &destPR);
|
||||
|
|
|
@ -19,35 +19,49 @@
|
|||
#ifndef __CHANNEL_H__
|
||||
#define __CHANNEL_H__
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "drawable.h"
|
||||
#include "boundary.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "gimpdrawable.h"
|
||||
|
||||
|
||||
/* OPERATIONS */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ADD,
|
||||
SUB,
|
||||
REPLACE,
|
||||
INTERSECT
|
||||
} ChannelOps;
|
||||
|
||||
/* Half way point where a region is no longer visible in a selection */
|
||||
#define HALF_WAY 127
|
||||
|
||||
/* structure declarations */
|
||||
|
||||
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
|
||||
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
|
||||
#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass))
|
||||
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_TYPE_CHANNEL (gimp_channel_get_type ())
|
||||
#define GIMP_CHANNEL(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_CHANNEL, GimpChannel))
|
||||
#define GIMP_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_CHANNEL, GimpChannelClass))
|
||||
#define GIMP_IS_CHANNEL(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_CHANNEL))
|
||||
#define GIMP_IS_CHANNEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_CHANNEL))
|
||||
|
||||
struct _GimpChannel
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
guchar col[3]; /* RGB triplet for channel color */
|
||||
gint opacity; /* Channel opacity */
|
||||
gboolean show_masked; /* Show masked areas--as */
|
||||
/* opposed to selected areas */
|
||||
|
||||
/* Selection mask variables */
|
||||
gboolean boundary_known; /* is the current boundary valid */
|
||||
BoundSeg *segs_in; /* outline of selected region */
|
||||
BoundSeg *segs_out; /* outline of selected region */
|
||||
gint num_segs_in; /* number of lines in boundary */
|
||||
gint num_segs_out; /* number of lines in boundary */
|
||||
gboolean empty; /* is the region empty? */
|
||||
gboolean bounds_known; /* recalculate the bounds? */
|
||||
gint x1, y1; /* coordinates for bounding box */
|
||||
gint x2, y2; /* lower right hand coordinate */
|
||||
};
|
||||
|
||||
struct _GimpChannelClass
|
||||
{
|
||||
GimpDrawableClass parent_class;
|
||||
};
|
||||
|
||||
GtkType gimp_channel_get_type (void);
|
||||
|
||||
|
||||
/* Special undo type */
|
||||
|
@ -72,6 +86,8 @@ struct _MaskUndo
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GtkType gimp_channel_get_type (void);
|
||||
|
||||
Channel * channel_new (GimpImage *gimage,
|
||||
gint width,
|
||||
gint height,
|
||||
|
|
|
@ -18,10 +18,15 @@
|
|||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "channel.h"
|
||||
#include "channel_pvt.h"
|
||||
#include "drawable.h"
|
||||
#include "gimpimage.h"
|
||||
|
||||
|
|
|
@ -32,12 +32,16 @@
|
|||
#include "floating_sel.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "layer.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "parasitelist.h"
|
||||
#include "path.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "channel_pvt.h"
|
||||
#include "layer_pvt.h"
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -69,23 +73,23 @@ void
|
|||
channel_ops_offset (GimpImage* gimage)
|
||||
{
|
||||
OffsetDialog *off_d;
|
||||
GtkWidget *label;
|
||||
GtkWidget *check;
|
||||
GtkWidget *push;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *table;
|
||||
GtkObject *adjustment;
|
||||
GtkWidget *spinbutton;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *radio_button;
|
||||
GtkWidget *label;
|
||||
GtkWidget *check;
|
||||
GtkWidget *push;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *table;
|
||||
GtkObject *adjustment;
|
||||
GtkWidget *spinbutton;
|
||||
GtkWidget *frame;
|
||||
GtkWidget *radio_button;
|
||||
|
||||
GimpDrawable *drawable;
|
||||
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
off_d = g_new (OffsetDialog, 1);
|
||||
off_d->wrap_around = TRUE;
|
||||
off_d->fill_type = drawable_has_alpha (drawable);
|
||||
off_d->fill_type = gimp_drawable_has_alpha (drawable);
|
||||
off_d->gimage = gimage;
|
||||
|
||||
off_d->dlg = gimp_dialog_new (_("Offset"), "offset",
|
||||
|
@ -186,7 +190,7 @@ channel_ops_offset (GimpImage* gimage)
|
|||
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
|
||||
gtk_widget_show (frame);
|
||||
|
||||
if (!drawable_has_alpha (drawable))
|
||||
if (! gimp_drawable_has_alpha (drawable))
|
||||
gtk_widget_set_sensitive (radio_button, FALSE);
|
||||
|
||||
/* The by half height and half width option */
|
||||
|
@ -229,8 +233,8 @@ offset (GimpImage *gimage,
|
|||
if (!drawable)
|
||||
return;
|
||||
|
||||
width = drawable_width (drawable);
|
||||
height = drawable_height (drawable);
|
||||
width = gimp_drawable_width (drawable);
|
||||
height = gimp_drawable_height (drawable);
|
||||
|
||||
if (wrap_around)
|
||||
{
|
||||
|
@ -252,7 +256,7 @@ offset (GimpImage *gimage,
|
|||
if (offset_x == 0 && offset_y == 0)
|
||||
return;
|
||||
|
||||
new_tiles = tile_manager_new (width, height, drawable_bytes (drawable));
|
||||
new_tiles = tile_manager_new (width, height, gimp_drawable_bytes (drawable));
|
||||
if (offset_x >= 0)
|
||||
{
|
||||
src_x = 0;
|
||||
|
@ -282,8 +286,10 @@ offset (GimpImage *gimage,
|
|||
/* Copy the center region */
|
||||
if (width && height)
|
||||
{
|
||||
pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y, width, height, FALSE);
|
||||
pixel_region_init (&destPR, new_tiles, dest_x, dest_y, width, height, TRUE);
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
||||
src_x, src_y, width, height, FALSE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x, dest_y, width, height, TRUE);
|
||||
|
||||
copy_region (&srcPR, &destPR);
|
||||
}
|
||||
|
@ -293,18 +299,18 @@ offset (GimpImage *gimage,
|
|||
{
|
||||
if (offset_x >= 0 && offset_y >= 0)
|
||||
{
|
||||
src_x = drawable_width (drawable) - offset_x;
|
||||
src_y = drawable_height (drawable) - offset_y;
|
||||
src_x = gimp_drawable_width (drawable) - offset_x;
|
||||
src_y = gimp_drawable_height (drawable) - offset_y;
|
||||
}
|
||||
else if (offset_x >= 0 && offset_y < 0)
|
||||
{
|
||||
src_x = drawable_width (drawable) - offset_x;
|
||||
src_x = gimp_drawable_width (drawable) - offset_x;
|
||||
src_y = 0;
|
||||
}
|
||||
else if (offset_x < 0 && offset_y >= 0)
|
||||
{
|
||||
src_x = 0;
|
||||
src_y = drawable_height (drawable) - offset_y;
|
||||
src_y = gimp_drawable_height (drawable) - offset_y;
|
||||
}
|
||||
else if (offset_x < 0 && offset_y < 0)
|
||||
{
|
||||
|
@ -312,19 +318,22 @@ offset (GimpImage *gimage,
|
|||
src_y = 0;
|
||||
}
|
||||
|
||||
dest_x = (src_x + offset_x) % drawable_width (drawable);
|
||||
dest_x = (src_x + offset_x) % gimp_drawable_width (drawable);
|
||||
if (dest_x < 0)
|
||||
dest_x = drawable_width (drawable) + dest_x;
|
||||
dest_y = (src_y + offset_y) % drawable_height (drawable);
|
||||
dest_x = gimp_drawable_width (drawable) + dest_x;
|
||||
dest_y = (src_y + offset_y) % gimp_drawable_height (drawable);
|
||||
if (dest_y < 0)
|
||||
dest_y = drawable_height (drawable) + dest_y;
|
||||
dest_y = gimp_drawable_height (drawable) + dest_y;
|
||||
|
||||
/* intersecting region */
|
||||
if (offset_x != 0 && offset_y != 0)
|
||||
{
|
||||
pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y,
|
||||
ABS (offset_x), ABS (offset_y), FALSE);
|
||||
pixel_region_init (&destPR, new_tiles, dest_x, dest_y, ABS (offset_x), ABS (offset_y), TRUE);
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
||||
src_x, src_y, ABS (offset_x), ABS (offset_y)
|
||||
, FALSE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x, dest_y, ABS (offset_x), ABS (offset_y),
|
||||
TRUE);
|
||||
copy_region (&srcPR, &destPR);
|
||||
}
|
||||
|
||||
|
@ -333,17 +342,28 @@ offset (GimpImage *gimage,
|
|||
{
|
||||
if (offset_y >= 0)
|
||||
{
|
||||
pixel_region_init (&srcPR, drawable_data (drawable), src_x, 0,
|
||||
ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE);
|
||||
pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y,
|
||||
ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE);
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
||||
src_x, 0, ABS (offset_x),
|
||||
gimp_drawable_height (drawable) - ABS (offset_y),
|
||||
FALSE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x, dest_y + offset_y,
|
||||
ABS (offset_x),
|
||||
gimp_drawable_height (drawable) - ABS (offset_y),
|
||||
TRUE);
|
||||
}
|
||||
else if (offset_y < 0)
|
||||
{
|
||||
pixel_region_init (&srcPR, drawable_data (drawable), src_x, src_y - offset_y,
|
||||
ABS (offset_x), drawable_height (drawable) - ABS (offset_y), FALSE);
|
||||
pixel_region_init (&destPR, new_tiles, dest_x, 0,
|
||||
ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE);
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
||||
src_x, src_y - offset_y,
|
||||
ABS (offset_x),
|
||||
gimp_drawable_height (drawable) - ABS (offset_y),
|
||||
FALSE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x, 0,
|
||||
ABS (offset_x),
|
||||
gimp_drawable_height (drawable) - ABS (offset_y),
|
||||
TRUE);
|
||||
}
|
||||
|
||||
copy_region (&srcPR, &destPR);
|
||||
|
@ -354,21 +374,22 @@ offset (GimpImage *gimage,
|
|||
{
|
||||
if (offset_x >= 0)
|
||||
{
|
||||
pixel_region_init (&srcPR, drawable_data (drawable), 0, src_y,
|
||||
drawable_width (drawable) - ABS (offset_x),
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
||||
0, src_y,
|
||||
gimp_drawable_width (drawable) - ABS (offset_x),
|
||||
ABS (offset_y), FALSE);
|
||||
pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y,
|
||||
drawable_width (drawable) - ABS (offset_x),
|
||||
gimp_drawable_width (drawable) - ABS (offset_x),
|
||||
ABS (offset_y), TRUE);
|
||||
}
|
||||
else if (offset_x < 0)
|
||||
{
|
||||
pixel_region_init (&srcPR, drawable_data (drawable),
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
||||
src_x - offset_x, src_y,
|
||||
drawable_width (drawable) - ABS (offset_x),
|
||||
gimp_drawable_width (drawable) - ABS (offset_x),
|
||||
ABS (offset_y), FALSE);
|
||||
pixel_region_init (&destPR, new_tiles, 0, dest_y,
|
||||
drawable_width (drawable) - ABS (offset_x),
|
||||
gimp_drawable_width (drawable) - ABS (offset_x),
|
||||
ABS (offset_y), TRUE);
|
||||
}
|
||||
|
||||
|
@ -381,8 +402,8 @@ offset (GimpImage *gimage,
|
|||
if (fill_type == OFFSET_BACKGROUND)
|
||||
{
|
||||
gimp_context_get_background (NULL, &fill[0], &fill[1], &fill[2]);
|
||||
if (drawable_has_alpha (drawable))
|
||||
fill[drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
|
||||
if (gimp_drawable_has_alpha (drawable))
|
||||
fill[gimp_drawable_bytes (drawable) - 1] = OPAQUE_OPACITY;
|
||||
}
|
||||
|
||||
if (offset_x >= 0 && offset_y >= 0)
|
||||
|
@ -393,17 +414,17 @@ offset (GimpImage *gimage,
|
|||
else if (offset_x >= 0 && offset_y < 0)
|
||||
{
|
||||
dest_x = 0;
|
||||
dest_y = drawable_height (drawable) + offset_y;
|
||||
dest_y = gimp_drawable_height (drawable) + offset_y;
|
||||
}
|
||||
else if (offset_x < 0 && offset_y >= 0)
|
||||
{
|
||||
dest_x = drawable_width (drawable) + offset_x;
|
||||
dest_x = gimp_drawable_width (drawable) + offset_x;
|
||||
dest_y = 0;
|
||||
}
|
||||
else if (offset_x < 0 && offset_y < 0)
|
||||
{
|
||||
dest_x = drawable_width (drawable) + offset_x;
|
||||
dest_y = drawable_height (drawable) + offset_y;
|
||||
dest_x = gimp_drawable_width (drawable) + offset_x;
|
||||
dest_y = gimp_drawable_height (drawable) + offset_y;
|
||||
}
|
||||
|
||||
/* intersecting region */
|
||||
|
@ -418,11 +439,17 @@ offset (GimpImage *gimage,
|
|||
if (offset_x != 0)
|
||||
{
|
||||
if (offset_y >= 0)
|
||||
pixel_region_init (&destPR, new_tiles, dest_x, dest_y + offset_y,
|
||||
ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x, dest_y + offset_y,
|
||||
ABS (offset_x),
|
||||
gimp_drawable_height (drawable) - ABS (offset_y),
|
||||
TRUE);
|
||||
else if (offset_y < 0)
|
||||
pixel_region_init (&destPR, new_tiles, dest_x, 0,
|
||||
ABS (offset_x), drawable_height (drawable) - ABS (offset_y), TRUE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x, 0,
|
||||
ABS (offset_x),
|
||||
gimp_drawable_height (drawable) - ABS (offset_y),
|
||||
TRUE);
|
||||
|
||||
color_region (&destPR, fill);
|
||||
}
|
||||
|
@ -431,11 +458,18 @@ offset (GimpImage *gimage,
|
|||
if (offset_y != 0)
|
||||
{
|
||||
if (offset_x >= 0)
|
||||
pixel_region_init (&destPR, new_tiles, dest_x + offset_x, dest_y,
|
||||
drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
dest_x + offset_x,
|
||||
dest_y,
|
||||
gimp_drawable_width (drawable) - ABS (offset_x),
|
||||
ABS (offset_y),
|
||||
TRUE);
|
||||
else if (offset_x < 0)
|
||||
pixel_region_init (&destPR, new_tiles, 0, dest_y,
|
||||
drawable_width (drawable) - ABS (offset_x), ABS (offset_y), TRUE);
|
||||
pixel_region_init (&destPR, new_tiles,
|
||||
0, dest_y,
|
||||
gimp_drawable_width (drawable) - ABS (offset_x),
|
||||
ABS (offset_y),
|
||||
TRUE);
|
||||
|
||||
color_region (&destPR, fill);
|
||||
}
|
||||
|
@ -443,8 +477,9 @@ offset (GimpImage *gimage,
|
|||
|
||||
/* push an undo */
|
||||
drawable_apply_image (drawable, 0, 0,
|
||||
drawable_width (drawable), drawable_height (drawable),
|
||||
drawable_data (drawable), FALSE);
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable),
|
||||
gimp_drawable_data (drawable), FALSE);
|
||||
|
||||
/* swap the tiles */
|
||||
drawable->tiles = new_tiles;
|
||||
|
@ -452,7 +487,8 @@ offset (GimpImage *gimage,
|
|||
|
||||
/* update the drawable */
|
||||
drawable_update (drawable, 0, 0,
|
||||
drawable_width (drawable), drawable_height (drawable));
|
||||
gimp_drawable_width (drawable),
|
||||
gimp_drawable_height (drawable));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -473,7 +509,7 @@ offset_ok_callback (GtkWidget *widget,
|
|||
|
||||
if ((gimage = off_d->gimage) != NULL)
|
||||
{
|
||||
drawable = gimage_active_drawable (gimage);
|
||||
drawable = gimp_image_active_drawable (gimage);
|
||||
|
||||
offset_x = (gint)
|
||||
RINT (gimp_size_entry_get_refval (GIMP_SIZE_ENTRY (off_d->off_se), 0));
|
||||
|
@ -505,7 +541,7 @@ offset_halfheight_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
OffsetDialog *off_d;
|
||||
GImage *gimage;
|
||||
GImage *gimage;
|
||||
|
||||
off_d = (OffsetDialog *) data;
|
||||
gimage = off_d->gimage;
|
||||
|
@ -519,27 +555,27 @@ offset_halfheight_callback (GtkWidget *widget,
|
|||
GimpImage *
|
||||
duplicate (GimpImage *gimage)
|
||||
{
|
||||
PixelRegion srcPR, destPR;
|
||||
GimpImage *new_gimage;
|
||||
Layer *layer, *new_layer;
|
||||
Layer *floating_layer;
|
||||
Channel *channel, *new_channel;
|
||||
GSList *list;
|
||||
GList *glist;
|
||||
Guide *guide = NULL;
|
||||
Layer *active_layer = NULL;
|
||||
Channel *active_channel = NULL;
|
||||
PixelRegion srcPR, destPR;
|
||||
GimpImage *new_gimage;
|
||||
Layer *layer, *new_layer;
|
||||
Layer *floating_layer;
|
||||
Channel *channel, *new_channel;
|
||||
GSList *list;
|
||||
GList *glist;
|
||||
Guide *guide = NULL;
|
||||
Layer *active_layer = NULL;
|
||||
Channel *active_channel = NULL;
|
||||
GimpDrawable *new_floating_sel_drawable = NULL;
|
||||
GimpDrawable *floating_sel_drawable = NULL;
|
||||
ParasiteList *parasites;
|
||||
PathList *paths;
|
||||
gint count;
|
||||
PathList *paths;
|
||||
gint count;
|
||||
|
||||
gimp_add_busy_cursors_until_idle ();
|
||||
|
||||
/* Create a new image */
|
||||
new_gimage = gimage_new (gimage->width, gimage->height, gimage->base_type);
|
||||
gimage_disable_undo (new_gimage);
|
||||
gimp_image_undo_disable (new_gimage);
|
||||
|
||||
/* Copy resolution and unit information */
|
||||
new_gimage->xresolution = gimage->xresolution;
|
||||
|
@ -547,7 +583,7 @@ duplicate (GimpImage *gimage)
|
|||
new_gimage->unit = gimage->unit;
|
||||
|
||||
/* Copy floating layer */
|
||||
floating_layer = gimage_floating_sel (gimage);
|
||||
floating_layer = gimp_image_floating_sel (gimage);
|
||||
if (floating_layer)
|
||||
{
|
||||
floating_sel_relax (floating_layer, FALSE);
|
||||
|
@ -591,7 +627,7 @@ duplicate (GimpImage *gimage)
|
|||
|
||||
/* Add the layer */
|
||||
if (floating_layer != new_layer)
|
||||
gimage_add_layer (new_gimage, new_layer, count++);
|
||||
gimp_image_add_layer (new_gimage, new_layer, count++);
|
||||
}
|
||||
|
||||
/* Copy the channels */
|
||||
|
@ -617,13 +653,13 @@ duplicate (GimpImage *gimage)
|
|||
new_floating_sel_drawable = GIMP_DRAWABLE(new_channel);
|
||||
|
||||
/* Add the channel */
|
||||
gimage_add_channel (new_gimage, new_channel, count++);
|
||||
gimp_image_add_channel (new_gimage, new_channel, count++);
|
||||
}
|
||||
|
||||
/* Copy the selection mask */
|
||||
pixel_region_init (&srcPR, drawable_data (GIMP_DRAWABLE(gimage->selection_mask)),
|
||||
pixel_region_init (&srcPR, gimp_drawable_data (GIMP_DRAWABLE (gimage->selection_mask)),
|
||||
0, 0, gimage->width, gimage->height, FALSE);
|
||||
pixel_region_init (&destPR, drawable_data (GIMP_DRAWABLE(new_gimage->selection_mask)),
|
||||
pixel_region_init (&destPR, gimp_drawable_data (GIMP_DRAWABLE (new_gimage->selection_mask)),
|
||||
0, 0, gimage->width, gimage->height, TRUE);
|
||||
copy_region (&srcPR, &destPR);
|
||||
new_gimage->selection_mask->bounds_known = FALSE;
|
||||
|
@ -700,7 +736,7 @@ duplicate (GimpImage *gimage)
|
|||
gimp_image_set_paths (new_gimage, new_paths);
|
||||
}
|
||||
|
||||
gimage_enable_undo (new_gimage);
|
||||
gimp_image_undo_enable (new_gimage);
|
||||
|
||||
return new_gimage;
|
||||
}
|
||||
|
@ -708,8 +744,9 @@ duplicate (GimpImage *gimage)
|
|||
|
||||
#ifdef I_LIKE_BOGUS_CRAP
|
||||
static void
|
||||
duplicate_projection (GimpImage *oldgimage, GimpImage *newgimage,
|
||||
GDisplay *newgdisplay)
|
||||
duplicate_projection (GimpImage *oldgimage,
|
||||
GimpImage *newgimage,
|
||||
GDisplay *newgdisplay)
|
||||
{
|
||||
PixelRegion srcPR, destPR;
|
||||
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "channel_ops.h"
|
||||
|
|
|
@ -1,55 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef __CHANNEL_PVT_H__
|
||||
#define __CHANNEL_PVT_H__
|
||||
|
||||
#include "drawable.h"
|
||||
|
||||
#include "boundary.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
||||
#include "drawable_pvt.h"
|
||||
|
||||
struct _GimpChannel
|
||||
{
|
||||
GimpDrawable drawable;
|
||||
|
||||
guchar col[3]; /* RGB triplet for channel color */
|
||||
gint opacity; /* Channel opacity */
|
||||
gboolean show_masked; /* Show masked areas--as */
|
||||
/* opposed to selected areas */
|
||||
|
||||
/* Selection mask variables */
|
||||
gboolean boundary_known; /* is the current boundary valid */
|
||||
BoundSeg *segs_in; /* outline of selected region */
|
||||
BoundSeg *segs_out; /* outline of selected region */
|
||||
gint num_segs_in; /* number of lines in boundary */
|
||||
gint num_segs_out; /* number of lines in boundary */
|
||||
gboolean empty; /* is the region empty? */
|
||||
gboolean bounds_known; /* recalculate the bounds? */
|
||||
gint x1, y1; /* coordinates for bounding box */
|
||||
gint x2, y2; /* lower right hand coordinate */
|
||||
};
|
||||
|
||||
struct _GimpChannelClass
|
||||
{
|
||||
GimpDrawableClass parent_class;
|
||||
};
|
||||
|
||||
#endif /* __CHANNEL_PVT_H__ */
|
|
@ -24,6 +24,8 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
|
||||
#include "channel.h"
|
||||
#include "channels_dialog.h"
|
||||
#include "color_panel.h"
|
||||
#include "drawable.h"
|
||||
|
@ -41,10 +43,10 @@
|
|||
#include "paint_funcs.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "channel_pvt.h"
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "pixmaps/eye.xbm"
|
||||
#include "pixmaps/channel.xbm"
|
||||
|
@ -55,6 +57,7 @@
|
|||
#include "pixmaps/delete.xpm"
|
||||
#include "pixmaps/toselection.xpm"
|
||||
|
||||
|
||||
#define COMPONENT_BASE_ID 0x10000000
|
||||
|
||||
typedef struct _ChannelsDialog ChannelsDialog;
|
||||
|
@ -1099,7 +1102,7 @@ channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
|
|||
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
||||
channel_combine_mask (new_channel,
|
||||
active_channel,
|
||||
ADD,
|
||||
CHANNEL_OP_ADD,
|
||||
0, 0); /* off x/y */
|
||||
gimage_mask_load (gimage, new_channel);
|
||||
channel_delete (new_channel);
|
||||
|
@ -1123,7 +1126,7 @@ channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
|
|||
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
||||
channel_combine_mask (new_channel,
|
||||
active_channel,
|
||||
SUB,
|
||||
CHANNEL_OP_SUB,
|
||||
0, 0); /* off x/y */
|
||||
gimage_mask_load (gimage, new_channel);
|
||||
channel_delete (new_channel);
|
||||
|
@ -1147,7 +1150,7 @@ channels_dialog_intersect_channel_with_sel_callback (GtkWidget *widget,
|
|||
new_channel = channel_copy (gimp_image_get_mask (gimage));
|
||||
channel_combine_mask (new_channel,
|
||||
active_channel,
|
||||
INTERSECT,
|
||||
CHANNEL_OP_INTERSECT,
|
||||
0, 0); /* off x/y */
|
||||
gimage_mask_load (gimage, new_channel);
|
||||
channel_delete (new_channel);
|
||||
|
|
|
@ -15,18 +15,31 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __CHANNELS_DIALOG_H__
|
||||
#define __CHANNELS_DIALOG_H__
|
||||
|
||||
void channels_dialog_new_channel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_raise_channel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_lower_channel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_duplicate_channel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_delete_channel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_channel_to_sel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_add_channel_to_sel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_sub_channel_from_sel_callback (GtkWidget *, gpointer);
|
||||
void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *, gpointer);
|
||||
void channels_dialog_edit_channel_attributes_callback (GtkWidget *, gpointer);
|
||||
|
||||
void channels_dialog_new_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_raise_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_lower_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_duplicate_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_delete_channel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_channel_to_sel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_add_channel_to_sel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_sub_channel_from_sel_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *widget,
|
||||
gpointer data);
|
||||
void channels_dialog_edit_channel_attributes_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
#endif /* __CHANNELS_DIALOG_H__ */
|
||||
|
|
24
app/clone.c
24
app/clone.c
|
@ -26,20 +26,27 @@
|
|||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "paint_core.h"
|
||||
#include "paint_options.h"
|
||||
#include "patterns.h"
|
||||
#include "pixel_region.h"
|
||||
#include "clone.h"
|
||||
#include "selection.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tools.h"
|
||||
#include "cursorutil.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define TARGET_HEIGHT 15
|
||||
#define TARGET_WIDTH 15
|
||||
|
||||
|
@ -325,7 +332,7 @@ clone_cursor_update (Tool *tool,
|
|||
gdisplay_untransform_coords (gdisp, (double) mevent->x, (double) mevent->y,
|
||||
&x, &y, TRUE, FALSE);
|
||||
|
||||
if ((layer = gimage_get_active_layer (gdisp->gimage)))
|
||||
if ((layer = gimp_image_get_active_layer (gdisp->gimage)))
|
||||
{
|
||||
int off_x, off_y;
|
||||
drawable_offsets (GIMP_DRAWABLE (layer), &off_x, &off_y);
|
||||
|
@ -602,8 +609,8 @@ clone_line_image (GImage *dest,
|
|||
|
||||
while (width--)
|
||||
{
|
||||
gimage_get_color (src, drawable_type (s_drawable), rgb, s);
|
||||
gimage_transform_color (dest, d_drawable, rgb, d, RGB);
|
||||
gimp_image_get_color (src, drawable_type (s_drawable), rgb, s);
|
||||
gimp_image_transform_color (dest, d_drawable, rgb, d, RGB);
|
||||
|
||||
if (has_alpha)
|
||||
d[dest_alpha] = s[src_alpha];
|
||||
|
@ -625,9 +632,9 @@ clone_line_pattern (GImage *dest,
|
|||
int bytes,
|
||||
int width)
|
||||
{
|
||||
unsigned char *pat, *p;
|
||||
int color, alpha;
|
||||
int i;
|
||||
guchar *pat, *p;
|
||||
gint color, alpha;
|
||||
gint i;
|
||||
|
||||
/* Make sure x, y are positive */
|
||||
while (x < 0)
|
||||
|
@ -646,7 +653,7 @@ clone_line_pattern (GImage *dest,
|
|||
{
|
||||
p = pat + ((i + x) % pattern->mask->width) * pattern->mask->bytes;
|
||||
|
||||
gimage_transform_color (dest, drawable, p, d, color);
|
||||
gimp_image_transform_color (dest, drawable, p, d, color);
|
||||
|
||||
d[alpha] = OPAQUE_OPACITY;
|
||||
|
||||
|
@ -659,7 +666,8 @@ clone_non_gui_paint_func (PaintCore *paint_core,
|
|||
GimpDrawable *drawable,
|
||||
int state)
|
||||
{
|
||||
clone_motion (paint_core, drawable, non_gui_src_drawable, &non_gui_pressure_options,
|
||||
clone_motion (paint_core, drawable, non_gui_src_drawable,
|
||||
&non_gui_pressure_options,
|
||||
non_gui_type, non_gui_offset_x, non_gui_offset_y);
|
||||
|
||||
return NULL;
|
||||
|
|
25
app/clone.h
25
app/clone.h
|
@ -15,11 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __CLONE_H__
|
||||
#define __CLONE_H__
|
||||
|
||||
#include "paint_core.h"
|
||||
#include "tools.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -27,11 +26,21 @@ typedef enum
|
|||
PATTERN_CLONE
|
||||
} CloneType;
|
||||
|
||||
void * clone_paint_func (PaintCore *, GimpDrawable *, int);
|
||||
gboolean clone_non_gui (GimpDrawable *, GimpDrawable *, CloneType,
|
||||
double, double, int, double *);
|
||||
gboolean clone_non_gui_default (GimpDrawable *, int, double *);
|
||||
Tool * tools_new_clone (void);
|
||||
void tools_free_clone (Tool *);
|
||||
void * clone_paint_func (PaintCore *,
|
||||
GimpDrawable *,
|
||||
gint);
|
||||
gboolean clone_non_gui (GimpDrawable *,
|
||||
GimpDrawable *,
|
||||
CloneType,
|
||||
gdouble,
|
||||
gdouble,
|
||||
gint,
|
||||
gdouble *);
|
||||
gboolean clone_non_gui_default (GimpDrawable *,
|
||||
gint,
|
||||
gdouble *);
|
||||
Tool * tools_new_clone (void);
|
||||
void tools_free_clone (Tool *);
|
||||
|
||||
|
||||
#endif /* __CLONE_H__ */
|
||||
|
|
|
@ -15,13 +15,11 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLOR_AREA_H__
|
||||
#define __COLOR_AREA_H__
|
||||
|
||||
|
||||
#include "gdisplayF.h"
|
||||
|
||||
|
||||
#define FOREGROUND 0
|
||||
#define BACKGROUND 1
|
||||
|
||||
|
@ -55,4 +53,5 @@ void color_area_draw_rect (GdkDrawable *drawable,
|
|||
guchar g,
|
||||
guchar b);
|
||||
|
||||
|
||||
#endif /* __COLOR_AREA_H__ */
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -27,13 +27,18 @@
|
|||
#include "color_transfer.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "image_map.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tools.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
#include "libgimp/gimpcolorspace.h"
|
||||
|
||||
|
||||
#define CYAN_RED 0x1
|
||||
#define MAGENTA_GREEN 0x2
|
||||
#define YELLOW_BLUE 0x4
|
||||
|
@ -212,7 +217,7 @@ color_balance_initialize (GDisplay *gdisp)
|
|||
{
|
||||
gint i;
|
||||
|
||||
if (! drawable_color (gimage_active_drawable (gdisp->gimage)))
|
||||
if (! drawable_color (gimp_image_active_drawable (gdisp->gimage)))
|
||||
{
|
||||
g_message (_("Color balance operates only on RGB color drawables."));
|
||||
return;
|
||||
|
@ -232,7 +237,7 @@ color_balance_initialize (GDisplay *gdisp)
|
|||
color_balance_dialog->yellow_blue[i] = 0.0;
|
||||
}
|
||||
|
||||
color_balance_dialog->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
color_balance_dialog->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
color_balance_dialog->image_map =
|
||||
image_map_create (gdisp, color_balance_dialog->drawable);
|
||||
|
||||
|
|
|
@ -20,9 +20,6 @@
|
|||
#define __COLOR_BALANCE_H__
|
||||
|
||||
|
||||
#include "image_map.h"
|
||||
#include "tools.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SHADOWS,
|
||||
|
|
|
@ -18,6 +18,12 @@
|
|||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "color_balance.h"
|
||||
|
@ -27,12 +33,16 @@
|
|||
#include "equalize.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimphistogram.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplut.h"
|
||||
#include "histogram_tool.h"
|
||||
#include "histogramwidget.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "invert.h"
|
||||
#include "lut_funcs.h"
|
||||
#include "pixel_processor.h"
|
||||
#include "pixel_region.h"
|
||||
#include "threshold.h"
|
||||
|
||||
static ProcRecord brightness_contrast_proc;
|
||||
|
|
|
@ -21,16 +21,19 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <gmodule.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gmodule.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "color_notebook.h"
|
||||
#include "gimpui.h"
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLOR_PANEL_H__
|
||||
#define __COLOR_PANEL_H__
|
||||
|
||||
|
@ -39,4 +40,5 @@ ColorPanel * color_panel_new (guchar *initial,
|
|||
void color_panel_set_color (ColorPanel *color_panel,
|
||||
guchar *col);
|
||||
|
||||
|
||||
#endif /* __COLOR_PANEL_H__ */
|
||||
|
|
|
@ -28,15 +28,18 @@
|
|||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "gimprc.h"
|
||||
#include "cursorutil.h"
|
||||
#include "info_dialog.h"
|
||||
#include "palette.h"
|
||||
#include "tools.h"
|
||||
#include "gimprc.h"
|
||||
#include "tool_options.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* maximum information buffer size */
|
||||
#define MAX_INFO_BUF 8
|
||||
|
||||
|
@ -243,7 +246,7 @@ color_picker_button_press (Tool *tool,
|
|||
|
||||
/* Make the tool active and set it's gdisplay & drawable */
|
||||
tool->gdisp_ptr = gdisp;
|
||||
tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
tool->state = ACTIVE;
|
||||
|
||||
/* create the info dialog if it doesn't exist */
|
||||
|
@ -428,7 +431,7 @@ color_picker_cursor_update (Tool *tool,
|
|||
gdisplay_untransform_coords (gdisp, mevent->x, mevent->y, &x, &y,
|
||||
FALSE, FALSE);
|
||||
|
||||
if (gimage_pick_correlate_layer (gdisp->gimage, x, y))
|
||||
if (gimp_image_pick_correlate_layer (gdisp->gimage, x, y))
|
||||
gdisplay_install_tool_cursor (gdisp, GIMP_COLOR_PICKER_CURSOR,
|
||||
COLOR_PICKER,
|
||||
CURSOR_MODIFIER_NONE,
|
||||
|
|
|
@ -19,7 +19,8 @@
|
|||
#ifndef __COLOR_PICKER_H__
|
||||
#define __COLOR_PICKER_H__
|
||||
|
||||
#include "tools.h"
|
||||
|
||||
extern gint col_value[5];
|
||||
|
||||
|
||||
gboolean pick_color (GimpImage *gimage,
|
||||
|
@ -34,7 +35,5 @@ gboolean pick_color (GimpImage *gimage,
|
|||
Tool * tools_new_color_picker (void);
|
||||
void tools_free_color_picker (Tool *tool);
|
||||
|
||||
extern gint col_value[5];
|
||||
|
||||
|
||||
#endif /* __COLOR_PICKER_H__ */
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -33,9 +34,10 @@
|
|||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "session.h"
|
||||
#include "color_area.h" /* for color_area_draw_rect */
|
||||
#include "color_area.h"
|
||||
|
||||
#include "libgimp/gimpcolorselector.h"
|
||||
#include "libgimp/gimphelpui.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
|
|
@ -15,9 +15,12 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLOR_SELECT_H__
|
||||
#define __COLOR_SELECT_H__
|
||||
|
||||
void color_select_init (void);
|
||||
|
||||
void color_select_init (void);
|
||||
|
||||
|
||||
#endif /* __COLOR_SELECT_H__ */
|
||||
|
|
|
@ -11,9 +11,13 @@
|
|||
#include "dialog_handler.h"
|
||||
#include "colormaps.h"
|
||||
#include "color_area.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
@ -715,7 +719,7 @@ ipal_set_image (GimpColormapDialog *ipal,
|
|||
gtk_signal_handler_unblock (GTK_OBJECT (ipal->palette),
|
||||
ipal->event_handler);
|
||||
g_return_if_fail (gimp_set_have (ipal->context, gimage));
|
||||
g_return_if_fail (gimage_base_type (gimage) == INDEXED);
|
||||
g_return_if_fail (gimp_image_base_type (gimage) == INDEXED);
|
||||
ipal->image = gimage;
|
||||
ipal_draw (ipal);
|
||||
gtk_container_queue_resize (GTK_CONTAINER (ipal));
|
||||
|
@ -916,13 +920,13 @@ static void
|
|||
create_image_menu_cb (gpointer im,
|
||||
gpointer d)
|
||||
{
|
||||
GimpImage* gimage = GIMP_IMAGE (im);
|
||||
IMCBData* data = (IMCBData *) d;
|
||||
gchar* image_name;
|
||||
gchar* menu_item_label;
|
||||
GimpImage *gimage = GIMP_IMAGE (im);
|
||||
IMCBData *data = (IMCBData *) d;
|
||||
gchar *image_name;
|
||||
gchar *menu_item_label;
|
||||
GtkWidget *menu_item;
|
||||
|
||||
if (gimage_base_type (gimage) != INDEXED)
|
||||
if (gimp_image_base_type (gimage) != INDEXED)
|
||||
return;
|
||||
|
||||
/* make sure the default index gets set to _something_, if possible */
|
||||
|
@ -938,13 +942,13 @@ create_image_menu_cb (gpointer im,
|
|||
*data->default_index = data->num_items;
|
||||
}
|
||||
|
||||
image_name = g_basename (gimage_filename (gimage));
|
||||
image_name = g_basename (gimp_image_filename (gimage));
|
||||
menu_item_label = g_strdup_printf ("%s-%d", image_name,
|
||||
pdb_image_to_id (gimage));
|
||||
menu_item = gtk_menu_item_new_with_label (menu_item_label);
|
||||
gtk_object_set_data (GTK_OBJECT (menu_item), "colormap_dialog", data->ipal);
|
||||
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
||||
(GtkSignalFunc) data->callback,
|
||||
data->callback,
|
||||
gimage);
|
||||
gtk_container_add (GTK_CONTAINER (data->menu), menu_item);
|
||||
gtk_widget_show (menu_item);
|
||||
|
|
|
@ -15,12 +15,18 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "app_procs.h"
|
||||
#include "colormaps.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
||||
GdkVisual *g_visual = NULL;
|
||||
GdkColormap *g_cmap = NULL;
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __COLORMAPS_H__
|
||||
#define __COLORMAPS_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
extern GdkVisual *g_visual;
|
||||
extern GdkColormap *g_cmap;
|
||||
|
@ -36,9 +36,10 @@ extern gulong g_active_guide_pixel;
|
|||
/* Colormap entries reserved for color cycled marching ants--optional */
|
||||
extern gulong marching_ants_pixels[8];
|
||||
|
||||
gulong get_color (int red,
|
||||
int green,
|
||||
int blue);
|
||||
gulong get_color (gint red,
|
||||
gint green,
|
||||
gint blue);
|
||||
void get_standard_colormaps (void);
|
||||
|
||||
|
||||
#endif /* __COLORMAPS_H__ */
|
||||
|
|
|
@ -18,7 +18,10 @@
|
|||
|
||||
#include "config.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -41,13 +44,17 @@
|
|||
#include "floating_sel.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimphelp.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient_select.h"
|
||||
#include "image_render.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "layer.h"
|
||||
#include "nav_window.h"
|
||||
#include "invert.h"
|
||||
#include "lc_dialog.h"
|
||||
|
@ -58,6 +65,7 @@
|
|||
#include "plug_in.h"
|
||||
#include "resize.h"
|
||||
#include "scale.h"
|
||||
#include "selection.h"
|
||||
#include "tips_dialog.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
@ -66,9 +74,12 @@
|
|||
#include "gdisplay_color_ui.h"
|
||||
#endif /* DISPLAY_FILTERS */
|
||||
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
#define return_if_no_display(gdisp) \
|
||||
gdisp = gdisplay_active (); \
|
||||
if (!gdisp) return
|
||||
|
@ -252,7 +263,7 @@ edit_clear_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
edit_clear (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
|
||||
edit_clear (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -266,7 +277,8 @@ edit_fill_cmd_callback (GtkWidget *widget,
|
|||
return_if_no_display (gdisp);
|
||||
|
||||
fill_type = (GimpFillType) callback_action;
|
||||
edit_fill (gdisp->gimage, gimage_active_drawable (gdisp->gimage), fill_type);
|
||||
edit_fill (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage),
|
||||
fill_type);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -277,7 +289,7 @@ edit_stroke_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_mask_stroke (gdisp->gimage, gimage_active_drawable (gdisp->gimage));
|
||||
gimage_mask_stroke (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -323,7 +335,7 @@ select_float_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_mask_float (gdisp->gimage, gimage_active_drawable (gdisp->gimage),
|
||||
gimage_mask_float (gdisp->gimage, gimp_image_active_drawable (gdisp->gimage),
|
||||
0, 0);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
@ -892,13 +904,13 @@ layers_previous_cmd_callback (GtkWidget *widget,
|
|||
return_if_no_display (gdisp);
|
||||
|
||||
current_layer =
|
||||
gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
|
||||
new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer - 1);
|
||||
new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer - 1);
|
||||
|
||||
if (new_layer)
|
||||
{
|
||||
gimage_set_active_layer (gdisp->gimage, new_layer);
|
||||
gimp_image_set_active_layer (gdisp->gimage, new_layer);
|
||||
gdisplays_flush ();
|
||||
layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME);
|
||||
}
|
||||
|
@ -915,13 +927,13 @@ layers_next_cmd_callback (GtkWidget *widget,
|
|||
return_if_no_display (gdisp);
|
||||
|
||||
current_layer =
|
||||
gimage_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_get_layer_index (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
|
||||
new_layer = gimage_get_layer_by_index (gdisp->gimage, current_layer + 1);
|
||||
new_layer = gimp_image_get_layer_by_index (gdisp->gimage, current_layer + 1);
|
||||
|
||||
if (new_layer)
|
||||
{
|
||||
gimage_set_active_layer (gdisp->gimage, new_layer);
|
||||
gimp_image_set_active_layer (gdisp->gimage, new_layer);
|
||||
gdisplays_flush ();
|
||||
layer_select_init (gdisp->gimage, 0, GDK_CURRENT_TIME);
|
||||
}
|
||||
|
@ -934,7 +946,7 @@ layers_raise_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_raise_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -945,7 +957,7 @@ layers_lower_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_lower_layer (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -956,7 +968,7 @@ layers_raise_to_top_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_raise_layer_to_top (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -967,7 +979,7 @@ layers_lower_to_bottom_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gimp_image_lower_layer_to_bottom (gdisp->gimage, gdisp->gimage->active_layer);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -978,7 +990,7 @@ layers_anchor_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
floating_sel_anchor (gimage_get_active_layer (gdisp->gimage));
|
||||
floating_sel_anchor (gimp_image_get_active_layer (gdisp->gimage));
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -999,7 +1011,7 @@ layers_flatten_cmd_callback (GtkWidget *widget,
|
|||
GDisplay *gdisp;
|
||||
return_if_no_display (gdisp);
|
||||
|
||||
gimage_flatten (gdisp->gimage);
|
||||
gimp_image_flatten (gdisp->gimage);
|
||||
gdisplays_flush ();
|
||||
}
|
||||
|
||||
|
@ -1086,7 +1098,7 @@ tools_select_cmd_callback (GtkWidget *widget,
|
|||
{
|
||||
(* tool_info[tool_type].init_func) (gdisp);
|
||||
|
||||
active_tool->drawable = gimage_active_drawable (gdisp->gimage);
|
||||
active_tool->drawable = gimp_image_active_drawable (gdisp->gimage);
|
||||
}
|
||||
|
||||
/* setting the gdisp_ptr here is a HACK to allow the tools'
|
||||
|
@ -1316,11 +1328,11 @@ image_resize_callback (GtkWidget *widget,
|
|||
if (image_resize->resize->width > 0 &&
|
||||
image_resize->resize->height > 0)
|
||||
{
|
||||
gimage_resize (gimage,
|
||||
image_resize->resize->width,
|
||||
image_resize->resize->height,
|
||||
image_resize->resize->offset_x,
|
||||
image_resize->resize->offset_y);
|
||||
gimp_image_resize (gimage,
|
||||
image_resize->resize->width,
|
||||
image_resize->resize->height,
|
||||
image_resize->resize->offset_x,
|
||||
image_resize->resize->offset_y);
|
||||
gdisplays_flush ();
|
||||
lc_dialog_update_image_list ();
|
||||
}
|
||||
|
|
|
@ -26,10 +26,12 @@
|
|||
#include "cursorutil.h"
|
||||
#include "context_manager.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimprc.h"
|
||||
#include "paint_options.h"
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
static GimpContext * global_tool_context;
|
||||
|
||||
#define PAINT_OPTIONS_MASK GIMP_CONTEXT_OPACITY_MASK | \
|
||||
|
|
|
@ -15,15 +15,15 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __CONTEXT_MANAGER_H__
|
||||
#define __CONTEXT_MANAGER_H__
|
||||
|
||||
#include "gimpcontext.h"
|
||||
#include "toolsF.h"
|
||||
|
||||
void context_manager_init (void);
|
||||
void context_manager_free (void);
|
||||
void context_manager_init (void);
|
||||
void context_manager_free (void);
|
||||
|
||||
void context_manager_set_global_paint_options (gboolean global);
|
||||
|
||||
|
||||
#endif /* __CONTEXT_MANAGER_H__ */
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -103,23 +103,27 @@
|
|||
#include "floating_sel.h"
|
||||
#include "fsdither.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpui.h"
|
||||
#include "hue_saturation.h"
|
||||
#include "layer.h"
|
||||
#include "levels.h"
|
||||
#include "undo.h"
|
||||
#include "palette.h"
|
||||
#include "palette_entries.h"
|
||||
#include "palette_select.h"
|
||||
#include "pixel_region.h"
|
||||
#include "posterize.h"
|
||||
#include "threshold.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tile_manager_pvt.h" /* ick ick ick. */
|
||||
|
||||
#include "libgimp/gimpcolorspace.h"
|
||||
#include "libgimp/gimphelpui.h"
|
||||
#include "libgimp/gimpmath.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "layer_pvt.h" /* ick. */
|
||||
#include "drawable_pvt.h" /* ick ick. */
|
||||
#include "tile_manager_pvt.h" /* ick ick ick. */
|
||||
|
||||
#define PRECISION_R 6
|
||||
#define PRECISION_G 6
|
||||
|
@ -550,7 +554,7 @@ convert_to_indexed (GimpImage *gimage)
|
|||
|
||||
if (dialog->num_cols == 256)
|
||||
{
|
||||
if ((!gimage_is_empty (gimage))
|
||||
if ((!gimp_image_is_empty (gimage))
|
||||
&&
|
||||
(
|
||||
gimage->layers->next
|
||||
|
@ -754,7 +758,7 @@ convert_to_indexed (GimpImage *gimage)
|
|||
/* if the image isn't non-alpha/layered, set the default number of
|
||||
colours to one less than max, to leave room for a transparent index
|
||||
for transparent/animated GIFs */
|
||||
if ((!gimage_is_empty (gimage))
|
||||
if ((!gimp_image_is_empty (gimage))
|
||||
&&
|
||||
(
|
||||
gimage->layers->next
|
||||
|
@ -1211,7 +1215,7 @@ convert_image (GImage *gimage,
|
|||
gimp_add_busy_cursors();
|
||||
|
||||
/* Get the floating layer if one exists */
|
||||
floating_layer = gimage_floating_sel (gimage);
|
||||
floating_layer = gimp_image_floating_sel (gimage);
|
||||
|
||||
undo_push_group_start (gimage, GIMAGE_MOD_UNDO);
|
||||
|
||||
|
@ -1442,7 +1446,7 @@ convert_image (GImage *gimage,
|
|||
quantobj->delete_func (quantobj);
|
||||
|
||||
/* Make sure the projection is up to date */
|
||||
gimage_projection_realloc (gimage);
|
||||
gimp_image_projection_realloc (gimage);
|
||||
|
||||
/* Rigor the floating selection */
|
||||
if (floating_layer)
|
||||
|
@ -1452,7 +1456,7 @@ convert_image (GImage *gimage,
|
|||
|
||||
/* shrink wrap and update all views */
|
||||
layer_invalidate_previews (gimage);
|
||||
gimage_invalidate_preview (gimage);
|
||||
gimp_image_invalidate_preview (gimage);
|
||||
gdisplays_update_title (gimage);
|
||||
gdisplays_update_full (gimage);
|
||||
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
#ifndef __CONVERT_H__
|
||||
#define __CONVERT_H__
|
||||
|
||||
#include "procedural_db.h"
|
||||
#include "palette_entries.h"
|
||||
|
||||
|
||||
/* adam's extra palette stuff */
|
||||
typedef enum
|
||||
|
@ -47,17 +44,18 @@ typedef enum
|
|||
#define MAXNUMCOLORS 256
|
||||
|
||||
/* convert functions */
|
||||
void convert_to_rgb (GimpImage *);
|
||||
void convert_to_grayscale (GimpImage *);
|
||||
void convert_to_indexed (GimpImage *);
|
||||
void convert_to_rgb (GimpImage *gimage);
|
||||
void convert_to_grayscale (GimpImage *gimage);
|
||||
void convert_to_indexed (GimpImage *gimage);
|
||||
|
||||
void convert_image (GimpImage *gimage,
|
||||
GimpImageBaseType ,
|
||||
gint num_cols,
|
||||
ConvertDitherType ,
|
||||
gint alpha_dither,
|
||||
gint remdups,
|
||||
ConvertPaletteType );
|
||||
|
||||
void convert_image (GimpImage *,
|
||||
GimpImageBaseType,
|
||||
gint num_cols,
|
||||
ConvertDitherType,
|
||||
gint alpha_dither,
|
||||
gint remdups,
|
||||
ConvertPaletteType);
|
||||
|
||||
extern PaletteEntries *theCustomPalette;
|
||||
|
||||
|
|
|
@ -18,13 +18,19 @@
|
|||
|
||||
/* NOTE: This file is autogenerated by pdbgen.pl. */
|
||||
|
||||
#include "procedural_db.h"
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "convert.h"
|
||||
#include "gimage.h"
|
||||
#include "palette.h"
|
||||
#include "palette_entries.h"
|
||||
|
||||
static ProcRecord convert_rgb_proc;
|
||||
static ProcRecord convert_grayscale_proc;
|
||||
|
|
|
@ -27,11 +27,15 @@
|
|||
#include "drawable.h"
|
||||
#include "convolve.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpui.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "paint_core.h"
|
||||
#include "paint_options.h"
|
||||
#include "pixel_region.h"
|
||||
#include "selection.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tools.h"
|
||||
#include "gimage.h"
|
||||
|
||||
|
@ -344,7 +348,8 @@ convolve_motion (PaintCore *paint_core,
|
|||
|
||||
/* If the brush is smaller than the convolution matrix, don't convolve */
|
||||
|
||||
if((paint_core->brush->mask->width < matrix_size) || (paint_core->brush->mask->height < matrix_size))
|
||||
if ((paint_core->brush->mask->width < matrix_size) ||
|
||||
(paint_core->brush->mask->height < matrix_size))
|
||||
return;
|
||||
|
||||
if (pressure_options->size)
|
||||
|
|
|
@ -15,11 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __CONVOLVE_H__
|
||||
#define __CONVOLVE_H__
|
||||
|
||||
#include "paint_core.h"
|
||||
#include "tools.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -29,10 +28,19 @@ typedef enum
|
|||
} ConvolveType;
|
||||
|
||||
|
||||
void * convolve_paint_func (PaintCore *, GimpDrawable *, int);
|
||||
gboolean convolve_non_gui (GimpDrawable *, double, ConvolveType, int, double *);
|
||||
gboolean convolve_non_gui_default (GimpDrawable *, int, double *);
|
||||
Tool * tools_new_convolve (void);
|
||||
void tools_free_convolve (Tool *);
|
||||
void * convolve_paint_func (PaintCore *,
|
||||
GimpDrawable *,
|
||||
gint );
|
||||
gboolean convolve_non_gui (GimpDrawable *,
|
||||
gdouble ,
|
||||
ConvolveType ,
|
||||
gint ,
|
||||
gdouble *);
|
||||
gboolean convolve_non_gui_default (GimpDrawable *,
|
||||
gint ,
|
||||
gdouble *);
|
||||
Tool * tools_new_convolve (void );
|
||||
void tools_free_convolve (Tool *);
|
||||
|
||||
|
||||
#endif /* __CONVOLVE_H__ */
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
|
||||
|
@ -31,17 +31,20 @@
|
|||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpui.h"
|
||||
#include "global_edit.h"
|
||||
#include "layer.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "pixel_region.h"
|
||||
#include "tile_manager.h"
|
||||
#include "tools.h"
|
||||
#include "undo.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#include "tile_manager_pvt.h"
|
||||
#include "drawable_pvt.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -62,9 +65,9 @@ struct _PasteNamedDlg
|
|||
};
|
||||
|
||||
/* The named buffer structure... */
|
||||
typedef struct _named_buffer NamedBuffer;
|
||||
typedef struct _NamedBuffer NamedBuffer;
|
||||
|
||||
struct _named_buffer
|
||||
struct _NamedBuffer
|
||||
{
|
||||
TileManager *buf;
|
||||
gchar *name;
|
||||
|
|
|
@ -15,10 +15,10 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GLOBAL_EDIT_H__
|
||||
#define __GLOBAL_EDIT_H__
|
||||
|
||||
#include "gimage.h"
|
||||
|
||||
TileManager * crop_buffer (TileManager *tiles,
|
||||
gint border);
|
||||
|
@ -51,4 +51,5 @@ gboolean named_edit_copy (GDisplay *gdisp);
|
|||
gboolean named_edit_paste (GDisplay *gdisp);
|
||||
void named_buffers_free (void);
|
||||
|
||||
|
||||
#endif /* __GLOBAL_EDIT_H__ */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue