/* Copyright (C) 2024 The gtkmm Development Team
 *
 * 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.1 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/>.
 */

_CONFIGINCLUDE(gdkmmconfig.h)

#include <glibmm/object.h>

_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)

namespace Gdk
{
class GDKMM_API ColorState;

/** %Gdk::CicpParams contains the parameters that define
 * a colorstate according to the ITU-T H.273
 * [specification](https://www.itu.int/rec/T-REC-H.273/en).
 *
 * See the documentation of individual properties for supported values.
 *
 * The 'unspecified' value (2) is not treated in any special way, and
 * must be replaced by a different value before creating a color state.
 *
 * %Gdk::CicpParams can be used as a builder object to construct a color
 * state from Cicp data with build_color_state().
 * The function will throw an exception if the given parameters are not
 * supported.
 *
 * You can obtain a %Gdk::CicpParams object from a color state with
 * Gdk::ColorState::create_cicp_params(). This can be used to
 * create a variant of a color state, by changing just one of the cicp
 * parameters, or just to obtain information about the color state.
 *
 * @newin{4,16}
 */
class GDKMM_API CicpParams : public Glib::Object
{
  _CLASS_GOBJECT(CicpParams, GdkCicpParams, GDK_CICP_PARAMS, Glib::Object, GObject, , , GDKMM_API)
  _DO_NOT_DERIVE_GTYPE dnl// GdkCicpParams is an internal type

protected:
  _CTOR_DEFAULT()

public:
  _WRAP_ENUM(Range, GdkCicpRange, decl_prefix GDKMM_API)

  _WRAP_METHOD_DOCS_ONLY(gdk_cicp_params_new)
  _WRAP_CREATE()

  _WRAP_METHOD(guint get_color_primaries() const, gdk_cicp_params_get_color_primaries)
  _WRAP_METHOD(void set_color_primaries(guint color_primaries), gdk_cicp_params_set_color_primaries)

  _WRAP_METHOD(guint get_transfer_function() const, gdk_cicp_params_get_transfer_function)
  _WRAP_METHOD(void set_transfer_function(guint transfer_function), gdk_cicp_params_set_transfer_function)

  _WRAP_METHOD(guint get_matrix_coefficients() const, gdk_cicp_params_get_matrix_coefficients)
  _WRAP_METHOD(void set_matrix_coefficients(guint matrix_coefficients), gdk_cicp_params_set_matrix_coefficients)

  _WRAP_METHOD(Range get_range() const, gdk_cicp_params_get_range)
  _WRAP_METHOD(void set_range(Range range), gdk_cicp_params_set_range)

  _WRAP_METHOD(Glib::RefPtr<ColorState> build_color_state() const,
    gdk_cicp_params_build_color_state, errthrow "Gio::Error")

  _WRAP_PROPERTY("color-primaries", guint)
  _WRAP_PROPERTY("transfer-function", guint)
  _WRAP_PROPERTY("matrix-coefficients", guint)
  _WRAP_PROPERTY("range", Range)

  // There are no signals or public vfuncs.
};

} // namespace Gdk
