mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-22 12:32:37 +00:00
19e1acbcd7
2001-11-27 Sven Neumann <sven@gimp.org> * configure.in * app/Makefile.am * app/config/gimpconfig.[ch] * app/config/gimpconfig-serialize.[ch] * app/config/gimpconfig-deserialize.[ch]: added new base class GimpConfig that knows how to serialize and deserialize it's properties in sexp format. Contains two example properties that will go into derived classes once this is really used. * app/main.c: deserialize and serialize the test GimpConfig object to ~/.gimp-1.3/foorc (only for debugging). * app/widgets/widgets-types.h * app/core/core-types.h: moved GimpPreviewSize enum to core-types. * app/core/core-types.h: don't include gdk-pixbuf.h. * app/core/gimptoolinfo.h * app/core/gimpimagefile.c: include gdk-pixbuf.h. * app/core/gimpimage.[ch]: made construct_flag a gboolean. * app/core/gimpdrawable-invert.c * app/core/gimpunit.c * tools/pdbgen/pdb/plug_in.pdb * app/pdb/plug_in_cmds.c: removed unused variables. * app/display/Makefile.am: removed .PHONY and files cruft * app/Makefile.am * libgimp/Makefile.am * libgimpbase/Makefile.am * libgimpcolor/Makefile.am * libgimpmath/Makefile.am * libgimpwidgets/Makefile.am * plug-ins/Makefile.am: removed commented out makefile.mingw rules. If we ever need them again, they can easily be resurrected from CVS.
60 lines
1.7 KiB
C
60 lines
1.7 KiB
C
/* 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-object.h>
|
|
|
|
#include "core-types.h"
|
|
|
|
#include "base/gimplut.h"
|
|
#include "base/lut-funcs.h"
|
|
#include "base/pixel-processor.h"
|
|
#include "base/pixel-region.h"
|
|
|
|
#include "gimpdrawable.h"
|
|
#include "gimpdrawable-invert.h"
|
|
|
|
|
|
void
|
|
gimp_drawable_invert (GimpDrawable *drawable)
|
|
{
|
|
PixelRegion srcPR, destPR;
|
|
gint x1, y1, x2, y2;
|
|
GimpLut *lut;
|
|
|
|
lut = invert_lut_new (gimp_drawable_bytes (drawable));
|
|
|
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
|
pixel_region_init (&srcPR, gimp_drawable_data (drawable),
|
|
x1, y1, (x2 - x1), (y2 - y1), FALSE);
|
|
pixel_region_init (&destPR, gimp_drawable_shadow (drawable),
|
|
x1, y1, (x2 - x1), (y2 - y1), TRUE);
|
|
|
|
pixel_regions_process_parallel ((p_func)gimp_lut_process, lut,
|
|
2, &srcPR, &destPR);
|
|
|
|
gimp_lut_free (lut);
|
|
|
|
gimp_drawable_merge_shadow (drawable, TRUE);
|
|
|
|
gimp_drawable_update (drawable,
|
|
x1, y1,
|
|
(x2 - x1), (y2 - y1));
|
|
}
|