mutter/clutter/clutter/clutter-color-state-private.h
Joan Torres 0095e7d50a clutter/color-state-params: Improve create transform snippet
Make create_transform_snippet method more consistent.

Abstract TransferFunction struct: convert it to ColorOpSnippet.

This transform snippet will be defined by these ColorOpSnippets.
These ColorOpSnippets are similar to the prescriptive DRM API for
color transformation.

A standard transform snippet would have as ColorOpSnippets:
  1. eotf
  2. luminance_mapping
  3. color_space_mapping
  4. inv_eotf

Update uniforms the same way the transform snippet is defined.

Update color transform key to consider how the transform snippet is
generated.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4144>
2024-12-05 22:24:05 +00:00

47 lines
1.6 KiB
C

/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2024 Red Hat
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
#include "clutter/clutter-color-state.h"
typedef struct _ClutterColorTransformKey
{
/* 3 bits to define TransferFunction enums
* + 1 bit to define Gamma TF */
guint source_eotf_bits : 4;
guint target_eotf_bits : 4;
/* When there is a luminance mapping snippet */
guint luminance_bit : 1;
/* When there is a color trans snippet */
guint color_trans_bit : 1;
} ClutterColorTransformKey;
void clutter_color_transform_key_init (ClutterColorTransformKey *key,
ClutterColorState *color_state,
ClutterColorState *target_color_state);
guint clutter_color_transform_key_hash (gconstpointer data);
gboolean clutter_color_transform_key_equal (gconstpointer data1,
gconstpointer data2);