mutter/src/meta/meta-multi-texture-format.h
Niels De Graef 5181a826d1 compositor: Add MetaMultiTexture class
In future commits, we want to be able to handle more complex textures,
such as video frames which are encoded in a YUV-pixel format and have
multiple planes (which each map to a separate texture).

To accomplish this, we introduce a new object `MetaMultiTexture`: this
object can deal with more complex formats by handling multiple
`CoglTexture`s.

It supports shaders for pixel format conversion from YUV to RGBA, as
well as blending. While custom bleding is currently only required for
YUV formats, we also implement it for RGB ones. This allows us to
simplify code in other places and will be needed in the future once
we want to support blending between different color spaces.

Co-Authored-By: Robert Mader <robert.mader@collabora.com>
Co-Authored-By: Sebastian Wick <sebastian.wick@redhat.com>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2191>
2023-07-25 21:24:35 +00:00

47 lines
1.6 KiB
C

/*
* Authored By Niels De Graef <niels.degraef@barco.com>
*
* Copyright (C) 2018 Barco NV
*
* 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_MULTI_TEXTURE_FORMAT_H
#define META_MULTI_TEXTURE_FORMAT_H
#include <glib.h>
G_BEGIN_DECLS
/**
* MetaMultiTextureFormat:
* @META_MULTI_TEXTURE_FORMAT_INVALID: Invalid value
* @META_MULTI_TEXTURE_FORMAT_SIMPLE: Any format supported by Cogl (see #CoglPixelFormat)
* @META_MULTI_TEXTURE_FORMAT_YUYV: YUYV, 32 bits, 16 bpc (Y), 8 bpc (U & V)
* @META_MULTI_TEXTURE_FORMAT_NV12: 2 planes: 1 Y-plane, 1 UV-plane (2x2 subsampled)
* @META_MULTI_TEXTURE_FORMAT_YUV420: 3 planes: 1 Y-plane, 1 U-plane (2x2 subsampled), 1 V-plane (2x2 subsampled)
*/
typedef enum _MetaMultiTextureFormat
{
META_MULTI_TEXTURE_FORMAT_INVALID,
META_MULTI_TEXTURE_FORMAT_SIMPLE,
META_MULTI_TEXTURE_FORMAT_YUYV,
META_MULTI_TEXTURE_FORMAT_NV12,
META_MULTI_TEXTURE_FORMAT_YUV420,
} MetaMultiTextureFormat;
G_END_DECLS
#endif /* META_MULTI_TEXTURE_FORMAT_H */