app: add gimp_babl_format_change_{component_type,trc}()
... which change a format's component-type/TRC, without otherwise affecting it.
This commit is contained in:
parent
d7f12c9d26
commit
ffaaa81c8a
2 changed files with 60 additions and 33 deletions
|
|
@ -1534,6 +1534,34 @@ gimp_babl_component_format (GimpImageBaseType base_type,
|
|||
g_return_val_if_reached (NULL);
|
||||
}
|
||||
|
||||
const Babl *
|
||||
gimp_babl_format_change_component_type (const Babl *format,
|
||||
GimpComponentType component)
|
||||
{
|
||||
g_return_val_if_fail (format != NULL, NULL);
|
||||
|
||||
return gimp_babl_format (gimp_babl_format_get_base_type (format),
|
||||
gimp_babl_precision (
|
||||
component,
|
||||
gimp_babl_format_get_trc (format)),
|
||||
babl_format_has_alpha (format),
|
||||
babl_format_get_space (format));
|
||||
}
|
||||
|
||||
const Babl *
|
||||
gimp_babl_format_change_trc (const Babl *format,
|
||||
GimpTRCType trc)
|
||||
{
|
||||
g_return_val_if_fail (format != NULL, NULL);
|
||||
|
||||
return gimp_babl_format (gimp_babl_format_get_base_type (format),
|
||||
gimp_babl_precision (
|
||||
gimp_babl_format_get_component_type (format),
|
||||
trc),
|
||||
babl_format_has_alpha (format),
|
||||
babl_format_get_space (format));
|
||||
}
|
||||
|
||||
gchar **
|
||||
gimp_babl_print_pixel (const Babl *format,
|
||||
gpointer pixel)
|
||||
|
|
|
|||
|
|
@ -22,45 +22,44 @@
|
|||
#define __GIMP_BABL_H__
|
||||
|
||||
|
||||
void gimp_babl_init (void);
|
||||
void gimp_babl_init_fishes (GimpInitStatusFunc status_callback);
|
||||
void gimp_babl_init (void);
|
||||
void gimp_babl_init_fishes (GimpInitStatusFunc status_callback);
|
||||
|
||||
const gchar * gimp_babl_format_get_description
|
||||
(const Babl *format);
|
||||
GimpColorProfile * gimp_babl_format_get_color_profile
|
||||
(const Babl *format);
|
||||
GimpColorProfile * gimp_babl_get_builtin_color_profile
|
||||
(GimpImageBaseType base_type,
|
||||
GimpTRCType trc);
|
||||
const gchar * gimp_babl_format_get_description (const Babl *format);
|
||||
GimpColorProfile * gimp_babl_format_get_color_profile (const Babl *format);
|
||||
GimpColorProfile * gimp_babl_get_builtin_color_profile (GimpImageBaseType base_type,
|
||||
GimpTRCType trc);
|
||||
|
||||
GimpImageBaseType gimp_babl_format_get_base_type
|
||||
(const Babl *format);
|
||||
GimpComponentType gimp_babl_format_get_component_type
|
||||
(const Babl *format);
|
||||
GimpPrecision gimp_babl_format_get_precision
|
||||
(const Babl *format);
|
||||
GimpTRCType gimp_babl_format_get_trc (const Babl *format);
|
||||
GimpImageBaseType gimp_babl_format_get_base_type (const Babl *format);
|
||||
GimpComponentType gimp_babl_format_get_component_type (const Babl *format);
|
||||
GimpPrecision gimp_babl_format_get_precision (const Babl *format);
|
||||
GimpTRCType gimp_babl_format_get_trc (const Babl *format);
|
||||
|
||||
GimpComponentType gimp_babl_component_type (GimpPrecision precision);
|
||||
GimpTRCType gimp_babl_trc (GimpPrecision precision);
|
||||
GimpPrecision gimp_babl_precision (GimpComponentType component,
|
||||
GimpTRCType trc);
|
||||
GimpComponentType gimp_babl_component_type (GimpPrecision precision);
|
||||
GimpTRCType gimp_babl_trc (GimpPrecision precision);
|
||||
GimpPrecision gimp_babl_precision (GimpComponentType component,
|
||||
GimpTRCType trc);
|
||||
|
||||
gboolean gimp_babl_is_valid (GimpImageBaseType base_type,
|
||||
GimpPrecision precision);
|
||||
GimpComponentType gimp_babl_is_bounded (GimpPrecision precision);
|
||||
gboolean gimp_babl_is_valid (GimpImageBaseType base_type,
|
||||
GimpPrecision precision);
|
||||
GimpComponentType gimp_babl_is_bounded (GimpPrecision precision);
|
||||
|
||||
const Babl * gimp_babl_format (GimpImageBaseType base_type,
|
||||
GimpPrecision precision,
|
||||
gboolean with_alpha,
|
||||
const Babl *space);
|
||||
const Babl * gimp_babl_mask_format (GimpPrecision precision);
|
||||
const Babl * gimp_babl_component_format (GimpImageBaseType base_type,
|
||||
GimpPrecision precision,
|
||||
gint index);
|
||||
const Babl * gimp_babl_format (GimpImageBaseType base_type,
|
||||
GimpPrecision precision,
|
||||
gboolean with_alpha,
|
||||
const Babl *space);
|
||||
const Babl * gimp_babl_mask_format (GimpPrecision precision);
|
||||
const Babl * gimp_babl_component_format (GimpImageBaseType base_type,
|
||||
GimpPrecision precision,
|
||||
gint index);
|
||||
|
||||
gchar ** gimp_babl_print_pixel (const Babl *format,
|
||||
gpointer pixel);
|
||||
const Babl * gimp_babl_format_change_component_type (const Babl *format,
|
||||
GimpComponentType component);
|
||||
const Babl * gimp_babl_format_change_trc (const Babl *format,
|
||||
GimpTRCType trc);
|
||||
|
||||
gchar ** gimp_babl_print_pixel (const Babl *format,
|
||||
gpointer pixel);
|
||||
|
||||
|
||||
#endif /* __GIMP_BABL_H__ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue