gimpimage-color-profile.h 7.37 KB
Newer Older
1 2 3
/* GIMP - The GNU Image Manipulation Program
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
4
 * gimpimage-color-profile.h
5
 * Copyright (C) 2015-2018 Michael Natterer <mitch@gimp.org>
6
 *
7 8 9 10 11 12 13 14 15 16 17
 * 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 3 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
18
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
19 20
 */

21 22
#ifndef __GIMP_IMAGE_COLOR_PROFILE_H__
#define __GIMP_IMAGE_COLOR_PROFILE_H__
23 24 25 26 27


#define GIMP_ICC_PROFILE_PARASITE_NAME "icc-profile"


28 29 30 31 32 33 34 35
gboolean             gimp_image_get_use_srgb_profile   (GimpImage           *image,
                                                        gboolean            *hidden_profile);
void                 gimp_image_set_use_srgb_profile   (GimpImage           *image,
                                                        gboolean             use_srgb);

GimpColorProfile   * _gimp_image_get_hidden_profile    (GimpImage           *image);
void                 _gimp_image_set_hidden_profile    (GimpImage           *image,
                                                        GimpColorProfile    *profile,
36 37
                                                        gboolean             push_undo);

38
gboolean             gimp_image_validate_icc_parasite  (GimpImage           *image,
39
                                                        const GimpParasite  *icc_parasite,
40
                                                        gboolean            *is_builtin,
41
                                                        GError             **error);
42 43
const GimpParasite * gimp_image_get_icc_parasite       (GimpImage           *image);
void                 gimp_image_set_icc_parasite       (GimpImage           *image,
44 45 46 47 48
                                                        const GimpParasite  *icc_parasite);

gboolean             gimp_image_validate_icc_profile   (GimpImage           *image,
                                                        const guint8        *data,
                                                        gsize                length,
49
                                                        gboolean            *is_builtin,
50 51 52 53 54 55 56
                                                        GError             **error);
const guint8       * gimp_image_get_icc_profile        (GimpImage           *image,
                                                        gsize               *length);
gboolean             gimp_image_set_icc_profile        (GimpImage           *image,
                                                        const guint8        *data,
                                                        gsize                length,
                                                        GError             **error);
57 58

gboolean             gimp_image_validate_color_profile (GimpImage           *image,
59
                                                        GimpColorProfile    *profile,
60
                                                        gboolean            *is_builtin,
61
                                                        GError             **error);
62
GimpColorProfile   * gimp_image_get_color_profile      (GimpImage           *image);
63
gboolean             gimp_image_set_color_profile      (GimpImage           *image,
64
                                                        GimpColorProfile    *profile,
65
                                                        GError             **error);
66

67 68 69 70 71 72
gboolean             gimp_image_validate_color_profile_by_format
                                                       (const Babl          *format,
                                                        GimpColorProfile    *profile,
                                                        gboolean            *is_builtin,
                                                        GError             **error);

73 74 75
GimpColorProfile   * gimp_image_get_builtin_color_profile
                                                       (GimpImage           *image);

76 77 78 79 80
gboolean             gimp_image_assign_color_profile   (GimpImage           *image,
                                                        GimpColorProfile    *dest_profile,
                                                        GimpProgress        *progress,
                                                        GError             **error);

81 82
gboolean             gimp_image_convert_color_profile  (GimpImage           *image,
                                                        GimpColorProfile    *dest_profile,
83
                                                        GimpColorRenderingIntent  intent,
84 85 86 87 88 89 90 91 92
                                                        gboolean             bpc,
                                                        GimpProgress        *progress,
                                                        GError             **error);

void                 gimp_image_import_color_profile   (GimpImage           *image,
                                                        GimpContext         *context,
                                                        GimpProgress        *progress,
                                                        gboolean             interactive);

93 94 95 96
GimpColorTransform * gimp_image_get_color_transform_to_srgb_u8
                                                       (GimpImage           *image);
GimpColorTransform * gimp_image_get_color_transform_from_srgb_u8
                                                       (GimpImage           *image);
97

98 99 100 101
GimpColorTransform * gimp_image_get_color_transform_to_srgb_double
                                                       (GimpImage           *image);
GimpColorTransform * gimp_image_get_color_transform_from_srgb_double
                                                       (GimpImage           *image);
102

103 104 105 106 107
void                 gimp_image_color_profile_pixel_to_srgb
                                                       (GimpImage           *image,
                                                        const Babl          *pixel_format,
                                                        gpointer             pixel,
                                                        GimpRGB             *color);
108 109 110 111 112
void                 gimp_image_color_profile_srgb_to_pixel
                                                       (GimpImage           *image,
                                                        const GimpRGB       *color,
                                                        const Babl          *pixel_format,
                                                        gpointer             pixel);
113

114

115 116 117
/*  internal API, to be called only from gimpimage.c  */

void                 _gimp_image_free_color_profile    (GimpImage           *image);
118
void                 _gimp_image_free_color_transforms (GimpImage           *image);
119 120
void                 _gimp_image_update_color_profile  (GimpImage           *image,
                                                        const GimpParasite  *icc_parasite);
121

122

123
#endif /* __GIMP_IMAGE_COLOR_PROFILE_H__ */