diff --git a/libweston/color-lcms/color-lcms.h b/libweston/color-lcms/color-lcms.h index 9d859b08f..05fa940ac 100644 --- a/libweston/color-lcms/color-lcms.h +++ b/libweston/color-lcms/color-lcms.h @@ -180,4 +180,10 @@ cmlcms_color_transform_get(struct weston_color_manager_lcms *cm, void cmlcms_color_transform_destroy(struct cmlcms_color_transform *xform); +struct cmlcms_color_profile * +ref_cprof(struct cmlcms_color_profile *cprof); + +void +unref_cprof(struct cmlcms_color_profile *cprof); + #endif /* WESTON_COLOR_LCMS_H */ diff --git a/libweston/color-lcms/color-profile.c b/libweston/color-lcms/color-profile.c index 46ef46bf2..0d11439d3 100644 --- a/libweston/color-lcms/color-profile.c +++ b/libweston/color-lcms/color-profile.c @@ -114,6 +114,25 @@ cmlcms_color_profile_destroy(struct cmlcms_color_profile *cprof) free(cprof); } +struct cmlcms_color_profile * +ref_cprof(struct cmlcms_color_profile *cprof) +{ + if (!cprof) + return NULL; + + weston_color_profile_ref(&cprof->base); + return cprof; +} + +void +unref_cprof(struct cmlcms_color_profile *cprof) +{ + if (!cprof) + return; + + weston_color_profile_unref(&cprof->base); +} + static char * make_icc_file_description(cmsHPROFILE profile, const struct cmlcms_md5_sum *md5sum,