gimp/libgimp/gimpimage.c
Michael Natterer 7d1375e949 Makefile.am configure.in added new directory libgimpbase/
2001-05-21  Michael Natterer  <mitch@gimp.org>

	* Makefile.am
	* configure.in
	* gimptool-1.4.in: added new directory libgimpbase/

	* app/Makefile.am: link against the new lib.

	* app/appenums.h: removed the PDB enums which are in
	libgimpbase/gimpbasetypes.h now. They are all "Gimp" prefixed.

	* app/apptypes.h: #include "libgimpbase/gimpbasetypes.h"

	* app/[lots]
	* app/core/[of]
	* app/gui/[files]
	* app/tools/: changed includes and all PDB types.

	* app/pdb/*: regenerated.

	* libgimp/Makefile.am: don't build libgimpi.a uglyness any more.

	* libgimp/gimpenv.[ch]
	* libgimp/gimplimits.[hh]
	* libgimp/gimpparasite.[ch]
	* libgimp/gimpparasiteio.[ch]
	* libgimp/gimpprotocol.[ch]
	* libgimp/gimpsignal.[ch]
	* libgimp/gimpunit.h
	* libgimp/gimputils.[ch]
	* libgimp/gimpwire.[ch]: removed...

	* libgimpbase/*: ...and added here as new library.

	* libgimp/gimp.[ch]
	* libgimp/gimpdrawable.[ch]
	* libgimp/gimpenums.h
	* libgimp/gimpimage.[ch]
	* libgimp/gimptile.c
	* libgimp/gimptypes.h
	* libgimp/gimpunit.c: changed accordingly. Added the
	gimp_*_add_new_parasite to gimp.[ch], gimpdrawable.[ch] and
	gimpimage.[ch].

	* libgimpwidgets/gimppatheditor.c
	* libgimpwidgets/gimpquerybox.c
	* libgimpwidgets/gimpsizeentry.c
	* libgimpwidgets/gimpunitmenu.c
	* libgimpwidgets/gimpwidgets.c
	* libgimpwidgets/gimpwidgetstypes.h: changed includes accordingly.

	* plug-ins/*/Makefile.am
	* plug-ins/common/mkgen.pl: link against libgimpbase.

	* tools/pdbgen/Makefile.am: scan libgimpbase/gimpbasetypes.h, so
	the enums are known to pdbgen...

	* tools/pdbgen/enumcode.pl: ...but don't write them out to
	libgimp/gimpenums.h

	* tools/pdbgen/app.pl: include libgimp/gimpbase.h in all *_cmds.c
	files. Added GIMP_ to the type names ganerated in app/.

	* tools/pdbgen/enums.pl: regenerated.

	* tools/pdbgen/pdb.pl
	* tools/pdbgen/pdb/fileops.pdb
	* tools/pdbgen/pdb/procedural_db.pdb
	* tools/pdbgen/pdb/unit.pdb: changed includes.
2001-05-21 13:58:46 +00:00

117 lines
2.8 KiB
C

/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
*
* gimpimage.c
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "gimp.h"
/**
* gimp_image_get_cmap:
* @image_ID: The image.
* @num_colors: Number of colors in the colormap array.
*
* Returns the image's colormap
*
* This procedure returns an actual pointer to the image's colormap, as
* well as the number of colors contained in the colormap. If the image
* is not of base type INDEXED, this pointer will be NULL.
*
* Returns: The image's colormap.
*/
guchar *
gimp_image_get_cmap (gint32 image_ID,
gint *num_colors)
{
gint num_bytes;
guchar *cmap;
cmap = _gimp_image_get_cmap (image_ID,
&num_bytes);
*num_colors = num_bytes / 3;
return cmap;
}
/**
* gimp_image_set_cmap:
* @image_ID: The image.
* @cmap: The new colormap values.
* @num_colors: Number of colors in the colormap array.
*
* Sets the entries in the image's colormap.
*
* This procedure sets the entries in the specified image's colormap.
* The number of colors is specified by the \"num_colors\" parameter
* and corresponds to the number of INT8 triples that must be contained
* in the \"cmap\" array.
*
* Returns: TRUE on success.
*/
gboolean
gimp_image_set_cmap (gint32 image_ID,
guchar *cmap,
gint num_colors)
{
return _gimp_image_set_cmap (image_ID,
num_colors * 3,
cmap);
}
guchar *
gimp_image_get_thumbnail_data (gint32 image_ID,
gint *width,
gint *height,
gint *bpp)
{
gint ret_width;
gint ret_height;
guchar *image_data;
gint data_size;
_gimp_image_thumbnail (image_ID,
*width,
*height,
&ret_width,
&ret_height,
bpp,
&data_size,
&image_data);
*width = ret_width;
*height = ret_height;
return image_data;
}
void
gimp_image_attach_new_parasite (gint32 image_ID,
const gchar *name,
gint flags,
gint size,
const gpointer data)
{
GimpParasite *parasite = gimp_parasite_new (name, flags, size, data);
gimp_image_parasite_attach (image_ID, parasite);
gimp_parasite_free (parasite);
}