1
/* LIBGIMP - The GIMP Library
2
* Copyright (C) 1995-2000 Peter Mattis and Spencer Kimball
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2 of the License, or (at your option) any later version.
11
* This library is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with this library; if not, write to the
18
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
28
* gimp_image_get_cmap:
29
* @image_ID: The image.
30
* @num_colors: Number of colors in the colormap array.
32
* This procedure is deprecated! Use gimp_image_get_colormap() instead.
34
* Returns: The image's colormap.
37
gimp_image_get_cmap (gint32 image_ID,
40
return gimp_image_get_colormap (image_ID, num_colors);
44
* gimp_image_set_cmap:
45
* @image_ID: The image.
46
* @cmap: The new colormap values.
47
* @num_colors: Number of colors in the colormap array.
49
* This procedure is deprecated! Use gimp_image_set_colormap() instead.
51
* Returns: TRUE on success.
54
gimp_image_set_cmap (gint32 image_ID,
58
return gimp_image_set_colormap (image_ID, cmap, num_colors);
62
* gimp_image_get_colormap:
63
* @image_ID: The image.
64
* @num_colors: Number of colors in the colormap array.
66
* Returns the image's colormap
68
* This procedure returns an actual pointer to the image's colormap, as
69
* well as the number of colors contained in the colormap. If the image
70
* is not of base type INDEXED, this pointer will be NULL.
72
* Returns: The image's colormap.
75
gimp_image_get_colormap (gint32 image_ID,
81
cmap = _gimp_image_get_colormap (image_ID, &num_bytes);
83
*num_colors = num_bytes / 3;
89
* gimp_image_set_colormap:
90
* @image_ID: The image.
91
* @colormap: The new colormap values.
92
* @num_colors: Number of colors in the colormap array.
94
* Sets the entries in the image's colormap.
96
* This procedure sets the entries in the specified image's colormap.
97
* The number of colors is specified by the \"num_colors\" parameter
98
* and corresponds to the number of INT8 triples that must be contained
99
* in the \"cmap\" array.
101
* Returns: TRUE on success.
104
gimp_image_set_colormap (gint32 image_ID,
105
const guchar *colormap,
108
return _gimp_image_set_colormap (image_ID, num_colors * 3, colormap);
112
gimp_image_get_thumbnail_data (gint32 image_ID,
122
_gimp_image_thumbnail (image_ID,
132
*height = ret_height;
138
* gimp_image_attach_new_parasite:
139
* @image_ID: the ID of the image to attach the #GimpParasite to.
140
* @name: the name of the #GimpParasite to create and attach.
141
* @flags: the flags set on the #GimpParasite.
142
* @size: the size of the parasite data in bytes.
143
* @data: a pointer to the data attached with the #GimpParasite.
145
* Convenience function that creates a parasite and attaches it
148
* See Also: gimp_image_parasite_attach()
151
gimp_image_attach_new_parasite (gint32 image_ID,
157
GimpParasite *parasite = gimp_parasite_new (name, flags, size, data);
159
gimp_image_parasite_attach (image_ID, parasite);
161
gimp_parasite_free (parasite);