mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-03 09:23:24 +00:00
Issue #9477: remove gimp_image_[gs]et_colormap() from libgimp API.
They are now replaced by the more generic gimp_palette_[gs]et_colormap(), hence making less of a particular concept of "image colormap". It's just a palette attached to the image (and restricted to the image format).
This commit is contained in:
parent
2e1bf0e44c
commit
3bfda4f119
11 changed files with 21 additions and 373 deletions
|
@ -378,8 +378,9 @@ gimp_drawable_get_format (GimpDrawable *drawable)
|
|||
{
|
||||
const Babl *palette;
|
||||
const Babl *palette_alpha;
|
||||
const Babl *color_format;
|
||||
guchar *colormap;
|
||||
gint colormap_len, n_colors;
|
||||
gint n_colors;
|
||||
|
||||
babl_new_palette_with_space (format_str, space,
|
||||
&palette, &palette_alpha);
|
||||
|
@ -389,14 +390,12 @@ gimp_drawable_get_format (GimpDrawable *drawable)
|
|||
else
|
||||
format = palette;
|
||||
|
||||
colormap = gimp_image_get_colormap (image, &colormap_len, &n_colors);
|
||||
color_format = babl_format_with_space ("R'G'B' u8", space);
|
||||
colormap = gimp_palette_get_colormap (gimp_image_get_palette (image), color_format, &n_colors, NULL);
|
||||
|
||||
if (colormap)
|
||||
{
|
||||
babl_palette_set_palette (format,
|
||||
babl_format_with_space ("R'G'B' u8",
|
||||
space),
|
||||
colormap, n_colors);
|
||||
babl_palette_set_palette (format, color_format, colormap, n_colors);
|
||||
g_free (colormap);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue