summaryrefslogtreecommitdiff
path: root/src/backends/meta-crtc.h
blob: 0a99e0287798c933f351b35ec1b99a78436a0c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
 * Copyright (C) 2017 Red Hat
 *
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 * 02111-1307, USA.
 */

#ifndef META_CRTC_H
#define META_CRTC_H

#include <glib-object.h>

#include "backends/meta-backend-types.h"
#include "backends/meta-crtc-mode.h"
#include "backends/meta-monitor-transform.h"
#include "core/util-private.h"
#include "meta/boxes.h"

typedef struct _MetaCrtcConfig
{
  graphene_rect_t layout;
  MetaMonitorTransform transform;
  MetaCrtcMode *mode;
} MetaCrtcConfig;

#define META_TYPE_CRTC (meta_crtc_get_type ())
META_EXPORT_TEST
G_DECLARE_DERIVABLE_TYPE (MetaCrtc, meta_crtc, META, CRTC, GObject)

struct _MetaCrtcClass
{
  GObjectClass parent_class;

  size_t (* get_gamma_lut_size) (MetaCrtc *crtc);

  MetaGammaLut * (* get_gamma_lut) (MetaCrtc *crtc);

  void (* set_gamma_lut) (MetaCrtc           *crtc,
                          const MetaGammaLut *lut);
};

META_EXPORT_TEST
uint64_t meta_crtc_get_id (MetaCrtc *crtc);

META_EXPORT_TEST
MetaBackend * meta_crtc_get_backend (MetaCrtc *crtc);

META_EXPORT_TEST
MetaGpu * meta_crtc_get_gpu (MetaCrtc *crtc);

META_EXPORT_TEST
const GList * meta_crtc_get_outputs (MetaCrtc *crtc);

void meta_crtc_assign_output (MetaCrtc   *crtc,
                              MetaOutput *output);

META_EXPORT_TEST
void meta_crtc_unassign_output (MetaCrtc   *crtc,
                                MetaOutput *output);

MetaMonitorTransform meta_crtc_get_all_transforms (MetaCrtc *crtc);

META_EXPORT_TEST
void meta_crtc_set_config (MetaCrtc             *crtc,
                           graphene_rect_t      *layout,
                           MetaCrtcMode         *mode,
                           MetaMonitorTransform  transform);

META_EXPORT_TEST
void meta_crtc_unset_config (MetaCrtc *crtc);

META_EXPORT_TEST
const MetaCrtcConfig * meta_crtc_get_config (MetaCrtc *crtc);

size_t meta_crtc_get_gamma_lut_size (MetaCrtc *crtc);

MetaGammaLut * meta_crtc_get_gamma_lut (MetaCrtc *crtc);

void meta_crtc_set_gamma_lut (MetaCrtc           *crtc,
                              const MetaGammaLut *lut);

META_EXPORT_TEST
void meta_gamma_lut_free (MetaGammaLut *lut);

META_EXPORT_TEST
MetaGammaLut * meta_gamma_lut_new (int             size,
                                   const uint16_t *red,
                                   const uint16_t *green,
                                   const uint16_t *blue);

MetaGammaLut * meta_gamma_lut_new_sized (int size);

META_EXPORT_TEST
MetaGammaLut * meta_gamma_lut_copy (const MetaGammaLut *gamma);

MetaGammaLut * meta_gamma_lut_copy_to_size (const MetaGammaLut *gamma,
                                            int                 target_size);

META_EXPORT_TEST
gboolean meta_gamma_lut_equal (const MetaGammaLut *gamma,
                               const MetaGammaLut *other_gamma);

G_DEFINE_AUTOPTR_CLEANUP_FUNC (MetaGammaLut, meta_gamma_lut_free)

#endif /* META_CRTC_H */