mutter/src/backends/meta-color-device.h
Jonas Ådahl 0a0fb2fda9 color: Create color profile for assigned profile
We created device profiles, that we manage the lifetime of in colord,
but color devices can be assigned profiles other than the ones it was
created for. For example, this can include the standard sRGB profile
provided by colord.

To achieve this, keep track of the default profile of the CdDevice as
the "assigned" color profile of the device. Given this profile
(CdProfile), construct a MetaColorProfile that can then be interacted
with as if it was generated by ourself.

The assigned profile (default profile in colord terms) does nothing
special so far, but will later be used to determine how to apply CRTC
gamma ramps etc.

The sRGB.icc file used in the tests was copied from colord. It was
stated in the repository that it has no known copyright restrictions.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2164>
2022-09-01 16:54:04 +02:00

66 lines
2.5 KiB
C

/*
* Copyright (C) 2021 Red Hat Inc.
*
* 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 2 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
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef META_COLOR_DEVICE_H
#define META_COLOR_DEVICE_H
#include <glib-object.h>
#include <gio/gio.h>
#include "backends/meta-backend-types.h"
#include "core/util-private.h"
#define META_TYPE_COLOR_DEVICE (meta_color_device_get_type ())
G_DECLARE_FINAL_TYPE (MetaColorDevice, meta_color_device,
META, COLOR_DEVICE,
GObject)
MetaColorDevice * meta_color_device_new (MetaColorManager *color_manager,
MetaMonitor *monitor);
void meta_color_device_destroy (MetaColorDevice *color_device);
void meta_color_device_update_monitor (MetaColorDevice *color_device,
MetaMonitor *monitor);
META_EXPORT_TEST
const char * meta_color_device_get_id (MetaColorDevice *color_device);
META_EXPORT_TEST
MetaMonitor * meta_color_device_get_monitor (MetaColorDevice *color_device);
META_EXPORT_TEST
MetaColorProfile * meta_color_device_get_device_profile (MetaColorDevice *color_device);
META_EXPORT_TEST
MetaColorProfile * meta_color_device_get_assigned_profile (MetaColorDevice *color_device);
void meta_color_device_generate_profile (MetaColorDevice *color_device,
const char *file_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
MetaColorProfile * meta_color_device_generate_profile_finish (MetaColorDevice *color_device,
GAsyncResult *res,
GError **error);
META_EXPORT_TEST
gboolean meta_color_device_is_ready (MetaColorDevice *color_device);
#endif /* META_COLOR_DEVICE_H */